-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
76 lines (61 loc) · 2.14 KB
/
build.gradle
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
69
70
71
72
73
74
75
76
// Builds a Ghidra Extension for a given Ghidra installation.
//
// An absolute path to the Ghidra installation directory must be supplied
// To make this work well with IntelliJ this should be automatically resolve able and NOT an environmental variable
// You can either:
// * use the `gradle.properties` file in the extension folder to set it for this project
// * add the line `GHIDRA_INSTALL_DIR=/path/to/ghidras/ghidra_10.1_PUBLIC/` to your global config (`.gradle/gradle.properties` in your home folder)
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.9.23"
id 'idea'
id "org.jlleitschuh.gradle.ktlint" version "12.1.2"
}
repositories {
mavenCentral()
}
//----------------------START "DO NOT MODIFY" SECTION------------------------------
def ghidraInstallDir
if (System.env.GHIDRA_INSTALL_DIR) {
ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR
}
else if (project.hasProperty("GHIDRA_INSTALL_DIR")) {
ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR")
}
if (ghidraInstallDir) {
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
}
else {
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
}
//----------------------END "DO NOT MODIFY" SECTION-------------------------------
kotlin {
jvmToolchain(21)
}
dependencies {
// If you are using the Ghidra Jupyter Plugin for Kotlin, add the following line to declare it as a dependency
// This allows using the extension methods and makes sure that the required Kotlin libraries are present and not
// conflicting
// api fileTree(dir: ghidraInstallDir + '/Ghidra/Extensions/GhidraJupyterKotlin/', include: "**/*.jar")
// Unit testing dependencies
testImplementation 'org.jetbrains.kotlin:kotlin-test'
}
test {
useJUnitPlatform()
}
// Add the ghidra_scripts directory as an additional source set, so IntelliJ IDEA treats the scripts there as part of
// the module
// this means that your plugin code is available for code completion and analysis and that all dependencies of the module
// are inherited
sourceSets {
main {
kotlin {
srcDirs 'ghidra_scripts'
}
}
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}