Skip to content

Commit 1b67d96

Browse files
committed
IJMP-1844 and IJMP-1874 The latest IntelliJ IDEA support + unit test fixes
Signed-off-by: Uladzislau <leksilonchikk@gmail.com>
1 parent b3bdc25 commit 1b67d96

File tree

12 files changed

+239
-125
lines changed

12 files changed

+239
-125
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build
2+
3+
on: [push, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout the plugin GitHub repository
10+
uses: actions/checkout@v4
11+
12+
- name: Setup Java
13+
uses: actions/setup-java@v4
14+
with:
15+
distribution: zulu
16+
java-version: 17
17+
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
with:
21+
gradle-home-cache-cleanup: true
22+
23+
- name: Check repository content
24+
shell: bash
25+
run: pwd && ls -la
26+
27+
- name: Build plugin's binary
28+
shell: bash
29+
run: ./gradlew build
30+
31+
- name: Prepare Plugin Artifact
32+
id: artifact
33+
shell: bash
34+
run: |
35+
cd ${{ github.workspace }}/build/distributions
36+
FILENAME=`ls *.zip`
37+
unzip "$FILENAME" -d content
38+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
39+
echo "zip artifact name:"
40+
echo "$FILENAME"
41+
42+
- name: Publish built plugin to artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: ${{ steps.artifact.outputs.filename }}
46+
path: ./build/distributions/content/*/*

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ $RECYCLE.BIN/
2424
**/.DS_Store
2525

2626
.vscode/
27-
28-
/gradle/wrapper/gradle-wrapper.jar
29-
!/gradle/wrapper/gradle-wrapper.properties

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# JCL Highlight Plugin Changelog
1+
# Zowe JCL Support Plugin Changelog
22

33
All notable changes to the Zowe™ JCL plug-in for IntelliJ IDEA™ will be documented in this file.
44

5+
## `0.1.2 (2024-07-19)`
6+
7+
* Feature: Added support of the latest IntelliJ IDEA version
8+
* Feature: Dropped support of the IntelliJ IDEA versions below 2023.1
9+
10+
511
## `0.1.1 (2023-11-20)`
12+
613
* Feature: Separated the plugin to three versions
714
* Feature: Zowe Explorer version update
815
* Feature: Added support for IntelliJ v2023.2

build.gradle.kts

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,20 @@ intellij {
3838
version.set("2023.1")
3939

4040
// To have a dependency on zowe explorer from the marketplace
41-
plugins.set(listOf("org.zowe.explorer:1.1.1-231"))
41+
plugins.set(listOf("org.zowe.explorer:1.2.2-231"))
4242

4343
// To have a dependency on built-in plugin from \Project_dir\libs\for-mainframe
4444
// plugins.set(listOf("${projectDir}\\libs\\for-mainframe"))
4545
}
4646

4747
tasks {
4848
patchPluginXml {
49-
sinceBuild.set("231.8109")
50-
untilBuild.set("232.*")
49+
version.set("${properties("pluginVersion").get()}-${properties("sinceBuildVersion").get().substringBefore(".")}")
50+
sinceBuild = properties("sinceBuildVersion")
51+
untilBuild = properties("untilBuildVersion")
52+
53+
val changelog = project.changelog // local variable for configuration cache compatibility
54+
// Get the latest available change notes from the changelog file
5155
changeNotes.set(
5256
"""
5357
<b>New features:</b>
@@ -71,29 +75,7 @@ tasks {
7175
isScanForTestClasses = false
7276
include("**/*Test*")
7377
}
74-
}
75-
76-
sourceSets {
77-
main {
78-
java.srcDirs("src/main")
79-
kotlin.srcDirs("src/main")
80-
}
81-
test {
82-
java.srcDirs("src/test")
83-
kotlin.srcDirs("src/test")
84-
}
85-
}
86-
87-
val jflexVersion = "1.9.1"
88-
89-
grammarKit {
90-
// version of IntelliJ patched JFlex - https://github.com/JetBrains/intellij-deps-jflex
91-
jflexRelease.set(jflexVersion)
92-
// release version of Grammar-Kit - https://github.com/JetBrains/Grammar-Kit
93-
grammarKitRelease.set("2021.1.2")
94-
}
9578

96-
tasks {
9779
generateParser {
9880
source.set("src/main/kotlin/org/zowe/jcl/lang/Jcl.bnf")
9981
targetRoot.set("src/main/java")
@@ -108,20 +90,18 @@ tasks {
10890
targetClass.set("JclLexer")
10991
purgeOldFiles.set(true)
11092
}
111-
}
11293

113-
// needed until it becomes possible to set encoding of .flex file using the generateLexer task
114-
// see https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/127
115-
val generateJclLexer = task<JavaExec>("generateJclLexer") {
116-
val jflexJar = "jflex-${jflexVersion}.jar"
117-
val source = "src/main/kotlin/org/zowe/jcl/lang/Jcl.flex"
118-
val targetDir = "src/main/java/org/zowe/jcl/lang"
119-
val encoding = "UTF-8"
120-
classpath = files(jflexJar)
121-
args("-d", targetDir, "--encoding", encoding, source)
122-
}
94+
// needed until it becomes possible to set encoding of .flex file using the generateLexer task
95+
// see https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/127
96+
val generateJclLexer = task<JavaExec>("generateJclLexer") {
97+
val jflexJar = "jflex-${jflexVersion}.jar"
98+
val source = "src/main/kotlin/org/zowe/jcl/lang/Jcl.flex"
99+
val targetDir = "src/main/java/org/zowe/jcl/lang"
100+
val encoding = "UTF-8"
101+
classpath = files(jflexJar)
102+
args("-d", targetDir, "--encoding", encoding, source)
103+
}
123104

124-
tasks {
125105
compileKotlin {
126106
dependsOn(generateJclLexer, generateParser)
127107

@@ -138,3 +118,23 @@ tasks {
138118
}
139119
}
140120
}
121+
122+
sourceSets {
123+
main {
124+
java.srcDirs("src/main")
125+
kotlin.srcDirs("src/main")
126+
}
127+
test {
128+
java.srcDirs("src/test")
129+
kotlin.srcDirs("src/test")
130+
}
131+
}
132+
133+
val jflexVersion = "1.9.1"
134+
135+
grammarKit {
136+
// version of IntelliJ patched JFlex - https://github.com/JetBrains/intellij-deps-jflex
137+
jflexRelease.set(jflexVersion)
138+
// release version of Grammar-Kit - https://github.com/JetBrains/Grammar-Kit
139+
grammarKitRelease.set("2021.1.2")
140+
}

gradle/wrapper/gradle-wrapper.jar

58.4 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
4-
networkTimeout=10000
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
54
zipStoreBase=GRADLE_USER_HOME
65
zipStorePath=wrapper/dists

gradlew

100644100755
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,11 +80,11 @@ do
8080
esac
8181
done
8282

83-
# This is normally unused
84-
# shellcheck disable=SC2034
85-
APP_BASE_NAME=${0##*/}
8683
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8784

85+
APP_NAME="Gradle"
86+
APP_BASE_NAME=${0##*/}
87+
8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
9090

@@ -143,16 +143,12 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146-
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148146
MAX_FD=$( ulimit -H -n ) ||
149147
warn "Could not query maximum file descriptor limit"
150148
esac
151149
case $MAX_FD in #(
152150
'' | soft) :;; #(
153151
*)
154-
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156152
ulimit -n "$MAX_FD" ||
157153
warn "Could not set maximum file descriptor limit to $MAX_FD"
158154
esac
@@ -209,12 +205,6 @@ set -- \
209205
org.gradle.wrapper.GradleWrapperMain \
210206
"$@"
211207

212-
# Stop when "xargs" is not available.
213-
if ! command -v xargs >/dev/null 2>&1
214-
then
215-
die "xargs is not available"
216-
fi
217-
218208
# Use "xargs" to parse quoted args.
219209
#
220210
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%"=="" @echo off
17+
@if "%DEBUG%" == "" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,8 +25,7 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%"=="" set DIRNAME=.
29-
@rem This is normally unused
28+
if "%DIRNAME%" == "" set DIRNAME=.
3029
set APP_BASE_NAME=%~n0
3130
set APP_HOME=%DIRNAME%
3231

@@ -41,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4140

4241
set JAVA_EXE=java.exe
4342
%JAVA_EXE% -version >NUL 2>&1
44-
if %ERRORLEVEL% equ 0 goto execute
43+
if "%ERRORLEVEL%" == "0" goto execute
4544

4645
echo.
4746
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7675

7776
:end
7877
@rem End local scope for the variables with windows NT shell
79-
if %ERRORLEVEL% equ 0 goto mainEnd
78+
if "%ERRORLEVEL%"=="0" goto mainEnd
8079

8180
:fail
8281
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8382
rem the _cmd.exe /c_ return code!
84-
set EXIT_CODE=%ERRORLEVEL%
85-
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86-
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87-
exit /b %EXIT_CODE%
83+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84+
exit /b 1
8885

8986
:mainEnd
9087
if "%OS%"=="Windows_NT" endlocal
Lines changed: 77 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)