Skip to content

Commit 368dc12

Browse files
fix: better browser performance + fixed settings panel + pulled upstream plugin template (upgraded gradle and build tools) (#193)
1 parent be1f28e commit 368dc12

22 files changed

+407
-158
lines changed

.github/workflows/build.yml

+10-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
concurrency:
2424
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2525
cancel-in-progress: true
26-
26+
2727
jobs:
2828

2929
# Prepare environment and build the plugin
@@ -36,13 +36,13 @@ jobs:
3636
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3737
steps:
3838

39-
# Check out current repository
39+
# Check out the current repository
4040
- name: Fetch Sources
4141
uses: actions/checkout@v4
4242

4343
# Validate wrapper
4444
- name: Gradle Wrapper Validation
45-
uses: gradle/wrapper-validation-action@v3
45+
uses: gradle/actions/wrapper-validation@v3
4646

4747
# Set up Java environment for the next steps
4848
- name: Setup Java
@@ -54,8 +54,6 @@ jobs:
5454
# Setup Gradle
5555
- name: Setup Gradle
5656
uses: gradle/actions/setup-gradle@v4
57-
with:
58-
gradle-home-cache-cleanup: true
5957

6058
# Set environment variables
6159
- name: Export Properties
@@ -73,8 +71,6 @@ jobs:
7371
echo "$CHANGELOG" >> $GITHUB_OUTPUT
7472
echo "EOF" >> $GITHUB_OUTPUT
7573
76-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
77-
7874
# Build plugin
7975
- name: Build plugin
8076
run: ./gradlew buildPlugin
@@ -104,7 +100,7 @@ jobs:
104100
runs-on: ubuntu-latest
105101
steps:
106102

107-
# Check out current repository
103+
# Check out the current repository
108104
- name: Fetch Sources
109105
uses: actions/checkout@v4
110106

@@ -118,8 +114,6 @@ jobs:
118114
# Setup Gradle
119115
- name: Setup Gradle
120116
uses: gradle/actions/setup-gradle@v4
121-
with:
122-
gradle-home-cache-cleanup: true
123117

124118
# Run tests
125119
- name: Run Tests
@@ -158,7 +152,7 @@ jobs:
158152
tool-cache: false
159153
large-packages: false
160154

161-
# Check out current repository
155+
# Check out the current repository
162156
- name: Fetch Sources
163157
uses: actions/checkout@v4
164158
with:
@@ -174,7 +168,7 @@ jobs:
174168

175169
# Run Qodana inspections
176170
- name: Qodana - Code Inspection
177-
uses: JetBrains/qodana-action@v2024.2.3
171+
uses: JetBrains/qodana-action@v2024.2
178172
with:
179173
upload-result: true # upload results as github action artifacts
180174
cache-default-branch-only: true
@@ -193,7 +187,7 @@ jobs:
193187
tool-cache: false
194188
large-packages: false
195189

196-
# Check out current repository
190+
# Check out the current repository
197191
- name: Fetch Sources
198192
uses: actions/checkout@v4
199193

@@ -207,8 +201,6 @@ jobs:
207201
# Setup Gradle
208202
- name: Setup Gradle
209203
uses: gradle/actions/setup-gradle@v4
210-
with:
211-
gradle-home-cache-cleanup: true
212204

213205
# Cache Plugin Verifier IDEs
214206
- name: Setup Plugin Verifier IDEs Cache
@@ -219,7 +211,7 @@ jobs:
219211

220212
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
221213
- name: Run Plugin Verification tasks
222-
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
214+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
223215

224216
# Collect Plugin Verifier Result
225217
- name: Collect Plugin Verifier Result
@@ -240,7 +232,7 @@ jobs:
240232
contents: write
241233
steps:
242234

243-
# Check out current repository
235+
# Check out the current repository
244236
- name: Fetch Sources
245237
uses: actions/checkout@v4
246238

@@ -264,4 +256,4 @@ jobs:
264256
--notes "$(cat << 'EOM'
265257
${{ needs.build.outputs.changelog }}
266258
EOM
267-
)"
259+
)"

.github/workflows/release.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write
1919
steps:
2020

21-
# Check out current repository
21+
# Check out the current repository
2222
- name: Fetch Sources
2323
uses: actions/checkout@v4
2424
with:
@@ -34,8 +34,6 @@ jobs:
3434
# Setup Gradle
3535
- name: Setup Gradle
3636
uses: gradle/actions/setup-gradle@v4
37-
with:
38-
gradle-home-cache-cleanup: true
3937

4038
# Set environment variables
4139
- name: Export Properties
@@ -51,7 +49,7 @@ jobs:
5149
echo "$CHANGELOG" >> $GITHUB_OUTPUT
5250
echo "EOF" >> $GITHUB_OUTPUT
5351
54-
# Update Unreleased section with the current release note
52+
# Update the Unreleased section with the current release note
5553
- name: Patch Changelog
5654
if: ${{ steps.properties.outputs.changelog != '' }}
5755
env:
@@ -100,4 +98,4 @@ jobs:
10098
--title "Changelog update - \`$VERSION\`" \
10199
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
102100
--label "$LABEL" \
103-
--head $BRANCH
101+
--head $BRANCH

.github/workflows/run-ui-tests.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333

34-
# Check out current repository
34+
# Check out the current repository
3535
- name: Fetch Sources
3636
uses: actions/checkout@v4
3737

@@ -45,8 +45,6 @@ jobs:
4545
# Setup Gradle
4646
- name: Setup Gradle
4747
uses: gradle/actions/setup-gradle@v4
48-
with:
49-
gradle-home-cache-cleanup: true
5048

5149
# Run IDEA prepared for UI testing
5250
- name: Run IDE
@@ -62,4 +60,4 @@ jobs:
6260

6361
# Run tests
6462
- name: Tests
65-
run: ./gradlew test
63+
run: ./gradlew test
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# GitHub Actions Workflow responsible for cleaning up the IntelliJ Platform Plugin Template repository from the template-specific files and configurations.
2+
# This workflow is supposed to be triggered automatically when a new template-based repository has been created.
3+
4+
name: Template Cleanup
5+
on:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
11+
# Run a cleaning process only if the workflow is triggered by the non-"intellij-platform-plugin-template" repository.
12+
template-cleanup:
13+
name: Template Cleanup
14+
runs-on: ubuntu-latest
15+
if: github.event.repository.name != 'intellij-platform-plugin-template'
16+
permissions:
17+
contents: write
18+
steps:
19+
20+
# Check out the current repository
21+
- name: Fetch Sources
22+
uses: actions/checkout@v4
23+
24+
# Cleanup project
25+
- name: Cleanup
26+
run: |
27+
export LC_CTYPE=C
28+
export LANG=C
29+
30+
# Prepare variables
31+
NAME="${GITHUB_REPOSITORY##*/}"
32+
ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]')
33+
SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
34+
SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
35+
GROUP="com.github.$SAFE_ACTOR.$SAFE_NAME"
36+
37+
# Replace placeholders in the template-cleanup files
38+
sed -i "s/%NAME%/$NAME/g" .github/template-cleanup/*
39+
sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" .github/template-cleanup/*
40+
sed -i "s/%GROUP%/$GROUP/g" .github/template-cleanup/*
41+
42+
# Replace template package name in project files with $GROUP
43+
find src -type f -exec sed -i "s/org.jetbrains.plugins.template/$GROUP/g" {} +
44+
find src -type f -exec sed -i "s/IntelliJ Platform Plugin Template/$NAME/g" {} +
45+
find src -type f -exec sed -i "s/JetBrains/$ACTOR/g" {} +
46+
47+
# Move content
48+
mkdir -p src/main/kotlin/${GROUP//.//}
49+
mkdir -p src/test/kotlin/${GROUP//.//}
50+
cp -R .github/template-cleanup/. .
51+
cp -R src/main/kotlin/org/jetbrains/plugins/template/* src/main/kotlin/${GROUP//.//}/
52+
cp -R src/test/kotlin/org/jetbrains/plugins/template/* src/test/kotlin/${GROUP//.//}/
53+
54+
# Cleanup
55+
rm -rf \
56+
.github/ISSUE_TEMPLATE \
57+
.github/readme \
58+
.github/template-cleanup \
59+
.github/workflows/template-cleanup.yml \
60+
.github/workflows/template-verify.yml \
61+
.idea/icon.png \
62+
src/main/kotlin/org \
63+
src/test/kotlin/org \
64+
CODE_OF_CONDUCT.md \
65+
LICENSE
66+
67+
# Commit modified files
68+
- name: Commit files
69+
run: |
70+
git config --local user.email "action@github.com"
71+
git config --local user.name "GitHub Action"
72+
git add .
73+
git commit -m "Template cleanup"
74+
75+
# Push changes
76+
- name: Push changes
77+
uses: ad-m/github-push-action@master
78+
with:
79+
branch: main
80+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/template-verify.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# GitHub Actions Workflow verifies if the template repository is consistent with all provided content.
2+
3+
name: Template Verify
4+
on:
5+
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
6+
push:
7+
branches: [main]
8+
paths: ['**/gradle.properties']
9+
# Trigger the workflow on any pull request
10+
pull_request:
11+
paths: ['**/gradle.properties']
12+
13+
jobs:
14+
15+
build:
16+
name: Template Verify
17+
if: github.event.repository.name == 'intellij-platform-plugin-template'
18+
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ steps.properties.outputs.version }}
21+
changelog: ${{ steps.properties.outputs.changelog }}
22+
steps:
23+
24+
# Check out the current repository
25+
- name: Fetch Sources
26+
uses: actions/checkout@v4
27+
28+
# Compare `gradle.properties` with `.github/template-cleanup/gradle.properties`
29+
- name: Verify gradle.properties
30+
run: |
31+
echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY
32+
33+
diff -U 0 \
34+
-I '^pluginVersion' \
35+
-I '^pluginGroup' \
36+
-I '^pluginName' \
37+
-I '^pluginRepositoryUrl' \
38+
--label .github/template-cleanup/gradle.properties \
39+
--label gradle.properties \
40+
.github/template-cleanup/gradle.properties gradle.properties \
41+
>> $GITHUB_STEP_SUMMARY
42+
43+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)