Skip to content

Commit

Permalink
Have Jib CLI return correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh committed Mar 18, 2021
1 parent 5cfc9c8 commit 73ecf6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions jib-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ application {
mainClassName = cliMainClass
}

sourceSets.main.java.srcDirs += ["${buildDir}/generated-src"]

tasks.register('generateSources', Copy) {
// to re-run the task whenever the file changes
inputs.file 'gradle.properties'

from fileTree('src/java-templates')
into "${buildDir}/generated-src"

rename('\\.template$', '')
expand(['version': "${version}"])
}

compileJava.source generateSources

dependencies {
implementation project(':jib-core')
implementation project(':jib-plugins-common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public String[] getVersion() throws Exception {
}

public static String getVersionSimple() {
return "preview";
return "${version}";
}
}

0 comments on commit 73ecf6d

Please sign in to comment.