Skip to content

Commit 6288597

Browse files
Plugin verification (#321) (#327)
* Plugin verification (#321) - Upgraded IntelliJ Platform Gradle Plugin - Updated Java Version - Build Configuration: Refactor Gradle - Code Update: Base on Git issue add a getConfigurableId() --------- Signed-off-by: Lubos <lubos.janoscik@pantheon.tech>
1 parent c014f41 commit 6288597

File tree

9 files changed

+93
-29
lines changed

9 files changed

+93
-29
lines changed

.github/workflows/beta-release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ jobs:
2121
token: ${{ secrets.RELEASE_ACTION_TOKEN }}
2222
ref: ${{ github.head_ref }}
2323

24-
# Setup Java 17 environment for the next steps
24+
# Read Java version from gradle.properties
25+
- name: Get Java version
26+
id: java_version
27+
run: echo "version=$(grep -w javaVersion gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
28+
29+
# Setup Java environment for the next steps
2530
- name: Setup Java
2631
uses: actions/setup-java@v3
2732
with:
28-
java-version: 17
33+
java-version: ${{ steps.java_version.outputs.version }}
2934
distribution: 'adopt'
3035
cache: gradle
3136

@@ -48,4 +53,4 @@ jobs:
4853
- uses: stefanzweifel/git-auto-commit-action@v4.12.0
4954
with:
5055
commit_message: Increment version after release
51-
branch: master
56+
branch: master

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ jobs:
5050
# Prefix the list here with "+" to use these queries and those in the config file.
5151
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
- name: Set up JDK 17
53+
- name: Get Java version
54+
id: java_version
55+
run: echo "version=$(grep -w javaVersion gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
56+
- name: Set up JDK
5457
uses: actions/setup-java@v3
5558
with:
56-
java-version: '17'
59+
java-version: ${{ steps.java_version.outputs.version }}
5760
distribution: 'adopt'
5861
cache: gradle
5962
- name: Build with Gradle
6063
run: gradle build
6164

6265
- name: Perform CodeQL Analysis
63-
uses: github/codeql-action/analyze@v2
66+
uses: github/codeql-action/analyze@v2

.github/workflows/compatibility.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v3
14-
- name: Set up JDK 17
14+
- name: Get Java version
15+
id: java_version
16+
run: echo "version=$(grep -w javaVersion gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
17+
- name: Set up JDK
1518
uses: actions/setup-java@v3
1619
with:
17-
java-version: '17'
20+
java-version: ${{ steps.java_version.outputs.version }}
1821
distribution: 'adopt'
1922
cache: gradle
2023
- name: Execute Verify Plugin Compatibility

.github/workflows/gradle.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Set up JDK 17
18+
- name: Get Java version
19+
id: java_version
20+
run: echo "version=$(grep -w javaVersion gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
21+
- name: Set up JDK
1922
uses: actions/setup-java@v3
2023
with:
21-
java-version: '17'
24+
java-version: ${{ steps.java_version.outputs.version }}
2225
distribution: 'adopt'
2326
cache: gradle
2427
- name: Build with Gradle

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ jobs:
2121
token: ${{ secrets.RELEASE_ACTION_TOKEN }}
2222
ref: ${{ github.head_ref }}
2323

24-
# Setup Java 17 environment for the next steps
24+
# Read Java version from gradle.properties
25+
- name: Get Java version
26+
id: java_version
27+
run: echo "version=$(grep -w javaVersion gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
28+
29+
# Setup Java environment for the next steps
2530
- name: Setup Java
2631
uses: actions/setup-java@v3
2732
with:
28-
java-version: 17
33+
java-version: ${{ steps.java_version.outputs.version }}
2934
distribution: 'adopt'
3035
cache: gradle
3136

@@ -48,4 +53,4 @@ jobs:
4853
- uses: stefanzweifel/git-auto-commit-action@v4.12.0
4954
with:
5055
commit_message: Increment version after release
51-
branch: master
56+
branch: master

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ checkstyleTest {
1616
source = List.of('intelij-plugin/src/test/java', 'rfc-parser/src/test/java')
1717
}
1818

19-
group = 'tech.pantheon.YANGinator'
20-
version = '2.2-SNAPSHOT'
2119

2220
allprojects {
2321
apply plugin: 'java'
22+
group = 'tech.pantheon.YANGinator'
23+
version = '2.2-SNAPSHOT'
2424
java {
2525
sourceCompatibility = JavaVersion.toVersion(javaVersion)
2626
targetCompatibility = JavaVersion.toVersion(javaVersion)

gradle.properties

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# Available idea versions:
22
# https://www.jetbrains.com/intellij-repository/releases
33
# https://www.jetbrains.com/intellij-repository/snapshots
4-
ideaVersion=2025.2
5-
intellijGradlePluginVersion=2.7.1
64
gradleVersion=9.0.0
75
jupiterEngineVersion=5.13.4
86
changelogVersion=1.3.1
9-
javaVersion=17
7+
javaVersion=21
108
# rfc-parser properties
119
annotationsVersion=24.0.0
1210
commonsIoVersion=2.18.0
1311
guavaVersion=33.4.0-jre
1412
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
13+
#Idea properties
14+
ideaBuildVersion=253
15+
ideaVersion=2025.3
16+
intellijGradlePluginVersion=2.13.1

intelij-plugin/build.gradle

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
22
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
3+
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
4+
import org.jetbrains.intellij.platform.gradle.tasks.BuildSearchableOptionsTask
5+
import org.jetbrains.intellij.platform.gradle.tasks.InstrumentCodeTask
36

47
plugins {
58

69
id 'org.jetbrains.intellij.platform' version "$intellijGradlePluginVersion"
710
id 'org.jetbrains.changelog' version "$changelogVersion"
811
}
912

10-
intellijPlatform {
11-
pluginVerification {
12-
ides {
13-
ide(IntelliJPlatformType.IntellijIdeaCommunity, "2025.2")
14-
}
15-
}
16-
}
1713

1814
apply plugin: 'org.jetbrains.changelog'
1915

@@ -27,10 +23,11 @@ changelog {
2723
groups = []
2824
}
2925

26+
3027
tasks {
3128
patchPluginXml {
32-
sinceBuild = '243'
33-
untilBuild = '252.*'
29+
sinceBuild = ideaBuildVersion
30+
untilBuild = null
3431
changeNotes = changelog.getLatest().toHTML() + "<a href=\"https://github.com/PANTHEONtech/YANGinator/blob/master/CHANGELOG.md\">more...</a>"
3532
}
3633
}
@@ -60,16 +57,57 @@ repositories {
6057
mavenCentral()
6158
intellijPlatform {
6259
defaultRepositories()
60+
intellijDependencies()
61+
62+
snapshots()
63+
jetbrainsRuntime()
6364
}
6465
}
6566

6667
dependencies {
6768
intellijPlatform {
68-
intellijIdeaCommunity ideaVersion
69+
create(IntelliJPlatformType.IntellijIdea, ideaVersion)
6970
bundledPlugin("com.intellij.java")
70-
testFramework TestFrameworkType.Platform.INSTANCE
71+
testFramework(TestFrameworkType.Platform.INSTANCE)
72+
73+
pluginVerifier()
74+
javaCompiler()
7175
}
7276

7377
testImplementation group: 'org.junit.jupiter',
7478
name: 'junit-jupiter-engine', version: jupiterEngineVersion
7579
}
80+
81+
/**
82+
* IntelliJ Platform Configuration
83+
* * note: The 'recommended()' verification target downloads multiple IDE distributions
84+
* (latest stable, EAP, and previous major versions). This ensures broad compatibility
85+
* but requires significant disk space and network bandwidth.
86+
* * maintenance: To optimize build performance and storage, keep 'sinceBuild' aligned
87+
* with the target SDK version found in 'Help -> About' or the JetBrains Release Portal.
88+
* * @see https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
89+
*/
90+
intellijPlatform {
91+
buildSearchableOptions = false
92+
instrumentCode = true
93+
94+
pluginConfiguration {
95+
id = 'tech.pantheon.yanginator'
96+
name = 'YANGinator'
97+
ideaVersion {
98+
sinceBuild = ideaBuildVersion
99+
untilBuild = null
100+
}
101+
}
102+
103+
pluginVerification {
104+
ides {
105+
// recommended()
106+
select {
107+
it.types = [IntelliJPlatformType.IntellijIdea]
108+
it.channels = [ProductRelease.Channel.RELEASE, ProductRelease.Channel.EAP]
109+
it.sinceBuild = ideaBuildVersion
110+
}
111+
}
112+
}
113+
}

intelij-plugin/src/main/java/tech/pantheon/yanginator/plugin/formatter/settings/YangCodeStyleSettingsProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
4343
}
4444
};
4545
}
46+
47+
@Override
48+
public @NotNull String getConfigurableId() {
49+
return "tech.pantheon.yanginator";
50+
}
4651
}

0 commit comments

Comments
 (0)