-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
224 lines (193 loc) · 8.51 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'java'
id 'distribution'
}
version = '0.2.2-SNAPSHOT'
sourceCompatibility = '21'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
ext {
binedLibraryVersion = '0.3.0-SNAPSHOT'
binedAppLibraryVersion = '0.2.4'
exbinFrameworkVersion = '0.3.0-SNAPSHOT'
binaryDataVersion = '0.2.2-SNAPSHOT'
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
// Disable tests on build
if (!gradle.startParameter.taskNames.any {it.endsWith("test")}) {
tasks.withType(Test) {enabled = false}
}
task testJar(type: Jar, dependsOn: testClasses) {
archiveClassifier = "tests"
archiveBaseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testJar
}
task sourceJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.java
from sourceSets.main.resources
}
if (!hasProperty('mainClass')) {
ext.mainClass = 'org.exbin.bined.ghidra.GhidraExtension'
}
task buildPack (type: Zip, dependsOn: tasks.jar) {
archiveBaseName = "bined-ghidra-extension"
into ('bined-ghidra-extension') {
duplicatesStrategy = 'exclude'
from (jar) {
into 'lib'
rename { filename -> "bined-ghidra-extension.jar" }
}
// final Zip zipTask = project.getTasks().create("zipTask", Zip.class)
// zipTask.from("${projectDir}/src")
// from (zipTask.archiveFile)
// TODO: Replace with archive of src directory
from (sourceJar) {
into 'lib'
rename { filename -> "bined-ghidra-extension-src-${version}.zip" }
}
from (configurations.runtimeClasspath) {
include '*'
// include 'bined*.jar'
// include 'binary_data*.jar'
// include 'jdom-legacy*.jar'
// include 'bcprov-jdk18on-1.80.jar'
into 'lib'
}
from ('data') {
into 'data'
}
from 'Module.manifest'
from 'certification.manifest'
from 'extension.properties'
from 'LICENSE.txt'
}
from 'src/dist/readme.txt'
}
// publish.dependsOn buildPack
buildPack.dependsOn assemble
def binedLibrary = { String libName ->
return (libName.endsWith('-SNAPSHOTX')) ? ":${libName}-${binedLibraryVersion}" : "org.exbin.bined:${libName}:${binedLibraryVersion}"
}
def binedAppLibrary = { String libName ->
return (binedAppLibraryVersion.endsWith('-SNAPSHOTX')) ? ":${libName}-${binedAppLibraryVersion}" : "org.exbin.framework:${libName}:${binedAppLibraryVersion}"
}
def exbinFrameworkLibrary = { String libName ->
return (exbinFrameworkVersion.endsWith('-SNAPSHOTX')) ? ":${libName}-${exbinFrameworkVersion}" : "org.exbin.framework:${libName}:${exbinFrameworkVersion}"
}
def binaryDataLibrary = { String libName ->
return (libName.endsWith('-SNAPSHOTX')) ? ":${libName}-${binaryDataVersion}" : "org.exbin.auxiliary:${libName}:${binaryDataVersion}"
}
repositories {
mavenCentral()
mavenLocal()
flatDir {
dirs "lib"
}
}
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")
}
ghidraInstallDir = "/home/hajdam/app/Ghidra/ghidra_11.2_PUBLIC"
if (ghidraInstallDir) {
if (gradle.startParameter.taskNames.contains('buildExtension')) {
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
}
} else {
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
}
dependencies {
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/patch', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Configurations', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Features', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Framework', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Processors', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Debug', include: "**/*.jar")
compileOnly fileTree(dir: ghidraInstallDir + '/Ghidra/Extensions',
include: "**/*.jar", exclude: project.name)
implementation(exbinFrameworkLibrary("exbin-framework"))
implementation(exbinFrameworkLibrary("exbin-framework-basic"))
implementation(exbinFrameworkLibrary("exbin-framework-frame"))
implementation(exbinFrameworkLibrary("exbin-framework-frame-api"))
implementation(exbinFrameworkLibrary("exbin-framework-ui"))
implementation(exbinFrameworkLibrary("exbin-framework-ui-api"))
implementation(exbinFrameworkLibrary("exbin-framework-component"))
implementation(exbinFrameworkLibrary("exbin-framework-component-api"))
// implementation(exbinFrameworkLibrary("exbin-framework-data"))
implementation(exbinFrameworkLibrary("exbin-framework-window"))
implementation(exbinFrameworkLibrary("exbin-framework-window-api"))
implementation(exbinFrameworkLibrary("exbin-framework-action"))
implementation(exbinFrameworkLibrary("exbin-framework-action-api"))
implementation(exbinFrameworkLibrary("exbin-framework-file"))
implementation(exbinFrameworkLibrary("exbin-framework-file-api"))
implementation(exbinFrameworkLibrary("exbin-framework-editor"))
implementation(exbinFrameworkLibrary("exbin-framework-editor-api"))
implementation(exbinFrameworkLibrary("exbin-framework-about-api"))
implementation(exbinFrameworkLibrary("exbin-framework-about"))
implementation(exbinFrameworkLibrary("exbin-framework-operation"))
implementation(exbinFrameworkLibrary("exbin-framework-operation-api"))
implementation(exbinFrameworkLibrary("exbin-framework-operation-undo"))
implementation(exbinFrameworkLibrary("exbin-framework-operation-undo-api"))
implementation(exbinFrameworkLibrary("exbin-framework-action-popup"))
implementation(exbinFrameworkLibrary("exbin-framework-action-popup-api"))
implementation(exbinFrameworkLibrary("exbin-framework-help-online"))
implementation(exbinFrameworkLibrary("exbin-framework-help-online-api"))
implementation(exbinFrameworkLibrary("exbin-framework-options"))
implementation(exbinFrameworkLibrary("exbin-framework-options-api"))
implementation(exbinFrameworkLibrary("exbin-framework-preferences-api"))
implementation(exbinFrameworkLibrary("exbin-framework-preferences"))
implementation(exbinFrameworkLibrary("exbin-framework-language-api"))
implementation(exbinFrameworkLibrary("exbin-framework-language"))
implementation(exbinFrameworkLibrary("exbin-framework-editor-text"))
implementation(exbinFrameworkLibrary("exbin-framework-utils"))
implementation(binedAppLibrary("exbin-framework-bined"))
implementation(binedAppLibrary("exbin-framework-bined-bookmarks"))
implementation(binedAppLibrary("exbin-framework-bined-compare"))
implementation(binedAppLibrary("exbin-framework-bined-inspector"))
implementation(binedAppLibrary("exbin-framework-bined-macro"))
implementation(binedAppLibrary("exbin-framework-bined-objectdata"))
implementation(binedAppLibrary("exbin-framework-bined-operation"))
implementation(binedAppLibrary("exbin-framework-bined-operation-bouncycastle"))
implementation(binedAppLibrary("exbin-framework-bined-search"))
implementation(binedAppLibrary("exbin-framework-bined-tool-content"))
implementation binedLibrary('bined-core')
implementation binedLibrary('bined-section')
implementation binedLibrary('bined-highlight-swing')
implementation binedLibrary('bined-operation')
implementation binedLibrary('bined-operation-swing')
implementation binedLibrary('bined-swing')
implementation binedLibrary('bined-swing-section')
implementation binaryDataLibrary('binary_data')
implementation binaryDataLibrary('binary_data-array')
implementation binaryDataLibrary('binary_data-delta')
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
// implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.80'
implementation "org.jdom:jdom-legacy:1.1.3"
testImplementation group : 'junit', name: 'junit', version: '4.13.2'
}
jar {
manifest {
attributes(
'Specification-Title': "BinedExtension",
'Specification-Version': "11.2",
'Main-Class': mainClass
)
}
}