Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Commit

Permalink
Update to Gradle 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Xerus committed Sep 5, 2018
1 parent a12a61d commit 81c45e8
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ plugins {
}

// source directories
java.sourceSets {
"main" {
sourceSets {
getByName("main") {
java.srcDir("src/main")
resources.srcDir("src/resources")
}
"test" {
java.srcDir("src/test")
}
getByName("test").java.srcDir("src/test")
}


Expand Down Expand Up @@ -65,7 +63,7 @@ dependencies {
}

val file
get() = "$name-$version.jar"
get() = "MonsterUtilities-$version.jar"

val MAIN = "_Main"
tasks {
Expand All @@ -83,33 +81,32 @@ tasks {
baseName = "MonsterUtilities"
classifier = ""
destinationDir = file(".")
doLast {
file(file).setExecutable(true)
}
doLast { file(file).setExecutable(true) }
}

val release by creating(Exec::class) {
create<Exec>("release") {
dependsOn("jar")
group = MAIN
val path = file("../monsterutilities-extras/website/downloads/" + if (isUnstable) "unstable" else "latest")
val pathLatest = path.resolveSibling("latest")
val pathLatest = path.resolveSibling("latest") // TODO temporary workaround until real release
doFirst {
path.writeText(version.toString())
// TODO temporary workaround until real release
pathLatest.writeText(version.toString())
exec { commandLine("git", "tag", version) }
}
val s = if (OperatingSystem.current().isWindows) "\\" else ""
commandLine("lftp", "-c", """set ftp:ssl-allow true; set ssl:verify-certificate no;
commandLine("lftp", "-c", """set ftp:ssl-allow true; set ssl:verify-certificate no;
open -u ${properties["credentials.ftp"]} -e $s"
cd /www/downloads; ${if (properties["noversion"] == null) "put $path; put $pathLatest;" else ""}
cd ./files; ${if (properties["noversion"] == null) "mrm ${rootProject.name}-*-*.jar;" else ""} put $file;
cd ./files; put $file;
quit$s" monsterutilities.bplaced.net""".filter { it != '\t' && it != '\n' })
}

withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

tasks.replace("jar", Delete::class.java).apply {
replace("jar", Delete::class).run {
group = MAIN
dependsOn("shadowJar")
setDelete(file(".").listFiles { f -> f.name.run { startsWith("${rootProject.name}-") && endsWith("jar") && this != file } })
Expand Down

0 comments on commit 81c45e8

Please sign in to comment.