Skip to content

Commit

Permalink
Update Java to 17
Browse files Browse the repository at this point in the history
And other misc changes from the plugin template
  • Loading branch information
KotlinIsland committed Jul 28, 2022
1 parent 89ed9e1 commit ea97266
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 39 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
# Build plugin and provide the artifact for the next workflow jobs
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
Expand All @@ -39,7 +40,14 @@ jobs:

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v1.0.4

# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.4.1
with:
distribution: zulu
java-version: 17

- name: Cache
uses: actions/cache@v3.0.1
Expand All @@ -49,22 +57,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Cache
uses: actions/cache@v3.0.1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.4.1
with:
distribution: zulu
java-version: 11
cache: gradle

# Set environment variables
- name: Export Properties
id: properties
Expand All @@ -77,10 +69,12 @@ jobs:
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Run tests
Expand Down Expand Up @@ -118,6 +112,7 @@ jobs:
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
Expand Down Expand Up @@ -156,6 +151,8 @@ jobs:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:

# Check out current repository
Expand All @@ -170,6 +167,7 @@ jobs:
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
release:
name: Publish Plugin
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:

# Check out current repository
Expand All @@ -20,13 +23,12 @@ jobs:
with:
ref: ${{ github.event.release.tag_name }}

# Setup Java 11 environment for the next steps
# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.4.1
with:
distribution: zulu
java-version: 11
cache: gradle
java-version: 17

# Set environment variables
- name: Export Properties
Expand Down Expand Up @@ -84,4 +86,4 @@ jobs:
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--base master \
--head $BRANCH
--head $BRANCH
5 changes: 2 additions & 3 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ jobs:
- name: Fetch Sources
uses: actions/checkout@v3

# Setup Java 11 environment for the next steps
# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.4.1
with:
distribution: zulu
java-version: 11
cache: gradle
java-version: 17

# Run IDEA prepared for UI testing
- name: Run IDE
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ repositories {
mavenCentral()
}

// Set the JVM language level used to compile sources and generate files - Java 17 is required since 2022.2
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(properties("javaVersion")))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}

Expand All @@ -55,9 +57,7 @@ tasks {
wrapper {
gradleVersion = properties("gradleVersion")
}
runPluginVerifier {
ideVersions.add("PCC-222.3345.99")
}

patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
Expand Down
14 changes: 4 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# IntelliJ Platform Artifacts Repositories
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.koxudaxi.pydantic
pluginName = Pydantic
# SemVer format -> https://semver.org
pluginVersion = 0.3.13

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 222.3345.99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 222
pluginUntilBuild = 222.*

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
Expand All @@ -19,14 +17,10 @@ platformVersion = 222.3345-EAP-CANDIDATE-SNAPSHOT
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = python-ce

# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
javaVersion = 11

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.5

# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency = false

Expand Down

0 comments on commit ea97266

Please sign in to comment.