Skip to content

Commit

Permalink
Add setupWorkspace task
Browse files Browse the repository at this point in the history
  • Loading branch information
noonmaru committed Oct 8, 2020
1 parent b533fae commit 88e02a9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ build/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
!gradle-wrapper.properties
!gradle-wrapper.properties

# BuildTools.jar
.buildtools/
47 changes: 25 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,33 +85,36 @@ subprojects {
assemble {
dependsOn(shadowJar)
}
create<de.undercouch.gradle.tasks.download.Download>("downloadBuildTools") {
src("https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar")
dest(".buildtools/BuildTools.jar")
}
create<DefaultTask>("setupWorkspace") {
doLast {
for (v in listOf("1.16.3")) {
javaexec {
workingDir(".buildtools/")
main = "-jar"
args = listOf(
"./BuildTools.jar",
"--rev",
v
)
}
}
File(".buildtools/").deleteRecursively()
}

dependsOn(named("downloadBuildTools"))
}
}
}

project(":psychics-common") {
apply(plugin = "maven-publish")
}

tasks {
create<de.undercouch.gradle.tasks.download.Download>("downloadBuildTools") {
src("https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar")
dest(".buildtools/BuildTools.jar")
}
create<DefaultTask>("setupWorkspace") {
doLast {
for (v in listOf("1.16.3")) {
javaexec {
workingDir(".buildtools/")
main = "-jar"
args = listOf(
"./BuildTools.jar",
"--rev",
v
)
}
}
File(".buildtools/").deleteRecursively()
}

dependsOn(named("downloadBuildTools"))
}
}

gradle.buildFinished { buildDir.deleteRecursively() }

0 comments on commit 88e02a9

Please sign in to comment.