Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
fix: fix dependencies.properties resource file creation during deploy…
Browse files Browse the repository at this point in the history
…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 3e7e1f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 0 additions & 10 deletions build.gradle
Expand Up @@ -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() }

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

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions gax/build.gradle
Expand Up @@ -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,
Expand Down

0 comments on commit 3e7e1f1

Please sign in to comment.