ghidra/gradleScripts/prepDev.gradle
2019-03-26 13:46:51 -04:00

44 lines
1.9 KiB
Groovy

/******************************************************************************************
* PrepDev - task to prepare a development environment for Ghidra. It needs to be run
* whenever the Ghidra git repos are first cloned or after a 'clean'. It also
* needs to be run after a change to the sleigh ANTLR grammar files.
*
* 1) Creates the help directories in the build directory. These directories are
* included in the eclipse project files and must exist for eclipse to be able to compile
* Ghidra
*
* 2) Builds the sleigh ANTLR code and compiles it into the 'classes' directory. Also builds
* a src-zip of the generated java code. NOTE: this is accomplished by adding the
* following dependency in the processorUtils.gradle file: "prepDev.dependsOn(sleighCompile)"
* We can't do that dependency here because not all projects have a sleighCompile task.
*
*******************************************************************************************/
subprojects {
task prepDev {
group rootProject.GHIDRA_GROUP
description " Prepares a fresh clone of Ghidra for developing in eclipse. [gradleScripts/prepDev.gradle]\n"
// build all help
dependsOn { tasks.findAll { task -> task.name.equals('buildHelp') } }
// make sure the antlr code in the softwareModeling module gets built
dependsOn { project(":SoftwareModeling").compileJava }
// the GhidraLauncher depends on this file to build the classpath in dev mode
dependsOn { generateLibraryDependencyMapping }
}
}
/******************************************************************************************
* TASK generateLibraryDependencyMapping
*
* Summary: Creates a file that lists the libraries used by each module.
******************************************************************************************/
task generateLibraryDependencyMapping {
doFirst{
generateLibraryDependencyMapping()
}
}