ghidra/GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/build.gradle

121 lines
3.4 KiB
Groovy

apply plugin: 'java'
//This project requires the eclpse PDE plugin. To create eclipse files for this project, run
// "gradle eclipse -PeclipsePDE"
if (hasProperty("eclipsePDE")) {
apply plugin: 'eclipse'
eclipse {
project {
name = 'Eclipse GhidraDevPlugin'
buildCommand 'org.eclipse.pde.ManifestBuilder'
buildCommand 'org.eclipse.pde.SchemaBuilder'
natures 'org.eclipse.pde.PluginNature'
classpath.file {
def requiredPlugins = 'org.eclipse.pde.core.requiredPlugins'
beforeMerged { classpath ->
classpath.entries.removeAll { entry ->
entry.path == requiredPlugins
}
}
whenMerged { classpath ->
withXml {
def node = it.asNode()
node.appendNode('classpathentry', [kind: 'con', path: requiredPlugins])
}
}
}
}
}
}
// We want GhidraDev to run with Eclipses launched with Java 8
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile project(':Utility')
compile project(':LaunchSupport')
}
// We are currently building this with Eclipse, so prevent gradle from trying.
// See build_README.txt for instructions on how to build from Eclipse.
compileJava.enabled = false
jar.enabled = false
task utilityJar(type:Copy) {
destinationDir file("build/data")
from { project(':Utility').jar } // using closure to delay until all projects evaluated
}
task launchSupportJar(type:Copy) {
destinationDir file("build/data")
from { project(':LaunchSupport').jar } // using closure to delay until all projects evaluated
}
task pyDevUnpack(type:Copy) {
description "Unpack PyDev plugin archive for development use"
group "Development Preparation"
File pyDevDestDir = file("build/data/buildDependencies/pydev")
// Without this, the copyTask will unzip the file to check for "up to date"
onlyIf {
!pyDevDestDir.exists()
}
File localFile = file("build/PyDev 6.3.1.zip")
File binFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/PyDev 6.3.1.zip")
// First check if the file was downloaded and dropped in locally. If not, check in the bin
// repo.
def pyDevZipTree = localFile.exists() ? zipTree(localFile) : zipTree(binFile)
from pyDevZipTree
exclude "**/.project", "**/.pydevproject"
destinationDir pyDevDestDir
}
task cdtUnpack(type:Copy) {
description "Unpack CDT plugin archive for development use"
group "Development Preparation"
File cdtDestDir = file("build/data/buildDependencies/cdt")
// Without this, the copyTask will unzip the file to check for "up to date"
onlyIf {
!cdtDestDir.exists()
}
File localFile = file("build/cdt-8.6.0.zip")
File binFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/cdt-8.6.0.zip")
// First check if the file was downloaded and dropped in locally. If not, check in the bin
// repo.
def cdtZipTree = localFile.exists() ? zipTree(localFile) : zipTree(binFile)
from cdtZipTree
destinationDir cdtDestDir
}
// We do not currently build GhidraDev plugin at Ghidra build time so we must
// copy the prebuilt zip file from the BIN_REPO
rootProject.assembleDistribution {
from ("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev") {
include 'GhidraDev*.zip'
into "Extensions/Eclipse/GhidraDev/"
}
from ("${this.projectDir}/GhidraDev_README.html") {
into "Extensions/Eclipse/GhidraDev/"
}
}
// PrepDev dependencies
rootProject.prepDev.dependsOn utilityJar
rootProject.prepDev.dependsOn launchSupportJar
rootProject.prepDev.dependsOn pyDevUnpack
rootProject.prepDev.dependsOn cdtUnpack