-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
68 lines (56 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Properties
plugins {
kotlin("jvm") version "1.9.21"
id("com.github.ben-manes.versions") version "0.50.0"
}
group = "com.martmists"
version = "1.0.0"
val fp = File(projectDir, "gradle-local.properties")
if (fp.exists()) {
val props = Properties()
props.load(fp.inputStream())
for ((k, v) in props) {
extra[k.toString()] = v.toString()
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
}
val main by sourceSets.getting {
java.srcDirs(
"ghidra_scripts",
)
}
val ghidraInstallDir = System.getenv("GHIDRA_INSTALL_DIR") ?: project.properties["GHIDRA_INSTALL_DIR"] as? String ?: throw GradleException("GHIDRA_INSTALL_DIR not set")
apply(from = "$ghidraInstallDir/support/buildExtension.gradle")
tasks {
val buildExtension by getting(Zip::class) {
exclude(
".idea/",
"gradle/",
"dist/",
"*.kts",
"gradle*.properties",
"*.cxi",
"*.cia",
"exefs/",
"romfs/",
)
}
withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs = listOf(
"-opt-in=kotlin.contracts.ExperimentalContracts"
)
}
}
}