Parallel gradle builds + explicit output directory

This commit is contained in:
Frank van der Heijden 2021-01-08 10:22:07 +01:00
parent f265e4daf7
commit 0671b45185
No known key found for this signature in database
GPG key ID: 26DA56488D314D11
4 changed files with 21 additions and 1 deletions

View file

@ -28,4 +28,4 @@ jobs:
uses: actions/upload-artifact@v2.2.1
with:
name: ServerUtils
path: build/libs/*-all.jar
path: jars/*.jar

1
.gitignore vendored
View file

@ -2,5 +2,6 @@
.vs/
.gradle/
build/
jars/
*.class
*.jar

View file

@ -66,6 +66,23 @@ dependencies {
shadowJar {
relocate 'dev.frankheijden.minecraftreflection', dependencyDir + '.minecraftreflection'
archiveFileName = "${archiveBaseName.orNull}-${archiveVersion.orNull}.${archiveExtension.orNull}"
}
def outputTasks() {
["shadowJar", ":Bukkit:shadowJar", ":Bungee:shadowJar"].stream().map({ tasks.findByPath(it) })
}
task copyJars(type: Copy) {
outputTasks().forEach({ from(it) })
rename '(.*)-all.jar', '$1.jar'
into file('jars')
}
task cleanJars() {
delete file('jars')
}
clean.dependsOn cleanJars
build.dependsOn shadowJar
build.dependsOn copyJars

2
gradle.properties Normal file
View file

@ -0,0 +1,2 @@
org.gradle.parallel=true
org.gradle.jvmargs='-Dfile.encoding=UTF-8'