Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IntelliJ IDEA 2023/2024 #1004

Draft
wants to merge 4 commits into
base: 2.0.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-idea-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
strategy:
matrix:
ij_sdk: [IJ193, IJ201, IJ202, IJ203, IJ211, IJ212, IJ213]
ij_sdk: [IJ193, IJ201, IJ202, IJ203, IJ211, IJ212, IJ213, IJ233, IJ241]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ij_sdk: [IJ193, IJ201, IJ202, IJ203, IJ211, IJ212, IJ213]
ij_sdk: [IJ193, IJ201, IJ202, IJ203, IJ211, IJ212, IJ213, IJ233, IJ241]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ reckon {
allprojects {
repositories {
mavenCentral()
jcenter()
}

if (Files.exists(Paths.get("$rootDir/local.properties"))) {
Expand All @@ -37,8 +36,8 @@ allprojects {
tasks.withType<KotlinCompile<*>> {
if (this is KotlinJvmCompile) {
kotlinOptions {
apiVersion = "1.3"
jvmTarget = "1.8"
apiVersion = "1.4"
jvmTarget = JavaVersion.VERSION_17.toString()
}
} else {
kotlinOptions {
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
`java-gradle-plugin`
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
id("com.github.johnrengelman.shadow") version "8.1.1"
}

repositories {
Expand All @@ -10,9 +11,9 @@ repositories {
}

dependencies {
api(kotlin("gradle-plugin", version = "1.5.31"))
api(kotlin("gradle-plugin", version = "1.9.21"))
api("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
api("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
api("org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.4.0")
api("com.github.jengelman.gradle.plugins:shadow:4.0.2")
api("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5")
api("org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.16.+")
api("org.apache.ant:ant:1.10.13") // needed for shadow jar zip
}
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/ij/BuildConfig.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package ij

import org.gradle.api.JavaVersion

data class VersionRange(val since: String, val until: String)

data class BuildConfig(
val sdk: String,
val prefix: String,
val extraSource: String,
val version: VersionRange,
val deps: List<String> = emptyList()
val deps: List<String> = emptyList(),
val javaVersion: JavaVersion = JavaVersion.VERSION_17
)
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
kotlin.incremental=true
org.gradle.parallel=true
reckon.scope=patch
reckon.scope=patch
kotlin.stdlib.default.dependency=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
33 changes: 15 additions & 18 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand All @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
25 changes: 7 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand All @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -61,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
6 changes: 3 additions & 3 deletions integration-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib"))
// implementation(kotlin("stdlib"))
}
}

Expand All @@ -32,7 +32,7 @@ kotlin {
jvm {
compilations["main"].defaultSourceSet {
dependencies {
implementation(kotlin("stdlib-jdk8"))
// implementation(kotlin("stdlib-jdk8"))
}
}

Expand Down Expand Up @@ -142,6 +142,6 @@ tasks {
// the spek-runtime and compiler plugin projects, rather than trying to download the not-yet-published version from a Maven repository.
configurations.forEach {
it.resolutionStrategy.dependencySubstitution {
substitute(module("org.spekframework.spek2:spek-runtime")).with(project(":spek-runtime"))
substitute(module("org.spekframework.spek2:spek-runtime")).using(project(":spek-runtime"))
}
}
10 changes: 5 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
enableFeaturePreview("GRADLE_METADATA")

rootProject.name = "spek"

includeBuild("./spek-gradle-plugin") {
dependencySubstitution {
substitute(module("org.spekframework.spek2:spek-gradle-plugin:0.1.0")).with(project(":"))
substitute(module("org.spekframework.spek2:spek-gradle-plugin:0.1.0")).using(project(":"))
}
}

Expand All @@ -30,5 +28,7 @@ if (excludeIdePlugins == null) {
include("spek-ide-plugin-intellij-base")
include("spek-ide-plugin-intellij-base-jvm")
include("spek-ide-plugin-intellij-idea")
include("spek-ide-plugin-android-studio")
}
// include("spek-ide-plugin-android-studio")
}


8 changes: 4 additions & 4 deletions spek-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
// implementation(kotlin("stdlib-common"))
}
}

jvm {
compilations["main"].defaultSourceSet {
dependencies {
implementation(kotlin("stdlib-jdk8"))
// implementation(kotlin("stdlib-jdk8"))
}
}
}

js {
compilations["main"].defaultSourceSet {
dependencies {
implementation(kotlin("stdlib-js"))
// implementation(kotlin("stdlib-js"))
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions spek-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ plugins {

buildscript {
dependencies {
classpath(kotlin("gradle-plugin", version = "1.5.31"))
classpath(kotlin("gradle-plugin", version = "1.9.21"))
}
}

repositories {
jcenter()
mavenCentral()
}

reckon {
Expand All @@ -32,7 +32,7 @@ gradlePlugin {
val autoService = "com.google.auto.service:auto-service:1.0-rc4"

dependencies {
implementation(kotlin("stdlib"))
// implementation(kotlin("stdlib"))
implementation(kotlin("gradle-plugin"))
implementation(kotlin("gradle-plugin-api"))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
package org.spekframework.spek2.gradle.kotlin

import com.google.auto.service.AutoService
import org.gradle.api.Project
import org.gradle.api.tasks.compile.AbstractCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions
import org.gradle.api.provider.Provider
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
import org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerPluginSupportPlugin
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeLink
import org.spekframework.spek2.gradle.entry.MultiplatformPlugin
import org.spekframework.spek2.gradle.domain.MultiplatformExtension
import org.spekframework.spek2.gradle.entry.MultiplatformPlugin

class Subplugin : KotlinGradleSubplugin<AbstractCompile> {
override fun apply(project: Project, kotlinCompile: AbstractCompile, javaCompile: AbstractCompile?, variantData: Any?, androidProjectHandler: Any?, kotlinCompilation: KotlinCompilation<KotlinCommonOptions>?): List<SubpluginOption> {
val extension = checkNotNull(project.extensions.findByType(MultiplatformExtension::class.java))
class Subplugin : KotlinCompilerPluginSupportPlugin {
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> {
val extension = checkNotNull(kotlinCompilation.target.project.extensions.findByType(MultiplatformExtension::class.java))

return listOf(SubpluginOption("enabled", extension.enabled.toString()))
return kotlinCompilation.target.project.provider {
listOf(SubpluginOption("enabled", extension.enabled.toString()))
}
}

override fun getCompilerPluginId(): String {
Expand All @@ -35,14 +32,8 @@ class Subplugin : KotlinGradleSubplugin<AbstractCompile> {
)
}

override fun getNativeCompilerPluginArtifact(): SubpluginArtifact? {
return SubpluginArtifact(
MultiplatformPlugin.spekMavenGroup,
"spek-kotlin-compiler-plugin-native",
MultiplatformPlugin.spekVersion
)
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
return kotlinCompilation.target.project.plugins.hasPlugin(MultiplatformPlugin::class.java)
// && (task is KotlinNativeCompile || task is KotlinNativeLink)
}

override fun isApplicable(project: Project, task: AbstractCompile): Boolean
= project.plugins.hasPlugin(MultiplatformPlugin::class.java) && (task is KotlinNativeCompile || task is KotlinNativeLink)
}
Loading