forked from Narbase/narcore-kunafa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
57 lines (46 loc) · 1.54 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
52
53
allprojects {
version = "1.0.0"
repositories {
maven(url = "https://dl.bintray.com/kotlin/kotlin-dev/")
maven(url = "https://dl.bintray.com/kotlin/kotlinx/")
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/")
mavenCentral()
}
apply(plugin = "io.gitlab.arturbosch.detekt")
}
plugins {
kotlin("jvm") version "1.7.10" apply false
kotlin("js") version "1.7.10" apply false
kotlin("multiplatform") version "1.7.10" apply false
id("io.gitlab.arturbosch.detekt").version("1.22.0")
}
tasks.register("buildRelease") {
val outputJarName = "narcore"
val serverProjectName = "narcore-server"
val webProjectName = "narcore-web"
dependsOn(":$serverProjectName:jar")
dependsOn(":$webProjectName:build")
doLast {
println("Building release")
val releaseDir = File("./releases/$version/")
val webReleaseDir = File("./releases/$version/web/")
releaseDir.deleteRecursively()
releaseDir.mkdirs()
webReleaseDir.mkdirs()
File("./$webProjectName/build/distributions/").copyRecursively(webReleaseDir, overwrite = true)
File("./$serverProjectName/build/libs/$serverProjectName-$version.jar").copyTo(
File("${releaseDir.path}/$outputJarName.jar"),
overwrite = true
)
}
}
repositories {
mavenCentral()
}
tasks.register("copyHook") {
File("./scripts/pre-commit").copyTo(
File("./.git/hooks/pre-commit"),
overwrite = true
)
mustRunAfter("build")
}