|
1 | | -import org.gradle.plugins.ide.eclipse.model.EclipseModel |
2 | | - |
3 | 1 | plugins { |
4 | | - eclipse |
5 | 2 | `java-library` |
6 | 3 | `maven-publish` |
7 | 4 | signing |
8 | | - id("com.diffplug.eclipse.apt") apply false |
9 | 5 | id("com.diffplug.spotless") |
10 | 6 | id("io.github.gradle-nexus.publish-plugin") |
11 | 7 | id("net.researchgate.release") |
12 | | - id("org.domaframework.doma.compile") apply false |
13 | | - kotlin("jvm") apply false |
14 | | - kotlin("kapt") apply false |
| 8 | + id("org.domaframework.doma.compile") |
| 9 | + kotlin("jvm") |
| 10 | + kotlin("kapt") |
15 | 11 | } |
16 | 12 |
|
17 | 13 | val Project.javaModuleName: String |
@@ -66,32 +62,6 @@ fun replaceVersionInDocs(ver: String) { |
66 | 62 | } |
67 | 63 | } |
68 | 64 |
|
69 | | -fun EclipseModel.configureWithJavaRuntimeName(javaRuntimeName: String) { |
70 | | - classpath { |
71 | | - file { |
72 | | - whenMerged { |
73 | | - val classpath = this as org.gradle.plugins.ide.eclipse.model.Classpath |
74 | | - classpath.entries.removeAll { |
75 | | - when (it) { |
76 | | - is org.gradle.plugins.ide.eclipse.model.Output -> it.path == ".apt_generated" |
77 | | - else -> false |
78 | | - } |
79 | | - } |
80 | | - } |
81 | | - withXml { |
82 | | - val node = asNode() |
83 | | - node.appendNode( |
84 | | - "classpathentry", |
85 | | - mapOf("kind" to "src", "output" to "bin/main", "path" to ".apt_generated") |
86 | | - ) |
87 | | - } |
88 | | - } |
89 | | - } |
90 | | - jdt { |
91 | | - this.javaRuntimeName = javaRuntimeName |
92 | | - } |
93 | | -} |
94 | | - |
95 | 65 | allprojects { |
96 | 66 | apply(plugin = "base") |
97 | 67 | apply(plugin = "com.diffplug.spotless") |
@@ -131,7 +101,6 @@ configure(modularProjects) { |
131 | 101 | apply(plugin = "java-library") |
132 | 102 | apply(plugin = "maven-publish") |
133 | 103 | apply(plugin = "signing") |
134 | | - apply(plugin = "com.diffplug.eclipse.apt") |
135 | 104 |
|
136 | 105 | java { |
137 | 106 | toolchain.languageVersion.set(JavaLanguageVersion.of(8)) |
@@ -181,10 +150,6 @@ configure(modularProjects) { |
181 | 150 | isRequired = isReleaseVersion |
182 | 151 | } |
183 | 152 |
|
184 | | - eclipse { |
185 | | - configureWithJavaRuntimeName("JavaSE-1.8") |
186 | | - } |
187 | | - |
188 | 153 | class ModulePathArgumentProvider(it: Project) : CommandLineArgumentProvider, Named { |
189 | 154 | @get:CompileClasspath |
190 | 155 | val modulePath: Configuration = it.configurations["compileClasspath"] |
@@ -223,7 +188,7 @@ configure(modularProjects) { |
223 | 188 |
|
224 | 189 | val javaModuleName = project.javaModuleName |
225 | 190 | val moduleSourceDir = file("src/module/$javaModuleName") |
226 | | - val moduleOutputDir = file("$buildDir/classes/java/module") |
| 191 | + val moduleOutputDir = layout.buildDirectory.dir("classes/java/module") |
227 | 192 |
|
228 | 193 | val compileModule by tasks.registering(JavaCompile::class) { |
229 | 194 | dependsOn("classes") |
@@ -261,7 +226,7 @@ configure(modularProjects) { |
261 | 226 | manifest { |
262 | 227 | attributes(mapOf("Implementation-Title" to project.name, "Implementation-Version" to archiveVersion)) |
263 | 228 | } |
264 | | - from("$moduleOutputDir/$javaModuleName") { |
| 229 | + from("${moduleOutputDir.get().asFile}/$javaModuleName") { |
265 | 230 | include("module-info.class") |
266 | 231 | } |
267 | 232 | } |
@@ -304,25 +269,20 @@ configure(modularProjects) { |
304 | 269 |
|
305 | 270 | configure(integrationTestProjects) { |
306 | 271 | apply(plugin = "java") |
307 | | - apply(plugin = "com.diffplug.eclipse.apt") |
308 | 272 | apply(plugin = "com.diffplug.spotless") |
309 | 273 | apply(plugin ="org.domaframework.doma.compile") |
310 | 274 |
|
311 | 275 | dependencies { |
312 | | - "testImplementation"(platform("org.testcontainers:testcontainers-bom:1.19.3")) |
313 | | - "testRuntimeOnly"("com.h2database:h2:1.4.200") |
314 | | - "testRuntimeOnly"("mysql:mysql-connector-java:8.0.33") |
315 | | - "testRuntimeOnly"("com.oracle.database.jdbc:ojdbc8-production:18.15.0.0") |
316 | | - "testRuntimeOnly"("org.postgresql:postgresql:42.7.1") |
317 | | - "testRuntimeOnly"("com.microsoft.sqlserver:mssql-jdbc:8.4.1.jre8") |
318 | | - "testRuntimeOnly"("org.testcontainers:mysql") |
319 | | - "testRuntimeOnly"("org.testcontainers:oracle-xe") |
320 | | - "testRuntimeOnly"("org.testcontainers:postgresql") |
321 | | - "testRuntimeOnly"("org.testcontainers:mssqlserver") |
322 | | - } |
323 | | - |
324 | | - eclipse { |
325 | | - configureWithJavaRuntimeName("JavaSE-17") |
| 276 | + testImplementation(platform("org.testcontainers:testcontainers-bom:1.19.3")) |
| 277 | + testRuntimeOnly("com.h2database:h2:1.4.200") |
| 278 | + testRuntimeOnly("mysql:mysql-connector-java:8.0.33") |
| 279 | + testRuntimeOnly("com.oracle.database.jdbc:ojdbc8-production:18.15.0.0") |
| 280 | + testRuntimeOnly("org.postgresql:postgresql:42.7.1") |
| 281 | + testRuntimeOnly("com.microsoft.sqlserver:mssql-jdbc:8.4.1.jre8") |
| 282 | + testRuntimeOnly("org.testcontainers:mysql") |
| 283 | + testRuntimeOnly("org.testcontainers:oracle-xe") |
| 284 | + testRuntimeOnly("org.testcontainers:postgresql") |
| 285 | + testRuntimeOnly("org.testcontainers:mssqlserver") |
326 | 286 | } |
327 | 287 |
|
328 | 288 | tasks { |
|
0 commit comments