From a50c6e08435d2aa9d1855a3079bdbbbd82c5129a Mon Sep 17 00:00:00 2001 From: ghidravore Date: Fri, 26 Apr 2019 18:17:11 -0400 Subject: [PATCH] Fixing build issues. --- GPL/CabExtract/build.gradle | 1 - GPL/DMG/build.gradle | 5 +---- GPL/DemanglerGnu/build.gradle | 2 -- gradle/distributableGhidraModule.gradle | 24 ++++++++++++++++++++++++ gradle/support/distributionCommon.gradle | 22 ---------------------- gradle/support/extensionCommon.gradle | 6 ++++++ 6 files changed, 31 insertions(+), 29 deletions(-) diff --git a/GPL/CabExtract/build.gradle b/GPL/CabExtract/build.gradle index 81df352355..2102603488 100644 --- a/GPL/CabExtract/build.gradle +++ b/GPL/CabExtract/build.gradle @@ -1,4 +1,3 @@ -apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" apply plugin: 'eclipse' eclipse.project.name = 'GPL CabExtract' diff --git a/GPL/DMG/build.gradle b/GPL/DMG/build.gradle index 447d999adb..aa0e6862d9 100644 --- a/GPL/DMG/build.gradle +++ b/GPL/DMG/build.gradle @@ -1,7 +1,4 @@ -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: 'java' apply plugin: 'eclipse' eclipse.project.name = 'GPL DMG' diff --git a/GPL/DemanglerGnu/build.gradle b/GPL/DemanglerGnu/build.gradle index 1127b62fe2..b3735e4dc3 100644 --- a/GPL/DemanglerGnu/build.gradle +++ b/GPL/DemanglerGnu/build.gradle @@ -1,7 +1,5 @@ -apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" apply plugin: 'eclipse' - eclipse.project.name = 'GPL DemanglerGnu' apply from: "../nativeBuildProperties.gradle" diff --git a/gradle/distributableGhidraModule.gradle b/gradle/distributableGhidraModule.gradle index ac6982ed2b..104a842240 100644 --- a/gradle/distributableGhidraModule.gradle +++ b/gradle/distributableGhidraModule.gradle @@ -82,6 +82,30 @@ rootProject.assembleDistribution { } } +// copy os specific files for each platform +rootProject.OS_NAMES.each { platform -> + rootProject.tasks.findAll {it.name == "assembleDistribution_$platform"}.each { t -> + + def p = this.project + + // the getZipPath calls here are not in closures because we are already in a taskGraph.whenReady closure + t.from (p.projectDir.toString() + "/build/os/$platform") { + exclude '*.lib' + exclude '*.exp' + into getZipPath(p) + "/os/$platform" + } + t.from (p.projectDir.toString() + "/os/$platform") { + into getZipPath(p) + "/os/$platform" + } + } +} + +// For Win64 build, we have to also include any Win32 binaries in the final zip. +rootProject.assembleDistribution_win64 { + from (this.project.projectDir.toString() + "/build/os/win32") { + into getZipPath(this.project) + "/os/win32" + } +} /********************************************************************************* * Takes the given file and returns a string representing the file path with everything diff --git a/gradle/support/distributionCommon.gradle b/gradle/support/distributionCommon.gradle index 9449380a5a..626cbbbc58 100644 --- a/gradle/support/distributionCommon.gradle +++ b/gradle/support/distributionCommon.gradle @@ -8,29 +8,7 @@ tasks.withType(Test).all { it.dependsOn ":allSleighCompile" } -rootProject.OS_NAMES.each { platform -> - rootProject.tasks.findAll {it.name == "assembleDistribution_$platform"}.each { t -> - def p = this.project - - // the getZipPath calls here are not in closures because we are already in a taskGraph.whenReady closure - t.from (p.projectDir.toString() + "/build/os/$platform") { - exclude '*.lib' - exclude '*.exp' - into getZipPath(p) + "/os/$platform" - } - t.from (p.projectDir.toString() + "/os/$platform") { - into getZipPath(p) + "/os/$platform" - } - } -} - -// For Win64 build, we have to also include any Win32 binaries in the final zip. -rootProject.assembleDistribution_win64 { - from (this.project.projectDir.toString() + "/build/os/win32") { - into getZipPath(this.project) + "/os/win32" - } -} plugins.withType(JavaPlugin) { task zipSourceSubproject (type: Zip) { t -> diff --git a/gradle/support/extensionCommon.gradle b/gradle/support/extensionCommon.gradle index d73625b7a6..c58d27a5f3 100644 --- a/gradle/support/extensionCommon.gradle +++ b/gradle/support/extensionCommon.gradle @@ -50,6 +50,12 @@ task zipExtensions (type: Zip) { into { getBaseProjectName(p) } } + from (p.file('build/os')) { + into { getBaseProjectName(p) + "/os" } + exclude "**/*.exp" + exclude "**/*.lib" + } + ///////////////// // EXTERNAL LIBS /////////////////