mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 09:51:37 +08:00
GP-3130: Eclipse now recognizes test source folders
This commit is contained in:
+3
-2
@@ -21,9 +21,10 @@ apply from: "gradle/support/loadApplicationProperties.gradle"
|
|||||||
|
|
||||||
|
|
||||||
/***************************************************************************************
|
/***************************************************************************************
|
||||||
* Make sure the correct version of gradle is being used
|
* Print current Gradle version and make sure the correct version of gradle is being used
|
||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
import org.gradle.util.GradleVersion;
|
import org.gradle.util.GradleVersion;
|
||||||
|
println "Gradle: " + GradleVersion.current().version
|
||||||
final GradleVersion minimum_version = GradleVersion.version("${rootProject.GRADLE_MINIMUM_VERSION}")
|
final GradleVersion minimum_version = GradleVersion.version("${rootProject.GRADLE_MINIMUM_VERSION}")
|
||||||
if (GradleVersion.current() < minimum_version) {
|
if (GradleVersion.current() < minimum_version) {
|
||||||
throw new GradleException("Requires at least $minimum_version, but was run with $gradle.gradleVersion")
|
throw new GradleException("Requires at least $minimum_version, but was run with $gradle.gradleVersion")
|
||||||
|
|||||||
+19
-12
@@ -185,18 +185,25 @@ ext.addExports = { List<String> exports ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fixup generated Eclipse projects
|
// Customize generated Eclipse projects
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
eclipse.classpath.file.whenMerged { classpath ->
|
eclipse {
|
||||||
// Prevent Gradle 5.6 from setting the 'test' attribute on our test source folders and jars.
|
classpath {
|
||||||
// If we don't do this, things that we have outside of test directories that depend on test
|
|
||||||
// libraries (like junit) will not compile in Eclipse.
|
// Expose test classes to dependent projects
|
||||||
// Also prevent Gradle 7.0 from adding jars to the modulepath instead of the classpath.
|
containsTestFixtures = true
|
||||||
classpath.entries.findAll {
|
|
||||||
it.kind == 'src' || it.kind == 'lib'
|
// Customizing which Eclipse source directories should be marked as test.
|
||||||
}.each {
|
// Only screenShots must be added...test and integrationTest are automatically picked up.
|
||||||
it.entryAttributes['test'] = 'false'
|
// NOTE: When we upgrade to Gradle 7.5+, we can just set the "testSourceSets" property
|
||||||
it.entryAttributes['module'] = 'false'
|
file {
|
||||||
|
whenMerged { classpath ->
|
||||||
|
classpath.entries.findAll {
|
||||||
|
it.kind == 'src' && it.path.startsWith('src/screen/')
|
||||||
|
}.each {
|
||||||
|
it.entryAttributes['test'] = 'true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user