Skip to content

Commit

Permalink
Major refactoring of the gradle build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghidravore committed Apr 23, 2019
1 parent 62a180e commit f1e50fb
Show file tree
Hide file tree
Showing 198 changed files with 2,005 additions and 2,252 deletions.
2 changes: 2 additions & 0 deletions GPL/CabExtract/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply plugin: 'eclipse'

eclipse.project.name = 'GPL CabExtract'

project.ext.cabextract = "cabextract-1.6"
Expand Down
2 changes: 0 additions & 2 deletions GPL/CabExtract/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##VERSION: 2.0
##MODULE IP: GPL 3
##MODULE IP: Public Domain
.classpath||Public Domain||||END|
.project||Public Domain||||END|
Module.manifest||Public Domain||||END|
build.gradle||Public Domain||||END|
data/cabextract-1.6.tar.gz||GPL 3||||END|
5 changes: 5 additions & 0 deletions GPL/DMG/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'

eclipse.project.name = 'GPL DMG'

/*********************************************************************************
Expand Down
2 changes: 0 additions & 2 deletions GPL/DMG/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
##MODULE IP: GPL 3
##MODULE IP: LGPL 2.1
##MODULE IP: Public Domain
.classpath||Public Domain||||END|
.project||Public Domain||||END|
Module.manifest||Public Domain||||END|
build.gradle||Public Domain||||END|
data/lib/catacombae_csframework.jar||LGPL 2.1||||END|
Expand Down
3 changes: 3 additions & 0 deletions GPL/DemanglerGnu/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply plugin: 'eclipse'


eclipse.project.name = 'GPL DemanglerGnu'

apply from: "../nativeBuildProperties.gradle"
Expand Down
2 changes: 0 additions & 2 deletions GPL/DemanglerGnu/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
##MODULE IP: LGPL 2.1
##MODULE IP: LGPL 3.0
##MODULE IP: Public Domain
.classpath||GHIDRA||||END|
.project||Public Domain||||END|
Module.manifest||Public Domain||||END|
build.gradle||Public Domain||||END|
src/demangler_gnu/README.txt||Public Domain||||END|
24 changes: 23 additions & 1 deletion GPL/nativeBuildProperties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def isNativeBinaryMakeTask(Task task, String platform) {
******************************************************************************************/
tasks.addRule("Pattern: buildNatives_<platform name>]: build all natives for given platform") { String taskName ->

if (taskName.startsWith("buildNatives_") && !project.hasProperty('EXCLUDE_FROM_NATIVE_BUILD')) {
if (taskName.startsWith("buildNatives_")) {
String platform = taskName - "buildNatives_"

task(taskName) { myTask ->
Expand Down Expand Up @@ -180,3 +180,25 @@ tasks.addRule("Pattern: prebuildNatives_<platform name>]: build all natives for
}
}
}

/*****************************************************************************************
* The following block of code changes the output directory for native builds
* to <projectDir>/build/os/<platform>/<executable> ?? is there a better way to do this?
****************************************************************************************/
gradle.taskGraph.whenReady {
def p = this.project
p.tasks.withType(LinkExecutable).each { t ->
File f = t.linkedFile.getAsFile().get()
String filename = f.getName()
NativePlatform platform = t.targetPlatform.get()
String osName = platform.getName()
t.linkedFile = p.file("build/os/${osName}/$filename")
}
p.tasks.withType(LinkSharedLibrary).each { t ->
File f = t.linkedFile.getAsFile().get()
String filename = f.getName()
NativePlatform platform = t.targetPlatform.get()
String osName = platform.getName()
t.linkedFile = p.file("build/os/${osName}/$filename")
}
}
4 changes: 4 additions & 0 deletions Ghidra/Configurations/Public_Release/build.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Z Public Release'
22 changes: 0 additions & 22 deletions Ghidra/Configurations/Public_Release/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
##VERSION: 2.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
data/PDB_SYMBOL_SERVER_URLS.pdburl||GHIDRA||||END|
src/global/docs/ChangeHistory.html||GHIDRA||||END|
src/global/docs/UserAgreement.html||GHIDRA||||END|
src/global/docs/WhatsNew.html||GHIDRA||||END|
src/global/docs/languages/html/Diagram1.png||GHIDRA||||END|
src/global/docs/languages/html/Diagram2.png||GHIDRA||||END|
src/global/docs/languages/html/Diagram3.png||GHIDRA||||END|
src/global/docs/languages/html/additionalpcode.html||GHIDRA||||END|
src/global/docs/languages/html/pcodedescription.html||GHIDRA||||END|
src/global/docs/languages/html/pcoderef.html||GHIDRA||||END|
src/global/docs/languages/html/pseudo-ops.html||GHIDRA||||END|
src/global/docs/languages/html/reference.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_constructors.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_context.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_definitions.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_layout.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_preprocessing.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_ref.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_symbols.html||GHIDRA||||END|
src/global/docs/languages/html/sleigh_tokens.html||GHIDRA||||END|
src/global/docs/languages/index.html||GHIDRA||||END|
src/global/docs/languages/manual_index.txt||GHIDRA||||END|
src/global/docs/languages/versioning.html||GHIDRA||||END|
src/main/resources/UserAgreement.html||GHIDRA||||END|
src/main/resources/defaultTools/CodeBrowser.tool||GHIDRA||||END|
src/main/resources/splash.txt||GHIDRA||||END|
6 changes: 4 additions & 2 deletions Ghidra/Extensions/SampleTablePlugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraExtension.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Xtra SampleTablePlugin'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"

project.ext.includeExtensionInInstallation = true

dependencies {
compile project(':Base')
Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Extensions/SampleTablePlugin/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##VERSION: 2.0
##MODULE IP: FAMFAMFAM Icons - CC 2.5
##MODULE IP: Oxygen Icons - LGPL 3.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||reviewed||END|
build.gradle||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
Expand Down
7 changes: 4 additions & 3 deletions Ghidra/Extensions/sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraExtension.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Xtra sample'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"

project.ext.includeExtensionInInstallation = true

dependencies {
compile project(':Base')
Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Extensions/sample/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##VERSION: 2.0
##MODULE IP: FAMFAMFAM Icons - CC 2.5
##MODULE IP: Oxygen Icons - LGPL 3.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||reviewed||END|
build.gradle||GHIDRA||||END|
data/README.txt||GHIDRA||||END|
Expand Down
18 changes: 10 additions & 8 deletions Ghidra/Features/Base/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features Base'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"
apply from: "$rootProject.projectDir/gradleScripts/ghidraScripts.gradle"
apply from: "$rootProject.projectDir/gradleScripts/developerScripts.gradle"

/*
This build file is a bit different than most project build files, as it initializes
Expand All @@ -28,10 +30,10 @@ dependencies {
compileOnly "junit:junit:4.12"

// These have abstract test classes and stubs needed by this module
testCompile project(':Docking').sourceSets.test.output
testCompile project(':Generic').sourceSets.test.output
testCompile project(':Project').sourceSets.test.output
testCompile project(':SoftwareModeling').sourceSets.test.output
testCompile project(path: ':Docking', configuration: 'testArtifacts')
testCompile project(path: ':Generic', configuration: 'testArtifacts')
testCompile project(path: ':Project', configuration: 'testArtifacts')
testCompile project(path: ':SoftwareModeling', configuration: 'testArtifacts')

javacc 'net.java.dev.javacc:javacc:5.0'
}
Expand Down Expand Up @@ -147,7 +149,7 @@ def createTipsHelpFile(input, output) {
Dependency Setup
*/
compileJava.dependsOn buildJavacc
prepDev.dependsOn buildJavacc
rootProject.prepDev.dependsOn buildJavacc

// 'indexHelp' is defined in the buildHelp.gradle 'script plugin'
indexHelp.dependsOn generateExtraHelpFiles
2 changes: 0 additions & 2 deletions Ghidra/Features/Base/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
##MODULE IP: Nuvola Icons - LGPL 2.1
##MODULE IP: Oxygen Icons - LGPL 3.0
##MODULE IP: Tango Icons - Public Domain
.classpath||GHIDRA||||END|
.gitignore||GHIDRA||||END|
.launch/Ghidra.launch||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
data/ElfFunctionsThatDoNotReturn||GHIDRA||||END|
Expand Down
7 changes: 5 additions & 2 deletions Ghidra/Features/BytePatterns/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features BytePatterns'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"
apply from: "$rootProject.projectDir/gradleScripts/ghidraScripts.gradle"

dependencies {
compile project(':Base')
Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Features/BytePatterns/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
##VERSION: 2.0
##MODULE IP: Oxygen Icons - LGPL 3.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||reviewed||END|
build.gradle||GHIDRA||||END|
data/test/FileBitPatternInfoReaderTestFile1.xml||GHIDRA||||END|
Expand Down
7 changes: 5 additions & 2 deletions Ghidra/Features/ByteViewer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features ByteViewer'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"

dependencies {

compile project(':Base')
Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Features/ByteViewer/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
##VERSION: 2.0
##MODULE IP: FAMFAMFAM Icons - CC 2.5
##MODULE IP: Oxygen Icons - LGPL 3.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||reviewed||END|
Expand Down
4 changes: 4 additions & 0 deletions Ghidra/Features/DebugUtils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features DebugUtils'

Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Features/DebugUtils/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
##VERSION: 2.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||reviewed||END|
build.gradle||GHIDRA||||END|
35 changes: 30 additions & 5 deletions Ghidra/Features/Decompiler/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply plugin: 'eclipse'

eclipse.project.name = 'Features Decompiler'

apply from: "$rootProject.projectDir/gradleScripts/nativeBuildProperties.gradle"
apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"
apply from: "$rootProject.projectDir/gradleScripts/ghidraScripts.gradle"


dependencies {
compile project(':Base')
compile project(':SoftwareModeling')

// include Base src/test/resources when running decompiler integration tests (uses defaultTools)
integrationTestRuntime project(':Base').sourceSets.test.output
integrationTestRuntime project(path: ':Base', configuration: 'testArtifacts')
testCompile "org.jmockit:jmockit:1.44"

helpPath project(path: ":Base", configuration: 'helpPath')
Expand Down Expand Up @@ -510,4 +515,24 @@ Task createLexTask(String filename, String binaryName) {
}
}


rootProject.createInstallationZip {
dependsOn buildDecompilerDocumentationPdfs


def decompilerPdfZipPath = rootProject.ext.ZIP_DIR_PREFIX + "/docs/languages/"

// Add decompiler pdf files to zip. If the pdf files do not exist during execution time
// (if there was an error or wrong platform), the zip task will move on.
buildDecompilerDocumentationPdfs.outputs.each { output ->
output.files.each { file ->
if (file.name.endsWith("pdf")) {
logger.debug("$project.name: Adding Decompiler documentation (if it exists) $file.name to $decompilerPdfZipPath")
rootProject.createInstallationZip.from (file) {
into {
decompilerPdfZipPath
}
}
}
}
}
}
3 changes: 0 additions & 3 deletions Ghidra/Features/Decompiler/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
##MODULE IP: FAMFAMFAM Icons - CC 2.5
##MODULE IP: Oxygen Icons - LGPL 3.0
##MODULE IP: Tango Icons - Public Domain
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
src/decompile/.classpath||GHIDRA||||END|
src/decompile/.cproject||GHIDRA||||END|
src/decompile/.project||GHIDRA||||END|
src/decompile/.settings/org.eclipse.jdt.core.prefs||GHIDRA||||END|
Expand Down
5 changes: 5 additions & 0 deletions Ghidra/Features/DecompilerDependent/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'

eclipse.project.name = 'Features DecompilerDependent'


Expand Down
2 changes: 0 additions & 2 deletions Ghidra/Features/DecompilerDependent/certification.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
##VERSION: 2.0
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
10 changes: 7 additions & 3 deletions Ghidra/Features/FileFormats/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply plugin: 'eclipse'

eclipse.project.name = 'Features FileFormats'

apply from: "$rootProject.projectDir/gradleScripts/buildHelp.gradle"
apply from: "$rootProject.projectDir/gradleScripts/ghidraScripts.gradle"
apply from: "$rootProject.projectDir/gradleScripts/developerScripts.gradle"


dependencies {
compile project(':Base')
Expand Down
3 changes: 0 additions & 3 deletions Ghidra/Features/FileFormats/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
##MODULE IP: Jython License
##MODULE IP: LGPL 2.1
##MODULE IP: Public Domain
.classpath||GHIDRA||||END|
.project||GHIDRA||||END|
Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
data/android/eclipse-classpath||GHIDRA||reviewed||END|
data/android/eclipse-project||GHIDRA||reviewed||END|
data/build.xml||GHIDRA||||END|
data/crypto/README.txt||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/FileFormatsPlugin/FileFormats.html||GHIDRA||||END|
Loading

0 comments on commit f1e50fb

Please sign in to comment.