-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
56 lines (47 loc) · 1.04 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
54
55
56
plugins {
kotlin("jvm") version "1.9.0"
application
}
group = "com.madroid.aigc"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(8)
}
application {
mainClass.set("Llama2")
}
tasks.register<Copy>("createJarIfNeeded") {
from(sourceSets.main.get().output)
into("$buildDir/libs")
include("Llama2.jar")
duplicatesStrategy = DuplicatesStrategy.INCLUDE
doLast {
if (didWork) {
println("JAR file created successfully.")
} else {
println("JAR file already exists.")
}
}
}
tasks.register<JavaExec>("executeMain") {
dependsOn("createJarIfNeeded")
mainClass = "Llama2Kt"
val checkPoint = project.findProperty("cp")?.toString()
args = listOf(checkPoint)
classpath = sourceSets.main.get().runtimeClasspath
doFirst {
println("Executing main function...")
}
}
tasks.register("completion") {
dependsOn("executeMain")
}