Files
ghidra/Ghidra/Features/PDB/build.gradle
2021-05-12 13:45:16 -04:00

95 lines
3.3 KiB
Groovy

/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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 from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features PDB'
/*********************************************************************************
* Build dependencies
*********************************************************************************/
dependencies {
api project(":Base")
testImplementation "org.jmockit:jmockit:1.44"
// Demangler Analyzer needs to find MicrosoftDemangler
api project(":MicrosoftDemangler")
helpPath project(path: ':Base', configuration: 'helpPath') // this module's help has links to Base help files
testImplementation project(path: ':Base', configuration: 'testArtifacts')
testImplementation project(path: ':SoftwareModeling', configuration: 'testArtifacts')
}
/**
* Include PDB native source with sample Visual Studio project to allow users to
* rebuild against other versions.
*
* Note that we use 'this.project' to reference the PDB project - this is because
* inside the closure, 'project' refers to the root project, while 'this' refers to
* PDB.
*/
rootProject.assembleDistribution {
into (getZipPath(this.project) + "/src/pdb") {
from projectDir.toString() + "/src/pdb"
}
}
if ("win64".equals(getCurrentPlatformName())) {
String makeName = "win64PDBMake"
task(type: Exec, makeName) {
def projectPath = projectDir.toString()
def solutionBatchFilePath = projectPath + "/build/buildSolution.bat"
def projectPathWindows = projectPath.replace("/", File.separator)
def solutionPathWindows = "\"${projectPathWindows}\\src\\pdb\\pdb.sln\""
doFirst {
file("build/os/win64").mkdirs()
def platformToolset = 'v' + VISUAL_STUDIO_TOOLS_VERSION_DEFAULT.substring(0, 4).replace('.', '');
def windowsTargetPlatformVersion = VISUAL_STUDIO_SDK_VERSION_OVERRIDE ?: VISUAL_STUDIO_SDK_VERSION_DEFAULT
def msbuildCmd = "msbuild ${solutionPathWindows} /p:Configuration=Release /p:PlatformToolset=${platformToolset} /p:WindowsTargetPlatformVersion=${windowsTargetPlatformVersion}"
println "Executing: " + msbuildCmd
new File(solutionBatchFilePath).withWriter { out ->
out.println "call " + VISUAL_STUDIO_VCVARS_CMD
out.println msbuildCmd
}
}
doLast {
assert file("build/os/win64/pdb.exe").exists() : "Failed to build pdb.exe"
}
executable "cmd"
args "/c"
args solutionBatchFilePath.replace("/", File.separator)
}
}