Skip to content
Permalink
Browse files

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
  • Loading branch information...
hstonec authored and jianglai committed May 10, 2019
1 parent aa83472 commit b10f880b7fd630f89e40274440a5c7ff6126b861
Showing with 0 additions and 45 deletions.
  1. +0 −44 gradle/build.gradle
  2. +0 −1 gradle/gradle.properties
@@ -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 {
@@ -3,5 +3,4 @@ pluginsUrl=
uploaderDestination=
uploaderCredentialsFile=
uploaderMultithreadedUpload=
mavenCoordinateFile=
flowDocsFile=

0 comments on commit b10f880

Please sign in to comment.
You can’t perform that action at this time.