/* ### * 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 plugin: 'java-library' java { sourceCompatibility = "${rootProject.JAVA_COMPILER}" targetCompatibility = "${rootProject.JAVA_COMPILER}" } //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]) } } } } } } dependencies { api project(':Utility') api 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 depsFile = file("${DEPS_DIR}/GhidraDev/PyDev 6.3.1.zip") File binRepoFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/PyDev 6.3.1.zip") // First check if the file is in the dependencies repo. If not, check in the bin repo. def pyDevZipTree = depsFile.exists() ? zipTree(depsFile) : zipTree(binRepoFile) 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 depsFile = file("${DEPS_DIR}/GhidraDev/cdt-8.6.0.zip") File binRepoFile = file("${BIN_REPO}/GhidraBuild/EclipsePlugins/GhidraDev/buildDependencies/cdt-8.6.0.zip") // First check if the file is in the dependencies repo. If not, check in the bin repo. def cdtZipTree = depsFile.exists() ? zipTree(depsFile) : zipTree(binRepoFile) 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}/README.md") { into "Extensions/Eclipse/GhidraDev/" rename 'README.md', 'GhidraDev_README.md' } } // PrepDev dependencies rootProject.prepDev.dependsOn utilityJar rootProject.prepDev.dependsOn launchSupportJar rootProject.prepDev.dependsOn pyDevUnpack rootProject.prepDev.dependsOn cdtUnpack