Skip to content

Commit 64f0b7e

Browse files
fill variables
Issues: IN-606
1 parent a5edb9f commit 64f0b7e

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ java {
2525
compileJava.options.encoding = "UTF-8"
2626
compileTestJava.options.encoding = "UTF-8"
2727

28+
ext {
29+
jdflibjVersion = '2.+'
30+
}
31+
2832
publishing {
2933
publications {
3034
mavenJava(MavenPublication) {
@@ -116,13 +120,24 @@ javadoc {
116120
}
117121
}
118122

123+
afterEvaluate {
124+
def jdflibj = configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.find {
125+
it.moduleVersion.id.group == 'org.cip4.lib.jdf' && it.moduleVersion.id.name == 'JDFLibJ'
126+
}
127+
if (jdflibj) {
128+
ext.jdflibjResolvedVersion = jdflibj.moduleVersion.id.version
129+
}
130+
}
131+
119132
processResources {
120-
filesMatching(['**/*.properties']) {
133+
def version = project.hasProperty('jdflibjResolvedVersion') ? project.jdflibjResolvedVersion : jdflibjVersion
134+
filesMatching(['**/*.properties', '**/index.html']) {
121135
filter(ReplaceTokens, tokens: [
122136
'name': project.properties['description'],
123137
'version': project.properties['version'],
124138
'artifactId': project.properties['name'],
125-
'timestamp': new Date().format('yyyy-MM-dd HH:mm:ssZ')
139+
'timestamp': new Date().format('yyyy-MM-dd HH:mm:ssZ'),
140+
'jdflibj.version': version
126141
])
127142
}
128143
}

src/main/resources/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ <h1>FixJDF</h1>
272272
<div class="col-12">
273273
<small>
274274
<b>JDFToolbox</b>
275-
build ${build} (${timestamp})
276-
<i>based on JDFLibJ ${jdflibj.version}</i>
275+
build @version@ (@timestamp@)
276+
<i>based on JDFLibJ @jdflibj.version@</i>
277277
</small>
278278
</div>
279279
</div>

0 commit comments

Comments
 (0)