Skip to content

Ghidra is a software reverse engineering (SRE) framework

3.1 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/javaTestProject.gradle"
apply plugin: 'eclipse'
eclipse.project.name = '_Integration Test'


/*********************************************************************************
 * Build dependencies
 *********************************************************************************/

processIntegrationTestResources {
	duplicatesStrategy = 'exclude'
}

dependencies {
	// integrationtest module may depend on other projects in this repo; add them
	// here 
	def ghidraPath = projectDir.getParentFile().getParentFile().path.replace(File.separator, "/") + "/";
	
	rootProject.subprojects { p ->
		p.plugins.withType(JavaPlugin) {
			def projectPath = p.projectDir.path.replace(File.separator, "/")
			if (projectPath.startsWith(ghidraPath) && (
				projectPath.contains("/Extensions/") ||
				projectPath.contains("/Framework/") ||
				projectPath.contains("/Features/") ||
				projectPath.contains("/Debug/") ||
				projectPath.contains("/Processors/"))) {

				api p
			}
		}	
	}

	// some tests use classes in Base, FunctionGraph and PDB
	testImplementation project(path: ':Base', configuration: 'testArtifacts')
	testImplementation project(path: ':Base', configuration: 'integrationTestArtifacts')
	testImplementation project(path: ':Emulation', configuration: 'testArtifacts')
	testImplementation project(path: ':FunctionGraph', configuration: 'testArtifacts')	
	testImplementation project(path: ':PDB', configuration: 'testArtifacts')
	testImplementation project(path: ':GnuDemangler', configuration: 'testArtifacts')
	
	testImplementation project(path: ':Generic', configuration: 'testArtifacts')

	testImplementation project(path: ':Framework-TraceModeling', configuration: 'testArtifacts')
	testImplementation project(path: ':Debugger', configuration: 'testArtifacts')
}

// For Java 9, we must explicitly export references to the internal classes we are using.
// We export them to all "unnamed" modules, which are modules that don't define themselves
// as a new Java 9 style module.  Ghidra is currently using unnamed modules everywhere.
ext.addExports([
	'java.desktop/sun.awt=ALL-UNNAMED',
	'java.desktop/sun.swing=ALL-UNNAMED',
	'java.desktop/sun.java2d=ALL-UNNAMED'
])

integrationTest {
	dependsOn { project(':Debugger-rmi-trace').assemblePyPackage }
	dependsOn { project(':Debugger-agent-gdb').assemblePyPackage }
	dependsOn { project(':Debugger-agent-lldb').assemblePyPackage }
	dependsOn { project(':Debugger-agent-dbgeng').assemblePyPackage }
}