-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
51 lines (43 loc) · 1.17 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.nio.charset.Charset
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.7.20-Beta"
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
repositories {
mavenCentral()
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "18"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "18"
}
abstract class SetupTask : DefaultTask() {
private var isIgnored: Boolean = true
private var multiModule: Boolean = false
@Option(option = "multiModule", description = "")
fun setMulti(multiModule: String) {
this.multiModule = multiModule.toBoolean()
isIgnored = false
}
@TaskAction
fun process() {
if (!this.isIgnored) {
if (this.multiModule) {
File("./src").deleteRecursively()
} else {
File("./backend").deleteRecursively()
File("./frontend").deleteRecursively()
File("./settings.gradle.kts").writeText("", Charset.forName("utf8"))
}
}
}
}
tasks {
register<SetupTask>("setupWorkspace")
}