Skip to content

Commit 70ed8da

Browse files
committed
Cleanup Idea-Ext plugin configuration
1 parent 0a5d045 commit 70ed8da

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

build.gradle.kts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.gradle.ext.compiler
2+
import org.jetbrains.gradle.ext.delegateActions
3+
import org.jetbrains.gradle.ext.settings
14
import org.spongepowered.gradle.vanilla.task.DecompileJarTask
25
import java.util.Locale
36

@@ -178,6 +181,20 @@ minecraft {
178181
accessWideners(main.resources.filter { it.name.endsWith(".accesswidener") })
179182
}
180183

184+
idea {
185+
project.settings {
186+
delegateActions {
187+
delegateBuildRunToGradle = false
188+
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE
189+
}
190+
compiler {
191+
addNotNullAssertions = false
192+
useReleaseOption = true
193+
parallelCompilation = true
194+
}
195+
}
196+
}
197+
181198
allprojects {
182199
configurations.configureEach {
183200
resolutionStrategy.dependencySubstitution {
@@ -188,7 +205,6 @@ allprojects {
188205
}
189206
}
190207

191-
apply(plugin = "org.jetbrains.gradle.plugin.idea-ext")
192208
apply(plugin = "java-library")
193209
apply(plugin = "maven-publish")
194210
apply(plugin = "net.kyori.indra.licenser.spotless")
@@ -212,22 +228,6 @@ allprojects {
212228
}
213229
}
214230

215-
idea {
216-
if (project != null) {
217-
(project as ExtensionAware).extensions["settings"].run {
218-
(this as ExtensionAware).extensions.getByType(org.jetbrains.gradle.ext.ActionDelegationConfig::class).run {
219-
delegateBuildRunToGradle = false
220-
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
221-
}
222-
extensions.getByType(org.jetbrains.gradle.ext.IdeaCompilerConfiguration::class).run {
223-
addNotNullAssertions = false
224-
useReleaseOption = JavaVersion.current().isJava10Compatible
225-
parallelCompilation = true
226-
}
227-
}
228-
}
229-
}
230-
231231
java {
232232
val targetJavaVersion = JavaVersion.toVersion(apiJavaTarget.toInt())
233233
sourceCompatibility = targetJavaVersion
@@ -272,14 +272,10 @@ allprojects {
272272
val spongeSnapshotRepo: String? by project
273273
val spongeReleaseRepo: String? by project
274274
tasks {
275-
val emptyAnnotationProcessors = objects.fileCollection()
276275
withType(JavaCompile::class).configureEach {
277276
options.compilerArgs.addAll(listOf("-Xmaxerrs", "1000"))
278277
options.encoding = "UTF-8"
279278
options.release.set(apiJavaTarget.toInt())
280-
if (project.name != "testplugins" && System.getProperty("idea.sync.active") != null) {
281-
options.annotationProcessorPath = emptyAnnotationProcessors // hack so IntelliJ doesn't try to run Mixin AP
282-
}
283279
}
284280

285281
withType(PublishToMavenRepository::class).configureEach {

0 commit comments

Comments
 (0)