Skip to content

Commit 77d6afe

Browse files
committed
Enable gradle configuration cache
1 parent 19e3122 commit 77d6afe

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id "base.fill-build-constants"
55
id "vialoader.publishing-conventions"
66
id "via.run-with-viaproxy-task"
7-
id "net.raphimc.class-token-replacer" version "1.1.4"
7+
id "net.raphimc.class-token-replacer" version "1.1.5"
88
}
99

1010
repositories {

buildSrc/src/main/groovy/base.base-conventions.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ tasks.withType(JavaCompile).configureEach {
2323

2424
tasks.withType(Javadoc).configureEach {
2525
it.options.encoding = "UTF-8"
26+
it.options.addStringOption("Xdoclint:none", "-quiet")
2627
}

buildSrc/src/main/groovy/via.run-with-viaproxy-task.gradle

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@ plugins {
22
id "base.exclude-run-folder"
33
}
44

5-
tasks.register("runViaProxy", JavaExec) {
5+
def prepareTask = tasks.register("prepareViaProxyFiles", Copy) {
66
dependsOn(tasks.jar)
77

8+
def projectName = project.name
9+
from(tasks.jar.archiveFile)
10+
into(file("run/jars"))
11+
rename { "${projectName}.jar" }
12+
}
13+
14+
def cleanupTask = tasks.register("cleanupViaProxyFiles", Delete) {
15+
delete(file("run/jars/${project.name}.jar"))
16+
delete(file("run/logs"))
17+
}
18+
19+
tasks.register("runViaProxy", JavaExec) {
20+
dependsOn(prepareTask)
21+
finalizedBy(cleanupTask)
22+
823
def viaProxyConfiguration = configurations.create("viaProxy")
924
viaProxyConfiguration.dependencies.add(dependencies.create("net.raphimc:ViaProxy:3.4.1") {
1025
transitive = false
@@ -14,15 +29,4 @@ tasks.register("runViaProxy", JavaExec) {
1429
classpath = viaProxyConfiguration
1530
workingDir = file("run")
1631
jvmArgs = ["-DskipUpdateCheck"]
17-
18-
doFirst {
19-
def jarsDir = file("$workingDir/jars")
20-
jarsDir.mkdirs()
21-
file("$jarsDir/${project.name}.jar").bytes = tasks.jar.archiveFile.get().asFile.bytes
22-
}
23-
24-
doLast {
25-
file("$workingDir/jars/${project.name}.jar").delete()
26-
file("$workingDir/logs").deleteDir()
27-
}
2832
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
org.gradle.daemon=true
22
org.gradle.parallel=true
3+
org.gradle.configuration-cache=true
34

45
java_version=17
56
maven_group=com.viaversion

0 commit comments

Comments
 (0)