mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-21 19:42:14 +00:00
138 lines
3.4 KiB
Groovy
138 lines
3.4 KiB
Groovy
import org.gradle.plugins.ide.eclipse.model.Container;
|
|
import org.gradle.plugins.ide.eclipse.model.Library;
|
|
|
|
|
|
/*********************************************************************************
|
|
* Subproject configuration
|
|
* - all subs will have access to these properties.
|
|
*********************************************************************************/
|
|
|
|
subprojects {
|
|
apply plugin: 'java'
|
|
|
|
compileJava {
|
|
options.compilerArgs << '-Xlint:none'
|
|
options.compilerArgs << '-XDignore.symbol.file'
|
|
options.fork = true
|
|
options.warnings = false
|
|
}
|
|
|
|
compileTestJava {
|
|
options.compilerArgs << '-Xlint:none'
|
|
options.compilerArgs << '-XDignore.symbol.file'
|
|
options.fork = true
|
|
options.warnings = false
|
|
}
|
|
|
|
plugins.withId('java') {
|
|
sourceCompatibility = "${rootProject.JAVA_COMPILER}"
|
|
targetCompatibility = "${rootProject.JAVA_COMPILER}"
|
|
}
|
|
|
|
|
|
jar {
|
|
manifest {
|
|
attributes (
|
|
"Specification-Title": "${project.name}",
|
|
"Specification-Version": "${rootProject.RELEASE_VERSION}",
|
|
"Specification-Vendor": "Ghidra"
|
|
)
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDir 'src/main/java'
|
|
}
|
|
resources {
|
|
srcDir 'src/main/resources'
|
|
}
|
|
}
|
|
test {
|
|
java {
|
|
srcDir 'src/test/java'
|
|
}
|
|
resources {
|
|
srcDir 'src/test/resources'
|
|
}
|
|
}
|
|
integrationTest {
|
|
java {
|
|
srcDirs = ['src/test.slow/java'] // overwrite srcDir with new path
|
|
compileClasspath += main.output + test.output
|
|
runtimeClasspath += main.output + test.output
|
|
}
|
|
resources {
|
|
srcDirs = ['src/test.slow/resources']
|
|
}
|
|
}
|
|
screenShots {
|
|
java {
|
|
srcDir 'src/screen/java'
|
|
compileClasspath += main.output
|
|
runtimeClasspath += main.output
|
|
}
|
|
}
|
|
cunitTest {
|
|
java {
|
|
srcDir 'src/test.processors/java'
|
|
compileClasspath += main.output
|
|
runtimeClasspath += main.output
|
|
}
|
|
resources {
|
|
srcDir 'src/test.processors/resources'
|
|
}
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
integrationTestCompile.extendsFrom testCompile
|
|
integrationTestRuntime.extendsFrom testRuntime, integrationTestCompile
|
|
cunitTestCompile.extendsFrom compile
|
|
}
|
|
|
|
|
|
/*
|
|
Provide test dependencies here so each build file does not have to.
|
|
*/
|
|
dependencies {
|
|
integrationTestCompile "org.hamcrest:hamcrest-all:1.3"
|
|
integrationTestCompile "org.jmockit:jmockit:1.44"
|
|
|
|
testCompile "org.hamcrest:hamcrest-all:1.3"
|
|
testCompile "org.jmockit:jmockit:1.44"
|
|
|
|
testCompile "junit:junit:4.12"
|
|
}
|
|
|
|
// For Java 9, we must explicitly export references to the internal classes we are using.
|
|
// We export them to all "unnamed" modules, which are modules that don't define themselves
|
|
// as a new Java 9 style module. Ghidra is currently using unnamed modules everywhere.
|
|
ext.addExports = { List<String> exports ->
|
|
tasks.withType(JavaCompile) {
|
|
exports.each {
|
|
options.compilerArgs.addAll(['--add-exports', it])
|
|
}
|
|
}
|
|
|
|
eclipse.classpath.file.whenMerged { classpath ->
|
|
classpath.entries.each { ent ->
|
|
if (ent instanceof Container && ent.path.contains('JRE_CONTAINER')) {
|
|
ent.entryAttributes.put('module', true);
|
|
ent.entryAttributes.put('add-exports', exports.join(':'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
eclipse.classpath.file.whenMerged { classpath ->
|
|
classpath.entries.removeAll { ent ->
|
|
ent instanceof Library && !ent.path.endsWith('.jar')
|
|
}
|
|
classpath.entries.findAll { entry -> entry.kind == 'lib' }*.exported = true
|
|
}
|
|
}
|
|
}
|