...
 
Commits (5)
gradle (3.4.1-8) unstable; urgency=medium
* Team upload.
* Added a hook in MavenResolver to resolve the artifacts from the system
repository
* Build depend on default-jdk instead of default-jdk-headless
(Closes: #896436)
* Standards-Version updated to 4.2.1
* Use salsa.debian.org Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Sun, 16 Sep 2018 12:18:43 +0200
gradle (3.4.1-7) unstable; urgency=medium
* Team upload.
......
......@@ -8,7 +8,7 @@ Build-Depends: ant,
checkstyle,
debhelper (>= 11),
default-jdk-doc,
default-jdk-headless | default-jdk (>= 2:1.7),
default-jdk (>= 2:1.7),
dh-exec,
docbook-xsl,
gradle (>= 2.13),
......@@ -75,9 +75,9 @@ Build-Depends: ant,
maven-repo-helper,
pandoc,
testng
Standards-Version: 4.1.4
Vcs-Git: https://anonscm.debian.org/git/pkg-java/gradle.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/gradle.git
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/java-team/gradle.git
Vcs-Browser: https://salsa.debian.org/java-team/gradle
Homepage: http://gradle.org
Package: gradle
......
Description: Adds a hook in MavenResolver to resolve the artifacts from the system repository
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/resolver/MavenResolver.java
+++ b/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/resolver/MavenResolver.java
@@ -91,6 +91,35 @@
}
protected void doResolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata prescribedMetaData, BuildableModuleComponentMetaDataResolveResult result) {
+ if (getRoot().toString().contains("/usr/share/maven-repo")) {
+ // Debian system repository detected, call the gradle-debian-helper
+ // hook if available to rewrite the dependencies on the fly
+ try {
+ Class resolverHookClass = Class.forName("org.debian.gradle.plugin.MavenResolverHook");
+ Object hook = resolverHookClass.getMethod("getInstance").invoke(null);
+ java.lang.reflect.Method rewrite = resolverHookClass.getMethod("rewrite", String.class, String.class, String.class, String.class, String.class);
+
+ String groupId = moduleComponentIdentifier.getGroup();
+ String artifactId = moduleComponentIdentifier.getModule();
+ String version = moduleComponentIdentifier.getVersion();
+ String classifier = null;
+ String type = "jar";
+ if (!prescribedMetaData.getArtifacts().isEmpty()) {
+ IvyArtifactName ivyArtifactName = prescribedMetaData.getArtifacts().iterator().next();
+ classifier = ivyArtifactName.getClassifier();
+ type = ivyArtifactName.getType();
+ }
+ java.util.Map<String, String> dependency = (java.util.Map<String, String>) rewrite.invoke(hook, groupId, artifactId, version, type, classifier);
+ if (dependency != null) {
+ moduleComponentIdentifier = new DefaultModuleComponentIdentifier(dependency.get("groupId"), dependency.get("artifactId"), dependency.get("version"));
+ prescribedMetaData = new org.gradle.internal.component.model.DefaultComponentOverrideMetadata();
+ prescribedMetaData.getArtifacts().add(new DefaultIvyArtifactName(dependency.get("artifactId"), dependency.get("type"), dependency.get("type"), dependency.get("classifier")));
+ }
+ } catch (Throwable t) {
+ System.out.println("\tCouldn't resolve system dependency:");
+ t.printStackTrace();
+ }
+ }
if (isNonUniqueSnapshot(moduleComponentIdentifier)) {
MavenUniqueSnapshotModuleSource uniqueSnapshotVersion = findUniqueSnapshotVersion(moduleComponentIdentifier, result);
if (uniqueSnapshotVersion != null) {
gradle-debian-helper-hook.patch
33_scala_zinc.diff
search_system_jar.diff
relax_warnings.diff
......
......@@ -54,9 +54,6 @@ override_dh_install:
rm debian/gradle-doc/usr/share/doc/gradle/dsl/dsl-standalone.html
rm debian/gradle-doc/usr/share/doc/gradle/dsl/sidebar.js
get-orig-source:
uscan --download-current-version --force-download --repack --compression xz
# since gradle build-depends on itself, a way to generate a deb from upstream
# binary distribution is provided with this target. With the resulting .deb,
# gradle can be rebuilt from source.
......
version=4
http://services.gradle.org/distributions /distributions/@PACKAGE@-([\d\.]+)-src@ARCHIVE_EXT@
\ No newline at end of file
opts="repack,compression=xz" \
http://services.gradle.org/distributions /distributions/@PACKAGE@-([\d\.]+)-src@ARCHIVE_EXT@