mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
Candidate release of source code.
This commit is contained in:
parent
db81e6b3b0
commit
79d8f164f8
12449 changed files with 2800756 additions and 16 deletions
116
gradleScripts/processorUtils.gradle
Normal file
116
gradleScripts/processorUtils.gradle
Normal file
|
@ -0,0 +1,116 @@
|
|||
|
||||
/*****************************************************************************************
|
||||
*
|
||||
* Create a configuration so the a dependency can be declared on the the software modeling
|
||||
* project which is where the sleigh compiler java code lives. This will be used to
|
||||
* form the classpath of the sleighCompile task that follows.
|
||||
*
|
||||
*****************************************************************************************/
|
||||
configurations {
|
||||
sleighConfig
|
||||
}
|
||||
|
||||
dependencies {
|
||||
sleighConfig project(':SoftwareModeling')
|
||||
}
|
||||
|
||||
/*****************************************************************************************
|
||||
*
|
||||
* Task to compile language files using the sleigh compiler.
|
||||
*
|
||||
*****************************************************************************************/
|
||||
task sleighCompile (type: JavaExec) {
|
||||
group = rootProject.GHIDRA_GROUP
|
||||
description " Compiles all the sleigh languages. [processorUtils.gradle]\n"
|
||||
|
||||
// define standard parameters for JavaExec
|
||||
classpath configurations.sleighConfig
|
||||
main = 'ghidra.pcodeCPort.slgh_compile.SleighCompile'
|
||||
|
||||
args '-a'
|
||||
|
||||
// Delay adding the directory argument until the first part of the execution phase, so
|
||||
// that any extra args added by a project override will be added to the arg list before
|
||||
// this argument.
|
||||
doFirst {
|
||||
args './data/languages'
|
||||
}
|
||||
|
||||
jvmArgs '-Xmx2048M'
|
||||
}
|
||||
|
||||
// The task that copies the common files to the distribution folder must depend on
|
||||
// this sleigh task before executing.
|
||||
rootProject.assembleCommon.dependsOn(sleighCompile)
|
||||
|
||||
// For all tasks of type:Test (i.e., integrationTest, cunitTest, etc.), add a task dependency to
|
||||
// sleighCompile. The sleighCompile task inputs and outputs are defined such that the *.slaspec
|
||||
// files will only be compiled once, in other words, the up-to-date checks work ok in the
|
||||
// sleighCompile task. To learn more, visit:
|
||||
// https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks
|
||||
// This task dependency is needed because many tests rely on the language
|
||||
// modules as seen in the use of ghidra.test.ToyProgramBuilder.
|
||||
// The tasks of type:Test do not know about sleighCompile during their configuration phase, so the
|
||||
// dependency must be done in this gradle file.
|
||||
rootProject.subprojects.findAll { subproject ->
|
||||
if (!isSupportModule(subproject)) {
|
||||
subproject.tasks.withType(Test).all {
|
||||
it.dependsOn(sleighCompile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************************
|
||||
*
|
||||
* Task to clean out the compile language files (*.sla)
|
||||
*
|
||||
*****************************************************************************************/
|
||||
task cleanSleigh {
|
||||
group rootProject.GHIDRA_GROUP
|
||||
description "Removes all the compile sleigh language files (*.sla). [gradleScripts/processUtils.gradle]\n"
|
||||
doLast {
|
||||
def deleteTree = fileTree(dir: "data/languages", include: "*.sla")
|
||||
deleteTree.each { File file ->
|
||||
delete file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
* Set up inputs and outputs for the sleighCompile task so that languages only get build
|
||||
* when the inputs change
|
||||
*
|
||||
* sleigh compile outputs to same directory as input. All files except .sla are input
|
||||
*
|
||||
******************************************************************************************/
|
||||
def taskInputs = fileTree(dir: 'data/languages', exclude: '**/*.sla')
|
||||
def taskOutputs = fileTree(dir: 'data/languages', include: '**/*.sla')
|
||||
|
||||
// define the sleigh compile inputs and outputs so that gradle can check if they need building
|
||||
sleighCompile.inputs.files (taskInputs)
|
||||
sleighCompile.outputs.files (taskOutputs)
|
||||
|
||||
task eclipseSleighLauncher(type: WriteEclipseLauncher) {
|
||||
dest = forName("Sleigh $project.name")
|
||||
isRunFave = true
|
||||
isDbgFave = false
|
||||
|
||||
classpath = configurations.sleighConfig
|
||||
main 'ghidra.pcodeCPort.slgh_compile.SleighCompile'
|
||||
|
||||
args '-a'
|
||||
|
||||
// Delay adding the directory argument until the first part of the execution phase, so
|
||||
// that any extra args added by a project override will be added to the arg list before
|
||||
// this argument.
|
||||
doFirst {
|
||||
args './data/languages'
|
||||
}
|
||||
|
||||
jvmArgs '-Xmx2048M'
|
||||
}
|
||||
|
||||
def isSupportModule(Project p) {
|
||||
return p.findProperty("isSupportProject") ?: false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue