Slackbot
11/25/2022, 3:37 PMVampire
11/25/2022, 3:45 PMEric Kolotyluk
11/25/2022, 5:45 PMidea-ext
plugin to work is much harder than it should be... still trying...
Apparently, in settings.gradle.kts
this is meaningless
pluginManagement {
plugins {
application // includes the Java and Distribution plugins
idea
id("org.jetbrains.gradle.plugin.idea-ex") version "1.1.6"
}
resolutionStrategy {
}
repositories {
repositories.maven("<https://plugins.gradle.org/m2/>")
}
}
resulting in
Build file '/Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts' line: 7
Plugin [id: 'org.jetbrains.gradle.plugin.idea-ex', version: '1.1.6'] was not found in any of the following sources:
Vampire
11/25/2022, 5:47 PMEric Kolotyluk
11/25/2022, 5:50 PMe: /Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts:62:1: Unresolved reference: runConfigurations
Vampire
11/25/2022, 6:05 PMEric Kolotyluk
11/25/2022, 6:07 PMidea {
project {
settings {
runConfigurations { }
copyright { }
// other project level settings
}
}
}
so I am trying something like
idea {
project {
configurations {
run {
default.configure {
}
}
}
}
}
But I cannot find any place to invoke runConfigurations
Eric Kolotyluk
11/25/2022, 6:08 PMEric Kolotyluk
11/25/2022, 6:12 PMidea-ext
is just incompatible with Gradle 8 🤔Vampire
11/25/2022, 6:14 PMEric Kolotyluk
11/25/2022, 6:15 PMe: /Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts:76:9: Unresolved reference: settings
Vampire
11/25/2022, 6:17 PMimport org.jetbrains.gradle.ext.settings
Vampire
11/25/2022, 6:19 PMEric Kolotyluk
11/25/2022, 6:21 PMVampire
11/25/2022, 6:22 PMVampire
11/25/2022, 6:25 PMEric Kolotyluk
11/25/2022, 6:27 PMeric.kolotyluk@Y2RCV7009N loom-laboratory % ./gradlew clean
> Configure project :
e: /Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts:81:13: Unresolved reference: runConfigurations
e: /Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts:82:13: Unresolved reference: copyright
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/eric.kolotyluk/git/autonomous-iam/poc/loom-laboratory/build.gradle.kts' line: 81
* What went wrong:
Script compilation errors:
Line 81: runConfigurations { }
^ Unresolved reference: runConfigurations
Line 82: copyright { }
^ Unresolved reference: copyright
2 errors
Vampire
11/25/2022, 6:39 PMsettings
is found, you just did not refresh the project.
You also need to import those accessors.Vampire
11/25/2022, 6:40 PMEric Kolotyluk
11/25/2022, 6:46 PMVampire
11/25/2022, 7:05 PMEric Kolotyluk
11/25/2022, 8:18 PMEric Kolotyluk
11/25/2022, 8:28 PMimport org.jetbrains.gradle.ext.settings
import org.jetbrains.gradle.ext.runConfigurations
but, before I could do that, I had to refresh in such a way that it downloaded stuff
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Download <https://plugins.gradle.org/m2/gradle/plugin/org/jetbrains/gradle/plugin/idea-ext/gradle-idea-ext/1.1.6/gradle-idea-ext-1.1.6-sources.jar>, took 86 ms (23.15 kB)
Download <https://plugins.gradle.org/m2/com/google/guava/guava/28.2-jre/guava-28.2-jre-sources.jar>, took 185 ms (1.67 MB)
Download <https://plugins.gradle.org/m2/org/checkerframework/checker-qual/2.10.0/checker-qual-2.10.0-sources.jar>, took 74 ms (227.35 kB)
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/8.0-milestone-3/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 4s
So, it's important to do things in the right order...Eric Kolotyluk
11/25/2022, 8:30 PMEric Kolotyluk
11/25/2022, 9:04 PMidea {
project {
settings {
compiler {
javac {
javacAdditionalOptions = "--enable-preview"
}
}
}
}
}
Does the right thing, and loads Idea with the correct compiler setting, but I cannot figure out how to make runConfiguration
work.Eric Kolotyluk
11/25/2022, 9:21 PMEric Kolotyluk
11/25/2022, 10:08 PMVampire
11/26/2022, 11:21 AMVampire
11/26/2022, 11:21 AMVampire
11/26/2022, 11:21 AMEric Kolotyluk
11/26/2022, 3:01 PMVampire
11/26/2022, 3:09 PMApplication
class.Vampire
11/26/2022, 3:09 PMApplication
class from the idea-ext plugin and it will workVampire
11/26/2022, 3:11 PMcreate<Application>("Application") {
...
}
or to not use string identifiers
val Application by creating(Application::class) {
...
}
Just like usualy with those named domain object containers in the kotlin dslEric Kolotyluk
11/26/2022, 3:41 PMimport org.jetbrains.gradle.ext.Application
. . .
idea {
project {
settings {
compiler {
javac {
if (javacAdditionalOptions == null) {
javacAdditionalOptions = "--enable-preview"
} else {
javacAdditionalOptions += " --enable-preview"
}
}
}
runConfigurations {
runConfigurations {
create("Run application", Application::class) {
mainClass = "com.forgerock.poc.loom.Application"
jvmArgs = "--enable-preview"
}
}
}
}
}
}
Eric Kolotyluk
11/26/2022, 3:41 PMEric Kolotyluk
11/26/2022, 3:44 PMidea {
project {
settings {
compiler {
javac {
if (javacAdditionalOptions == null) {
javacAdditionalOptions = "--enable-preview"
} else {
javacAdditionalOptions += " --enable-preview"
}
}
}
runConfigurations {
runConfigurations {
create<Application>("Application") {
mainClass = "com.forgerock.poc.loom.Application"
jvmArgs = "--enable-preview"
}
}
}
}
}
}
Eric Kolotyluk
11/26/2022, 3:45 PMEric Kolotyluk
11/26/2022, 3:51 PMrunConfigurations {
runConfigurations {
create<Application>("Run Application") {
mainClass = "com.forgerock.poc.loom.Application"
jvmArgs = "--enable-preview"
moduleName = "loom-laboratory.main"
}
}
}
Vampire
11/26/2022, 4:10 PMrunConfigurations
within runConfigurations
does not make much sense though, that's just unnecessary noiseEric Kolotyluk
11/26/2022, 4:11 PMVampire
11/26/2022, 4:11 PMcreate
call it should be pretty similar to the Groovy version.
Which is due to the extreme high flexibility and duck-typing Groovy provides opposed to Kotlin.
But I still would always prefer Kotlin for much better IDE support and type-safety.Eric Kolotyluk
11/26/2022, 4:13 PMEric Kolotyluk
11/26/2022, 4:14 PMEric Kolotyluk
11/26/2022, 4:15 PMVampire
11/26/2022, 4:17 PMEric Kolotyluk
11/26/2022, 4:17 PMChris Lee
11/26/2022, 4:19 PMEric Kolotyluk
11/26/2022, 4:20 PMVampire
11/26/2022, 4:20 PMEric Kolotyluk
11/26/2022, 4:22 PMEric Kolotyluk
11/26/2022, 4:23 PMEric Kolotyluk
11/26/2022, 4:26 PMrunConfigurations
working, I still cannot get ./gradlew run
to work with my app... but I will start a separate thread for that...
Thanks @Vampire, you helped a lotVampire
11/26/2022, 4:27 PM./gradlew run
has nothing to do with the run configurations you configure for IntelliJEric Kolotyluk
11/26/2022, 4:27 PMVampire
11/26/2022, 4:28 PMEric Kolotyluk
11/26/2022, 4:30 PMVampire
11/26/2022, 4:30 PMVampire
11/26/2022, 4:34 PMEric Kolotyluk
11/26/2022, 4:34 PMEric Kolotyluk
11/26/2022, 4:35 PMVampire
11/26/2022, 4:36 PMEric Kolotyluk
11/26/2022, 4:37 PMEric Kolotyluk
11/26/2022, 4:37 PMVampire
11/26/2022, 4:39 PMEric Kolotyluk
11/26/2022, 4:41 PM