feat(combat): add 232.* support

This commit is contained in:
marhali 2023-09-02 12:23:12 +02:00
parent 1f7b796973
commit e34d23fe06
18 changed files with 316 additions and 152 deletions

View File

@ -1,12 +1,12 @@
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps: # GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
# - validate Gradle Wrapper, # - Validate Gradle Wrapper.
# - run 'test' and 'verifyPlugin' tasks, # - Run 'test' and 'verifyPlugin' tasks.
# - run Qodana inspections, # - Run Qodana inspections.
# - run 'buildPlugin' task and prepare artifact for the further tests, # - Run the 'buildPlugin' task and prepare artifact for further tests.
# - run 'runPluginVerifier' task, # - Run the 'runPluginVerifier' task.
# - create a draft release. # - Create a draft release.
# #
# Workflow is triggered on push and pull_request events. # The workflow is triggered on push and pull_request events.
# #
# GitHub Actions reference: https://help.github.com/en/actions # GitHub Actions reference: https://help.github.com/en/actions
# #
@ -14,7 +14,7 @@
name: Build name: Build
on: on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
push: push:
branches: [ main ] branches: [ main ]
# Trigger the workflow on any pull request # Trigger the workflow on any pull request
@ -22,38 +22,36 @@ on:
jobs: jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum # Prepare environment and build the plugin
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
# Build plugin and provide the artifact for the next workflow jobs
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
version: ${{ steps.properties.outputs.version }} version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }} changelog: ${{ steps.properties.outputs.changelog }}
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps: steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v3
# Validate wrapper # Validate wrapper
- name: Gradle Wrapper Validation - name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.5 uses: gradle/wrapper-validation-action@v1.1.0
# Setup Java 11 environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: zulu distribution: zulu
java-version: 11 java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# Set environment variables # Set environment variables
- name: Export Properties - name: Export Properties
@ -62,19 +60,63 @@ jobs:
run: | run: |
PROPERTIES="$(./gradlew properties --console=plain -q)" PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=version::$VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "::set-output name=name::$NAME" echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Build plugin
- name: Build plugin
run: ./gradlew buildPlugin
# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
# Run tests and upload a code coverage report
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# Run tests # Run tests
- name: Run Tests - name: Run Tests
run: ./gradlew check run: ./gradlew check
@ -87,22 +129,88 @@ jobs:
name: tests-result name: tests-result
path: ${{ github.workspace }}/build/reports/tests path: ${{ github.workspace }}/build/reports/tests
# Upload Kover report to CodeCov # Upload the Kover report to CodeCov
- name: Upload Code Coverage Report - name: Upload Code Coverage Report
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
files: ${{ github.workspace }}/build/reports/kover/xml/report.xml files: ${{ github.workspace }}/build/reports/kover/report.xml
# Run Qodana inspections and provide report
inspectCode:
name: Inspect code
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2023.2.1
with:
cache-default-branch-only: true
# Run plugin structure verification along with IntelliJ Plugin Verifier
verify:
name: Verify plugin
needs: [ build ]
runs-on: ubuntu-latest
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# Cache Plugin Verifier IDEs # Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache - name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
# Run Verify Plugin task and IntelliJ Plugin Verifier tool # Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks - name: Run Plugin Verification tasks
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
# Collect Plugin Verifier Result # Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result - name: Collect Plugin Verifier Result
@ -112,34 +220,12 @@ jobs:
name: pluginVerifier-result name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier path: ${{ github.workspace }}/build/reports/pluginVerifier
# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2022.2.3
# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "::set-output name=filename::${FILENAME:0:-4}"
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
# Prepare a draft release for GitHub Releases page for the manual verification # Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered # If accepted and published, release workflow would be triggered
releaseDraft: releaseDraft:
name: Release Draft name: Release draft
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
needs: build needs: [ build, test, inspectCode, verify ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
@ -149,7 +235,14 @@ jobs:
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v3
# Remove old release drafts by using the curl request for the available releases with draft flag # Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
# Remove old release drafts by using the curl request for the available releases with a draft flag
- name: Remove Old Release Drafts - name: Remove Old Release Drafts
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -158,7 +251,7 @@ jobs:
--jq '.[] | select(.draft == true) | .id' \ --jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
# Create new release draft - which is not publicly visible and requires manual acceptance # Create a new release draft which is not publicly visible and requires manual acceptance
- name: Create Release Draft - name: Create Release Draft
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,5 +1,6 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared # GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided. # Running the publishPlugin task requires all following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.
name: Release name: Release
on: on:
@ -8,7 +9,7 @@ on:
jobs: jobs:
# Prepare and publish the plugin to the Marketplace repository # Prepare and publish the plugin to JetBrains Marketplace repository
release: release:
name: Publish Plugin name: Publish Plugin
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -23,12 +24,18 @@ jobs:
with: with:
ref: ${{ github.event.release.tag_name }} ref: ${{ github.event.release.tag_name }}
# Setup Java 11 environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: zulu distribution: zulu
java-version: 11 java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# Set environment variables # Set environment variables
- name: Export Properties - name: Export Properties
@ -40,11 +47,9 @@ jobs:
EOM EOM
)" )"
CHANGELOG="${CHANGELOG//'%'/'%25'}" echo "changelog<<EOF" >> $GITHUB_OUTPUT
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" echo "$CHANGELOG" >> $GITHUB_OUTPUT
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" echo "EOF" >> $GITHUB_OUTPUT
echo "::set-output name=changelog::$CHANGELOG"
# Update Unreleased section with the current release note # Update Unreleased section with the current release note
- name: Patch Changelog - name: Patch Changelog
@ -54,7 +59,7 @@ jobs:
run: | run: |
./gradlew patchChangelog --release-note="$CHANGELOG" ./gradlew patchChangelog --release-note="$CHANGELOG"
# Publish the plugin to the Marketplace # Publish the plugin to JetBrains Marketplace
- name: Publish Plugin - name: Publish Plugin
env: env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
@ -69,7 +74,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
# Create pull request # Create a pull request
- name: Create Pull Request - name: Create Pull Request
if: ${{ steps.properties.outputs.changelog != '' }} if: ${{ steps.properties.outputs.changelog != '' }}
env: env:
@ -88,6 +93,7 @@ jobs:
gh label create "$LABEL" \ gh label create "$LABEL" \
--description "Pull requests with release changelog update" \ --description "Pull requests with release changelog update" \
--force \
|| true || true
gh pr create \ gh pr create \

View File

@ -1,9 +1,9 @@
# GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps: # GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps:
# - prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with UI # - Prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with the UI.
# - wait for IDE to start # - Wait for IDE to start.
# - run UI tests with separate Gradle task # - Run UI tests with a separate Gradle task.
# #
# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform # Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform.
# #
# Workflow is triggered manually. # Workflow is triggered manually.
@ -35,12 +35,18 @@ jobs:
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v3
# Setup Java 11 environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: zulu distribution: zulu
java-version: 11 java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
# Run IDEA prepared for UI testing # Run IDEA prepared for UI testing
- name: Run IDE - name: Run IDE

View File

@ -5,18 +5,21 @@
<option name="executionName" /> <option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" /> <option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="runIdeForUiTests" /> <option name="scriptParameters" value="" />
<option name="taskDescriptions"> <option name="taskDescriptions">
<list /> <list />
</option> </option>
<option name="taskNames"> <option name="taskNames">
<list /> <list>
<option value="runIdeForUiTests" />
</list>
</option> </option>
<option name="vmOptions" /> <option name="vmOptions" />
</ExternalSystemSettings> </ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled> <DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
</component> </component>

View File

@ -9,18 +9,22 @@
<option name="executionName" /> <option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" /> <option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="cleanInspections runInspections" /> <option name="scriptParameters" value="" />
<option name="taskDescriptions"> <option name="taskDescriptions">
<list /> <list />
</option> </option>
<option name="taskNames"> <option name="taskNames">
<list /> <list>
<option value="cleanInspections" />
<option value="runInspections" />
</list>
</option> </option>
<option name="vmOptions" /> <option name="vmOptions" />
</ExternalSystemSettings> </ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled> <DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
</component> </component>

View File

@ -11,7 +11,7 @@
</option> </option>
<option name="taskNames"> <option name="taskNames">
<list> <list>
<option value="test" /> <option value="check" />
</list> </list>
</option> </option>
<option name="vmOptions" value="" /> <option name="vmOptions" value="" />

View File

@ -4,6 +4,9 @@
## [Unreleased] ## [Unreleased]
### Added
- Support for all 2023.2 builds (232.*)
## [4.4.1] - 2023-02-19 ## [4.4.1] - 2023-02-19
### Changed ### Changed

View File

@ -1,101 +1,105 @@
import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML import org.jetbrains.changelog.markdownToHTML
fun properties(key: String) = project.findProperty(key).toString() fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins { plugins {
// Java support id("java") // Java support
id("java") alias(libs.plugins.kotlin) // Kotlin support
// Kotlin support alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
id("org.jetbrains.kotlin.jvm") version "1.7.21" alias(libs.plugins.changelog) // Gradle Changelog Plugin
// Gradle IntelliJ Plugin alias(libs.plugins.qodana) // Gradle Qodana Plugin
id("org.jetbrains.intellij") version "1.13.0" alias(libs.plugins.kover) // Gradle Kover Plugin
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "2.0.0"
// Gradle Qodana Plugin
id("org.jetbrains.qodana") version "0.1.13"
// Gradle Kover Plugin
id("org.jetbrains.kotlinx.kover") version "0.6.1"
} }
group = properties("pluginGroup") group = properties("pluginGroup").get()
version = properties("pluginVersion") version = properties("pluginVersion").get()
// Configure project's dependencies // Configure project's dependencies
repositories { repositories {
mavenCentral() mavenCentral()
} }
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies { dependencies {
implementation("de.marhali:json5-java:2.0.0") // implementation(libs.annotations)
implementation(libs.json5.java)
} }
// Set the JVM language level used to build project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+. // Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin { kotlin {
jvmToolchain(17) jvmToolchain(17)
} }
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html // Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij { intellij {
pluginName.set(properties("pluginName")) pluginName = properties("pluginName")
version.set(properties("platformVersion")) version = properties("platformVersion")
type.set(properties("platformType")) type = properties("platformType")
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
} }
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog { changelog {
groups.set(emptyList()) groups.empty()
repositoryUrl.set(properties("pluginRepositoryUrl")) repositoryUrl = properties("pluginRepositoryUrl")
} }
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin // Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana { qodana {
cachePath.set(file(".qodana").canonicalPath) cachePath = provider { file(".qodana").canonicalPath }
reportPath.set(file("build/reports/inspections").canonicalPath) reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport.set(true) saveReport = true
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false) showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
} }
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration // Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover.xmlReport { koverReport {
onCheck.set(true) defaults {
xml {
onCheck = true
}
}
} }
tasks { tasks {
wrapper { wrapper {
gradleVersion = properties("gradleVersion") gradleVersion = properties("gradleVersion").get()
} }
patchPluginXml { patchPluginXml {
version.set(properties("pluginVersion")) version = properties("pluginVersion")
sinceBuild.set(properties("pluginSinceBuild")) sinceBuild = properties("pluginSinceBuild")
untilBuild.set(properties("pluginUntilBuild")) untilBuild = properties("pluginUntilBuild")
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set( pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
file("README.md").readText().lines().run {
val start = "<!-- Plugin description -->" val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->" val end = "<!-- Plugin description end -->"
with (it.lines()) {
if (!containsAll(listOf(start, end))) { if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end") throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
} }
subList(indexOf(start) + 1, indexOf(end)) subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}.joinToString("\n").let { markdownToHTML(it) } }
) }
val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file // Get the latest available change notes from the changelog file
changeNotes.set(provider { changeNotes = properties("pluginVersion").map { pluginVersion ->
with(changelog) { with(changelog) {
renderItem( renderItem(
getOrNull(properties("pluginVersion")) ?: getLatest(), (getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML, Changelog.OutputType.HTML,
) )
} }
}) }
} }
// Configure UI tests plugin // Configure UI tests plugin
@ -108,17 +112,17 @@ tasks {
} }
signPlugin { signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) certificateChain = environment("CERTIFICATE_CHAIN")
privateKey.set(System.getenv("PRIVATE_KEY")) privateKey = environment("PRIVATE_KEY")
password.set(System.getenv("PRIVATE_KEY_PASSWORD")) password = environment("PRIVATE_KEY_PASSWORD")
} }
publishPlugin { publishPlugin {
dependsOn("patchChangelog") dependsOn("patchChangelog")
token.set(System.getenv("PUBLISH_TOKEN")) token = environment("PUBLISH_TOKEN")
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())) channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
} }
} }

View File

@ -2,28 +2,33 @@
pluginGroup = de.marhali.easyi18n pluginGroup = de.marhali.easyi18n
pluginName = easy-i18n pluginName = easy-i18n
pluginRepositoryUrl = https://github.com/marhali/easy-i18n
# SemVer format -> https://semver.org # SemVer format -> https://semver.org
pluginVersion = 4.4.1 pluginVersion = 4.4.1
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 223 pluginSinceBuild = 223
pluginUntilBuild = 231.* pluginUntilBuild = 232.*
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IU platformType = IU
platformVersion = 2022.3 platformVersion = 2023.2.1
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = org.jetbrains.kotlin, JavaScript, com.jetbrains.php:223.7571.182 platformPlugins = org.jetbrains.kotlin, JavaScript, com.jetbrains.php:232.9559.64
# Gradle Releases -> https://github.com/gradle/gradle/releases # Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.5.1 gradleVersion = 8.3
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency = false kotlin.stdlib.default.dependency = false
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html # Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.unsafe.configuration-cache = true org.gradle.configuration-cache = true
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
systemProp.org.gradle.unsafe.kotlin.assignment = true

22
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,22 @@
[versions]
# libraries
annotations = "24.0.1"
json5-java = "2.0.0"
# plugins
kotlin = "1.9.0"
changelog = "2.1.2"
gradleIntelliJPlugin = "1.15.0"
qodana = "0.1.13"
kover = "0.7.3"
[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
json5-java = { group = "de.marhali", name = "json5-java", version.ref = "json5-java" }
[plugins]
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }

Binary file not shown.

View File

@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

25
gradlew vendored
View File

@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -80,13 +80,11 @@ do
esac esac
done done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # This is normally unused
# shellcheck disable=SC2034
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -133,22 +131,29 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
case $MAX_FD in #( case $MAX_FD in #(
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done done
fi fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in # shell script including quotes and variable substitutions, so put them in

1
gradlew.bat vendored
View File

@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%

View File

@ -2,6 +2,8 @@
# https://www.jetbrains.com/help/qodana/qodana-yaml.html # https://www.jetbrains.com/help/qodana/qodana-yaml.html
version: 1.0 version: 1.0
linter: jetbrains/qodana-jvm-community:latest
projectJDK: 17
profile: profile:
name: qodana.recommended name: qodana.recommended
exclude: exclude:

View File

@ -1 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0"
}
rootProject.name = "easy-i18n" rootProject.name = "easy-i18n"