enhancement(gradle): automatically set "build and run using: IntelliJ IDEA"
+/*
+ * Copyright 2020 MovingBlocks
+ *
+ * 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
+ *
+ * https://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.
+ */
+
// Dependencies needed for what our Gradle scripts themselves use. It cannot be included via an external Gradle file :-(
buildscript {
repositories {
@@ -23,12 +39,20 @@ buildscript {
}
}
-apply plugin: 'idea'
+
+plugins {
// Needed for extending the "clean" task to also delete custom stuff defined here like natives
-apply plugin: 'base'
+ id "base"
// The root project should not be an eclipse project. It keeps eclipse (4.2) from finding the sub-projects.
//apply plugin: 'eclipse'
+ id "idea"
+ // For the "Build and run using: Intellij IDEA | Gradle" switch
+ id "org.jetbrains.gradle.plugin.idea-ext" version "0.7"
+}
+
+
+import org.jetbrains.gradle.ext.ActionDelegationConfig
import java.nio.file.Files
import java.nio.file.Path
@@ -319,6 +343,11 @@ idea {
module.excludeDirs += file('terasology-2ndclient')
module.downloadSources = true
+
+ project.settings.delegateActions {
+ delegateBuildRunToGradle = false
+ testRunner = ActionDelegationConfig.TestRunner.PLATFORM
+ }
}
cleanIdea.doLast {
