File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed
Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -65,21 +65,27 @@ val createVersions = tasks.register("createVersions") {
6565 .resolve(" edcbuild" )
6666 folder.mkdirs()
6767
68- versionCatalogs.find(" libs" )
69- .ifPresent { catalog ->
70- val head = " package org.eclipse.edc.plugins.edcbuild;\n public interface Versions {\n "
71- val tail = " \n }" ;
72-
73- val constants = listOf (" jupiter" , " mockito" , " assertj" )
74- .mapNotNull { name ->
75- catalog.findVersion(name)
76- .map { version -> " String %s = \" %s\" ;" .format(name.toUpperCase(), version) }
77- .orElse(null )
78- }
79- .joinToString(" \n " , head, tail)
80-
81- Files .writeString(folder.resolve(" Versions.java" ).toPath(), constants)
82- }
68+ val versionsClassFile = folder.resolve(" Versions.java" );
69+ outputs.file(versionsClassFile)
70+
71+ doLast {
72+ versionCatalogs.find(" libs" )
73+ .ifPresent { catalog ->
74+ val head = " package org.eclipse.edc.plugins.edcbuild;\n public interface Versions {\n "
75+ val tail = " \n }" ;
76+
77+ val constants = listOf (" jupiter" , " mockito" , " assertj" )
78+ .mapNotNull { name ->
79+ catalog.findVersion(name)
80+ .map { version -> " String %s = \" %s\" ;" .format(name.toUpperCase(), version) }
81+ .orElse(null )
82+ }
83+ .joinToString(" \n " , head, tail)
84+
85+ Files .writeString(versionsClassFile.toPath(), constants)
86+ }
87+ }
88+
8389}
8490
8591tasks.compileJava {
You can’t perform that action at this time.
0 commit comments