Skip to content

Ghidra is a software reverse engineering (SRE) framework

2.3 KB
Raw Blame
/* ###
 * 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/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraExtension.gradle"

apply plugin: 'eclipse'
eclipse.project.name = 'Xtra SymbolicSummaryZ3'

dependencies {
	api project(':Debugger')
	api project(':SystemEmulation')
	api ":com.microsoft.z3:"

	// Oof. Apparently, this doesn't work transitively....
	testImplementation project(path: ':Generic', configuration: 'testArtifacts')
	testImplementation project(path: ':ProposedUtils', configuration: 'testArtifacts')
	testImplementation project(path: ':SystemEmulation', configuration: 'testArtifacts')
	testImplementation project(path: ':Framework-TraceModeling', configuration: 'testArtifacts')
	testImplementation project(path: ':Debugger', configuration: 'testArtifacts')
}

CopySpec z3LibsCopySpec = copySpec {
	File depsDir = file("${rootProject.DEPS_DIR}/SymbolicSummaryZ3/os")
	File binRepoDir = file("${rootProject.BIN_REPO}/Ghidra/Extensions/SymbolicSummaryZ3/os")
	from(depsDir.exists() ? depsDir : binRepoDir) {
		into("os")
	}
}

task z3DevLibsCopy(type: Copy) {
	description = "Unpack Z3 archives for development use"
	group = "Development Preparation"
	
	onlyIf {
		// Only need to do this if using dependencies directory
		file("${rootProject.DEPS_DIR}/SymbolicSummaryZ3/os").exists()
	}
	
	with z3LibsCopySpec
	destinationDir = file("build")
}

zipExtensions {
	into(rootProject.getBaseProjectName(this.project)) {
		with z3LibsCopySpec
	}
	into(rootProject.getBaseProjectName(this.project)) {
		from(this.project.file(".")) {
			include("README.md")
		}
	}
}

rootProject.prepDev.dependsOn(z3DevLibsCopy)