diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b23f809c..38a3f446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,44 +27,43 @@ 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 }} changelog: ${{ steps.properties.outputs.changelog }} 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 - name: Fetch Sources uses: actions/checkout@v3 # 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 + with: + distribution: zulu + java-version: 17 - name: Cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }} restore-keys: | ${{ runner.os }}-pip- - - name: Cache - uses: actions/cache@v3.0.7 - 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 @@ -77,19 +76,29 @@ 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 - name: Run Tests run: ./gradlew test jacocoTestReport --info + # Collect Tests Result of failed tests + - name: Collect Tests Result + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: tests-result + path: ${{ github.workspace }}/build/reports/tests + # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3 with: path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} @@ -118,6 +127,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 @@ -156,6 +166,8 @@ jobs: if: github.event_name != 'pull_request' needs: build runs-on: ubuntu-latest + permissions: + contents: write steps: # Check out current repository @@ -170,6 +182,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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 879d5f37..e4413406 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,9 @@ jobs: release: name: Publish Plugin runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: # Check out current repository @@ -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 @@ -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 \ No newline at end of file + --head $BRANCH diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 29db9bf6..2dc4c6c4 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a528321..05af6c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog ## [Unreleased] +- Support IntelliJ IDEA 2022.3 [[#519](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/519)] ## [0.3.13] -### Features +### Features - Support IntelliJ IDEA 2022.2.2 [[#517](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/517)] ## 0.3.12 diff --git a/build.gradle.kts b/build.gradle.kts index 57bd2bdf..2f0c303e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { // Kotlin support kotlin("jvm") version "1.7.10" // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.8.0" + id("org.jetbrains.intellij") version "1.9.0" // Gradle Changelog Plugin id("org.jetbrains.changelog") version "1.3.1" // Gradle Qodana Plugin @@ -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)) } @@ -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")) diff --git a/gradle.properties b/gradle.properties index 3c5ba9d8..102e6795 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,32 +1,26 @@ -# 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 +pluginVersion = 0.3.14 -# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html -# for insight into build numbers and IntelliJ Platform versions. -pluginSinceBuild = 222.3345.99 -pluginUntilBuild = 222.* +# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +pluginSinceBuild = 222 +pluginUntilBuild = 223.* -# 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 = PC -platformVersion = 222.3345-EAP-CANDIDATE-SNAPSHOT +platformVersion = 2022.2.1 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # 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 +gradleVersion = 7.5.1 -# 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 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f..249e5832 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8049c684..ae04661e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index c53aefaa..a69d9cb6 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f9..53a6b238 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle.kts b/settings.gradle.kts index c86defb5..51a6f2de 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "pydantic-pycharm-plugin" \ No newline at end of file +rootProject.name = "pydantic-pycharm-plugin"