Skip to content

Commit

Permalink
Merge pull request #44 from FHannes/master
Browse files Browse the repository at this point in the history
Fix for issues #41 and #42
  • Loading branch information
bjansen authored Oct 10, 2023
2 parents b45d656 + ea64034 commit e33ffa3
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 410 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,17 @@ jobs:
env:
# see https://www.jetbrains.com/idea/download/previous.html
# and https://www.jetbrains.com/intellij-repository/snapshots/
- IDEA_VERSION: IC-15.0.6
- IDEA_VERSION: IC-2016.3.8
- IDEA_VERSION: IC-2017.3.6
- IDEA_VERSION: IC-2018.3.6
- IDEA_VERSION: IC-2019.3.3
- IDEA_VERSION: IC-2020.3
JDK_VERSION: '11'
- IDEA_VERSION: IC-2022.2.5
- IDEA_VERSION: IC-2022.3.1
- IDEA_VERSION: IC-2023.2.2
- IDEA_VERSION: IU-LATEST-EAP-SNAPSHOT
JDK_VERSION: '11'

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
if: matrix.env.JDK_VERSION != '11'
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
if: matrix.env.JDK_VERSION == '11'
java-version: 17
- name: Build with Gradle
run: |
./gradlew -PideaVersion=${IDEA_VERSION} buildPlugin
Expand All @@ -47,4 +36,4 @@ jobs:
with:
name: ${{env.DIST_FILE}}
path: build/distributions/jetbrains-plugin-st4-*.zip
if: matrix.env.IDEA_VERSION == 'IC-2020.3'
if: matrix.env.IDEA_VERSION == 'IC-2022.2.5'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
hs_err_pid*

/build
/bin
/.gradle
/.idea/
*.iml
*.ipr
67 changes: 0 additions & 67 deletions build.gradle

This file was deleted.

68 changes: 68 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
plugins {
id("java")
id("org.jetbrains.intellij") version "1.15.0"
id("antlr")
}

group = "antlr"
version = properties["pluginVersion"].toString()

repositories {
mavenCentral()
}

intellij {
version.set(properties["ideaVersion"].toString())
type.set("IC") // Target IDE Platform

pluginName.set("jetbrains-plugin-st4")
downloadSources = true
updateSinceUntilBuild = false
}

dependencies {
antlr("org.antlr:antlr4:${properties["antlr4Version"]}") {
exclude(group = "com.ibm.icu", module = "icu4j")
}
implementation("org.antlr:antlr4-intellij-adaptor:0.1")
implementation("org.antlr:antlr4-runtime:${properties["antlr4Version"]}")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:5.5.0")
}

sourceSets {
main {
antlr {
setIncludes(listOf("ST*.g4"))
}
}
}

// See https://github.com/gradle/gradle/issues/820#issuecomment-1585814999
configurations {
api {
setExtendsFrom(extendsFrom.filterNot { it == configurations.antlr })
}
}

tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
}

patchPluginXml {
sinceBuild.set("222.4554.10")
}

generateGrammarSource {
arguments = arguments + listOf(
"-package", "org.antlr.jetbrains.st4plugin.parsing",
"-long-messages",
"-no-visitor",
"-no-listener",
"-lib","src/main/antlr"
)
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pluginVersion=0.10-SNAPSHOT

# e.g. IC-2016.3.3, IU-2018.2.5 etc
# For a list of possible values, refer to the section 'com.jetbrains.intellij.idea' at https://www.jetbrains.com/intellij-repository/releases
ideaVersion=2020.2
ideaVersion=2022.2.5

# The version of ANTLR v4 that will be used to generate the parser
antlr4Version=4.9
antlr4Version=4.13.1
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.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e33ffa3

Please sign in to comment.