Skip to content

Commit c8cde5a

Browse files
committed
Use the gradle configuration cache
1 parent 3acaae1 commit c8cde5a

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

build.gradle

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

7779
compileJava {
@@ -82,8 +84,9 @@ compileJava {
8284
}
8385

8486
processResources {
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

245257
distTar.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
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ jdkRoot=/Library/Java/JavaVirtualMachines/jdk-25.0.1+8/Contents/Home
1212
embeddedJreFolderName=jre-25.0.1
1313

1414
launch4jExe=C:/Progra~2/Launch4j/launch4jc.exe
15+
16+
org.gradle.configuration-cache=true

0 commit comments

Comments
 (0)