Skip to content

Commit

Permalink
Migrate to new intellij gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
aesy committed Dec 28, 2024
1 parent c758763 commit 1ebfd19
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 30 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 11 ]
java-version: [ 21 ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,10 +32,12 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Install dependencies
run: sudo pip install --prefix /usr/local yamllint
- name: Test with Gradle
run: ./gradlew koverXmlReport --info
- name: Upload coverage to Codecov
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
build
out
.idea
.kotlin
.intellijPlatform
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Open a Yaml file, warnings and errors should be displayed inline according to yo

#### Prerequisites

* [Gradle 8.5+](https://gradle.org/)
* [A Java 11+ Runtime](https://adoptopenjdk.net/)
* [Gradle 8.12+](https://gradle.org/)
* [A Java 21+ Runtime](https://adoptopenjdk.net/)

#### Build

Expand Down
44 changes: 30 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.intellij.platform.gradle.TestFrameworkType

plugins {
id("java")
id("org.jetbrains.intellij.platform") version "2.2.0"
Expand All @@ -11,6 +13,10 @@ version = "0.5"
repositories {
mavenCentral()
mavenLocal()

intellijPlatform {
defaultRepositories()
}
}

dependencies {
Expand All @@ -20,25 +26,35 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.strikt:strikt-core:0.35.1")
testImplementation("io.mockk:mockk:1.13.14")
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))

// https://youtrack.jetbrains.com/issue/IJPL-159134/JUnit5-Test-Framework-refers-to-JUnit4-java.lang.NoClassDefFoundError-junit-framework-TestCase
testImplementation("junit:junit:4.13.2")

intellijPlatform {
// https://www.jetbrains.com/idea/download/other.html
intellijIdeaCommunity("2024.3.1.1")

// https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html#ids-of-bundled-plugins
bundledPlugin("org.jetbrains.plugins.yaml")

// https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1838
bundledPlugin("com.intellij.llmInstaller")

// https://plugins.jetbrains.com/plugin/631-python/versions
plugin("PythonCore", "243.22562.145")

testFramework(TestFrameworkType.Platform)
}
}

kotlin {
jvmToolchain(17)
jvmToolchain(21)
}

intellij {
pluginName = rootProject.name
// https://www.jetbrains.com/idea/download/other.html
version = "2024.3.1.1"
type = "IC"
updateSinceUntilBuild = false
plugins = listOf(
"org.jetbrains.plugins.yaml",
// https://plugins.jetbrains.com/plugin/631-python/versions
"PythonCore:243.22562.145"
)
intellijPlatform {
pluginConfiguration {
name = rootProject.name
}
}

tasks {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down

0 comments on commit 1ebfd19

Please sign in to comment.