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
This commit is contained in:
shicong 2019-05-10 07:34:10 -07:00 committed by jianglai
parent d7b443d284
commit b84fb004c8
2 changed files with 0 additions and 45 deletions

View file

@ -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 {

View file

@ -3,5 +3,4 @@ pluginsUrl=
uploaderDestination=
uploaderCredentialsFile=
uploaderMultithreadedUpload=
mavenCoordinateFile=
flowDocsFile=