11import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22import junitbuild.extensions.isSnapshot
3- import org.gradle.plugins.ide.eclipse.model.Classpath
4- import org.gradle.plugins.ide.eclipse.model.Library
5- import org.gradle.plugins.ide.eclipse.model.ProjectDependency
6- import org.gradle.plugins.ide.eclipse.model.SourceFolder
73
84plugins {
95 `java- library`
10- eclipse
116 id(" junitbuild.base-conventions" )
127 id(" junitbuild.build-parameters" )
138 id(" junitbuild.checkstyle-conventions" )
9+ id(" junitbuild.eclipse-conventions" )
1410 id(" junitbuild.jacoco-java-conventions" )
1511}
1612
@@ -21,43 +17,6 @@ val buildRevision: Any by rootProject.extra
2117
2218val extension = extensions.create<JavaLibraryExtension >(" javaLibrary" )
2319
24- eclipse {
25- jdt {
26- sourceCompatibility = JavaVersion .VERSION_21
27- targetCompatibility = JavaVersion .VERSION_21
28- file {
29- // Set properties for org.eclipse.jdt.core.prefs
30- withProperties {
31- // Configure Eclipse projects with -release compiler flag.
32- setProperty(" org.eclipse.jdt.core.compiler.release" , " enabled" )
33- // Configure Eclipse projects with -parameters compiler flag.
34- setProperty(" org.eclipse.jdt.core.compiler.codegen.methodParameters" , " generate" )
35- }
36- }
37- }
38- classpath.file.whenMerged {
39- this as Classpath
40- // Remove classpath entries for non-existent libraries added by various
41- // plugins, such as "junit-jupiter-api/build/classes/kotlin/testFixtures".
42- entries.removeIf { it is Library && ! file(it.path).exists() }
43- // Remove classpath entries for the code generator model used by the
44- // Java Template Engine (JTE) which is used to generate the JRE enum and
45- // dependent tests.
46- entries.removeIf { it is ProjectDependency && it.path.equals(" /code-generator-model" ) }
47- // Remove classpath entries for anything used by the Gradle Wrapper.
48- entries.removeIf { it is Library && it.path.contains(" gradle/wrapper" ) }
49- entries.filterIsInstance<SourceFolder >().forEach {
50- it.excludes.add(" **/module-info.java" )
51- }
52- entries.filterIsInstance<ProjectDependency >().forEach {
53- it.entryAttributes.remove(" module" )
54- }
55- entries.filterIsInstance<Library >().forEach {
56- it.entryAttributes.remove(" module" )
57- }
58- }
59- }
60-
6120java {
6221 modularity.inferModulePath = true
6322}
0 commit comments