Skip to content
Permalink
Browse files
fix: fix dependencies.properties resource file creation during deploy…
…ment (#1163)

* fix: immediately populate the dependencies.properties resource file

* fix: generate the dependences.properties file as a generated-resource and include in sources
  • Loading branch information
chingor13 committed Aug 6, 2020
1 parent 6241a21 commit 3e7e1f1e64bdeb23a51b5155faea975beec0bc84
Showing with 10 additions and 10 deletions.
  1. +0 −10 build.gradle
  2. +10 −0 gax/build.gradle
@@ -41,14 +41,6 @@ googleJavaFormat {
exclude 'bazel*/**'
}

task generateProjectProperties {
ext.outputFile = file("gax/src/main/resources/dependencies.properties")
outputs.file(outputFile)
doLast {
outputFile.text = "version.gax=${project.version}"
}
}

// google-java-format-gradle-plugin:0.8 does not work with Java 1.7.
verifyGoogleJavaFormat.onlyIf { JavaVersion.current().isJava8Compatible() }

@@ -93,7 +85,6 @@ allprojects {
}
}
test.dependsOn verifyLicense
test.dependsOn generateProjectProperties

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
@@ -174,7 +165,6 @@ subprojects {
// ----------

task sourcesJar(type: Jar, dependsOn: classes) {
dependsOn generateProjectProperties
classifier = 'sources'

from sourceSets.main.allSource, sourceSets.test.allSource, sourceSets.main.resources.srcDirs
@@ -23,6 +23,16 @@ dependencies {
shadowNoGuava libraries['maven.com_google_guava_guava']
}

ext.generatedOutputDir = file("${buildDir}/generated-resources")
task generateProjectProperties {
ext.outputFile = file("${generatedOutputDir}/dependencies.properties")
outputs.file(outputFile)
doLast {
outputFile.text = "version.gax=${project.version}"
}
}
sourceSets.main.output.dir generatedOutputDir, builtBy: generateProjectProperties

jar {
manifest {
attributes 'Specification-Title': project.name,

0 comments on commit 3e7e1f1

Please sign in to comment.