Skip to content

Commit

Permalink
buildable PhpStorm 2023.1.1 plugin version (#1883)
Browse files Browse the repository at this point in the history
* cumulative patch for removing deprecated apis usage

* update build infrastructure including github actions

* fix api usage in PhpCodeInsightFixtureTestCase

* 2023.1.1 build

---------

Co-authored-by: Denis Ryabov <dryabov@yandex.ru>
  • Loading branch information
Haehnchen and dryabov committed May 10, 2023
1 parent 9bd5262 commit b342748
Show file tree
Hide file tree
Showing 18 changed files with 518 additions and 412 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ master, update_deprecated_apis ]
pull_request:
branches: [ master, update_deprecated_apis ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-v2-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}

# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-v2-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: export PHPSTORM_ENV=skip && ./gradlew check verifyPlugin buildPlugin
34 changes: 2 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,8 @@ notifications:

matrix:
include:
- env: IDEA_VERSION="IU-2021.2.3" PHP_PLUGIN_VERSION="212.5457.49"
jdk: oraclejdk11
- env: IDEA_VERSION="IU-2021.1.3" PHP_PLUGIN_VERSION="211.7442.50"
jdk: oraclejdk11
- env: IDEA_VERSION="IU-2020.3.4" PHP_PLUGIN_VERSION="203.5981.175"
jdk: oraclejdk11
- env: IDEA_VERSION="IU-2020.2.4" PHP_PLUGIN_VERSION="202.8194.11"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2020.1.4" PHP_PLUGIN_VERSION="201.8743.1"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2019.3.4" PHP_PLUGIN_VERSION="193.6911.15"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2019.2.4" PHP_PLUGIN_VERSION="192.7142.51"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2019.1.4" PHP_PLUGIN_VERSION="191.8026.56"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2018.3.6" PHP_PLUGIN_VERSION="183.5429.47"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2018.2.8" PHP_PLUGIN_VERSION="182.4892.16"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2018.1.8" PHP_PLUGIN_VERSION="181.5281.35"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2017.3.6" PHP_PLUGIN_VERSION="173.4674.46"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2017.2.7" PHP_PLUGIN_VERSION="172.4155.41"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2017.1.6" PHP_PLUGIN_VERSION="171.4694.2"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2016.3.8" PHP_PLUGIN_VERSION="163.10504.2"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2016.2.5" PHP_PLUGIN_VERSION="162.1628.23"
jdk: oraclejdk8
- env: IDEA_VERSION="IU-2023.1" PHP_PLUGIN_VERSION="223.8836.39"
jdk: oraclejdk17

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand Down
79 changes: 0 additions & 79 deletions build.gradle

This file was deleted.

115 changes: 115 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

fun properties(key: String) = project.findProperty(key).toString()

plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.8.10"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.13.0"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "1.3.1"
// Gradle Qodana Plugin
id("org.jetbrains.qodana") version "0.1.13"
}

group = properties("pluginGroup")
version = properties("pluginVersion")

// Configure project's dependencies
repositories {
mavenCentral()
}

dependencies {
implementation("org.junit.jupiter:junit-jupiter:5.8.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
}

// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
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))
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version.set(properties("pluginVersion"))
groups.set(emptyList())
}

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath.set(projectDir.resolve(".qodana").canonicalPath)
reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
saveReport.set(true)
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
}

tasks {
// Set the JVM compatibility versions
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = it
}
}

wrapper {
gradleVersion = properties("gradleVersion")
}

patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
changeNotes.set(file("src/main/resources/META-INF/change-notes.html").readText().replace("<html>", "").replace("</html>", ""))

// Get the latest available change notes from the changelog file
// changeNotes.set(provider {
// changelog.run {
// getOrNull(properties("pluginVersion")) ?: getLatest()
// }.toHTML()
// })
}

// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
}

signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}

publishPlugin {
// dependsOn("patchChangelog")
token.set(System.getenv("PUBLISH_TOKEN"))
// 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:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
}

test {
// Support "setUp" like "BasePlatformTestCase::setUp" as valid test structure
useJUnitPlatform {
includeEngines("junit-vintage")
}
}
}
37 changes: 32 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
javaVersion = JavaVersion.VERSION_1_8
javaTargetVersion = JavaVersion.VERSION_1_8
buildNumber = SNAPSHOT
# IntelliJ Platform Artifacts Repositories
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

ideaVersion = IU-2016.2.5
phpPluginVersion = 162.1628.23
pluginGroup = com.kalessil.phpStorm.phpInspectionsEA
pluginName = Php Inspections (EA Extended)

# SemVer format -> https://semver.org
pluginVersion = 5.0.0.0

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
# we are able to support a minimum version having at least "TwigElementTypes.ARRAY_LITERAL"
pluginSinceBuild = 223.6160.11
pluginUntilBuild =

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IU
platformVersion = 2023.1.1

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = java,yaml,xpath,webDeployment,JavaScript,com.jetbrains.php:231.8770.68

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

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

# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency = false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Jun 21 19:41:57 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip

0 comments on commit b342748

Please sign in to comment.