@@ -67,11 +67,13 @@ test {
6767 useJUnitPlatform()
6868}
6969
70- static isPluginJar (jarName ) {
71- return jarName. startsWith(' plugin-' ) ||
72- jarName. startsWith(' groovy' ) || jarName. startsWith(' jsonbeans' ) ||
73- jarName. startsWith(' jtidy' ) || jarName. startsWith(' languagesupport' ) ||
74- jarName. startsWith(' rhino' ) || jarName. startsWith(' tidy' )
70+ class JarPredicates {
71+ static boolean isPluginJar (String jarName ) {
72+ return jarName. startsWith(' plugin-' ) ||
73+ jarName. startsWith(' groovy' ) || jarName. startsWith(' jsonbeans' ) ||
74+ jarName. startsWith(' jtidy' ) || jarName. startsWith(' languagesupport' ) ||
75+ jarName. startsWith(' rhino' ) || jarName. startsWith(' tidy' )
76+ }
7577}
7678
7779compileJava {
@@ -82,8 +84,9 @@ compileJava {
8284}
8385
8486processResources {
87+ def projectRoot = projectDir
8588 doFirst {
86- new File (projectDir . absolutePath , ' build/resources/main/build-date.txt' ). text =
89+ new File (projectRoot , ' build/resources/main/build-date.txt' ). text =
8790 ZonedDateTime . now(ZoneOffset . UTC ). format(DateTimeFormatter . ISO_INSTANT )
8891 }
8992}
@@ -101,7 +104,7 @@ jar {
101104 ' Implementation-Version' : version,
102105 ' Build-Date' : Instant . now(). toString(),
103106 ' Main-Class' : ' org/fife/rtext/Main' ,
104- ' Class-Path' : configurations. runtimeClasspath. findAll { ! isPluginJar(it. name) }. collect {
107+ ' Class-Path' : configurations. runtimeClasspath. findAll { ! JarPredicates . isPluginJar(it. name) }. collect {
105108 def name = it. name
106109 System . out. println (name)
107110 return name
@@ -236,10 +239,19 @@ tasks.register('toolsJar', Jar) {
236239 )
237240 }
238241}
239- artifacts {
240- archives /* mainJar,*/ consoleJar, fileSystemTreeJar, heapIndicatorJar,
241- macroSupportJar, projectSupportJar, languageSupportJar,
242- sourceBrowserJar, taskListJar, tidyJar, toolsJar
242+ tasks. named(' assemble' ) {
243+ dependsOn(
244+ tasks. named(' consoleJar' ),
245+ tasks. named(' fileSystemTreeJar' ),
246+ tasks. named(' heapIndicatorJar' ),
247+ tasks. named(' macroSupportJar' ),
248+ tasks. named(' projectSupportJar' ),
249+ tasks. named(' languageSupportJar' ),
250+ tasks. named(' sourceBrowserJar' ),
251+ tasks. named(' taskListJar' ),
252+ tasks. named(' tidyJar' ),
253+ tasks. named(' toolsJar' )
254+ )
243255}
244256
245257distTar. dependsOn(jar, consoleJar, fileSystemTreeJar, heapIndicatorJar, macroSupportJar, projectSupportJar,
@@ -274,7 +286,7 @@ distributions {
274286 from { getDistributionFiles(configurations) }
275287 eachFile { details ->
276288 def path = details. path
277- if (isPluginJar(path)) {
289+ if (JarPredicates . isPluginJar(path)) {
278290 // println "Is a plugin jar: ${path}"
279291 details. path = " plugins/" + path
280292 }
0 commit comments