From b84fb004c8aafc9dc925d9967bfa8ec66ef95f2b Mon Sep 17 00:00:00 2001 From: shicong Date: Fri, 10 May 2019 07:34:10 -0700 Subject: [PATCH] Add source code and JAR file to internal repository This CL made the following changes to achieve the purpose: 1. Modified HttpProxy.java to generate a file containing Maven coordinates for all requested JAR files. This is to replace Gradle task "generateMavenCoordinateForDependency" which served for the same purpose before. The reason is during the course of the build, Gradle may request some POM file of a artifact for some reason but it doesn't actually need the JAR file. However, task "generateMavenCoordinateForDependency" cannot identify this use case so it added more JARs to the dependency which are not necessary and are not consistent with what we get from HttpProxy.java. Going forward, we will use HttpProxy.java as the single source to provide dependency. 2. Updated update_deps_metadata.py to retrieve *-sources.jar for each dependency for obvious reason. 3. Improved update_dependency.sh by removing 1 unnecessary build. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=247607871 --- gradle/build.gradle | 44 ---------------------------------------- gradle/gradle.properties | 1 - 2 files changed, 45 deletions(-) diff --git a/gradle/build.gradle b/gradle/build.gradle index 8637db576..a100183ab 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -77,20 +77,6 @@ task stage { description = 'Generates application directories for all services.' } -ext.constructMavenCoordinate = { deps, distinctMetadata -> - if (deps.isEmpty()) { - return - } - deps.each { ResolvedDependency dep -> - if (dep.moduleGroup == "nomulus") { - return - } - def artifactId = "${dep.moduleGroup}:${dep.moduleName}:${dep.moduleVersion}" - distinctMetadata.add(artifactId) - rootProject.constructMavenCoordinate(dep.children, distinctMetadata) - } -} - allprojects { // Skip no-op project if (project.name == 'services') return @@ -106,36 +92,6 @@ allprojects { mavenCentral() } } - - // This task generates a Maven coordinate for each resolved dependency and - // stores them in the given file. - task generateMavenCoordinateForDependency { - doLast { - def allconfigs = [] - def distinctMetadata = [] as Set - if (!rootProject.mavenCoordinateFile) { - throw new IllegalArgumentException("mavenCoordinateFile must be set") - } - def outputFile = new File(rootProject.mavenCoordinateFile) - - allconfigs.addAll(configurations) - // This only adds buildscript dependencies declare in this project. - allconfigs.addAll(buildscript.configurations) - - allconfigs.each { - if (!it.isCanBeResolved()) { - return - } - rootProject.constructMavenCoordinate( - it.resolvedConfiguration.firstLevelModuleDependencies, - distinctMetadata) - } - - distinctMetadata.each { metadata -> - outputFile.append("${metadata}\n") - } - } - } } subprojects { diff --git a/gradle/gradle.properties b/gradle/gradle.properties index 833ee488a..880f203d5 100644 --- a/gradle/gradle.properties +++ b/gradle/gradle.properties @@ -3,5 +3,4 @@ pluginsUrl= uploaderDestination= uploaderCredentialsFile= uploaderMultithreadedUpload= -mavenCoordinateFile= flowDocsFile=