Skip to content

Commit 206b04b

Browse files
committed
update gradle build
1 parent 3678244 commit 206b04b

File tree

8 files changed

+313
-189
lines changed

8 files changed

+313
-189
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v2
1818

19-
- name: Set up JDK 11
19+
- name: Set up JDK 17
2020
uses: actions/setup-java@v2
2121
with:
22-
java-version: '11'
22+
java-version: '17'
2323
distribution: 'adopt'
2424

2525
# Cache Gradle dependencies
@@ -36,12 +36,6 @@ jobs:
3636
path: ~/.gradle/wrapper
3737
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
3838

39-
- name: setting env vars
40-
run: echo "Main version ${ORG_GRADLE_PROJECT_ideaVersion}"
41-
env:
42-
ORG_GRADLE_PROJECT_ideaVersion: "IU-2021.1"
43-
ORG_GRADLE_PROJECT_phpPluginVersion: "211.6693.120"
44-
4539
- name: Grant execute permission for gradlew
4640
run: chmod +x gradlew
4741

build.gradle

Lines changed: 0 additions & 51 deletions
This file was deleted.

build.gradle.kts

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
fun properties(key: String) = project.findProperty(key).toString()
4+
5+
plugins {
6+
// Java support
7+
id("java")
8+
// Kotlin support
9+
id("org.jetbrains.kotlin.jvm") version "1.6.20"
10+
// Gradle IntelliJ Plugin
11+
id("org.jetbrains.intellij") version "1.13.0"
12+
// Gradle Changelog Plugin
13+
id("org.jetbrains.changelog") version "1.3.1"
14+
// Gradle Qodana Plugin
15+
id("org.jetbrains.qodana") version "0.1.13"
16+
}
17+
18+
group = properties("pluginGroup")
19+
version = properties("pluginVersion")
20+
21+
// Configure project's dependencies
22+
repositories {
23+
mavenCentral()
24+
}
25+
26+
dependencies {
27+
implementation("org.junit.jupiter:junit-jupiter:5.8.2")
28+
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
29+
}
30+
31+
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
32+
intellij {
33+
pluginName.set(properties("pluginName"))
34+
version.set(properties("platformVersion"))
35+
type.set(properties("platformType"))
36+
37+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
38+
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
39+
}
40+
41+
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
42+
changelog {
43+
version.set(properties("pluginVersion"))
44+
groups.set(emptyList())
45+
}
46+
47+
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
48+
qodana {
49+
cachePath.set(projectDir.resolve(".qodana").canonicalPath)
50+
reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
51+
saveReport.set(true)
52+
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
53+
}
54+
55+
tasks {
56+
// Set the JVM compatibility versions
57+
properties("javaVersion").let {
58+
withType<JavaCompile> {
59+
sourceCompatibility = it
60+
targetCompatibility = it
61+
}
62+
withType<KotlinCompile> {
63+
kotlinOptions.jvmTarget = it
64+
}
65+
}
66+
67+
wrapper {
68+
gradleVersion = properties("gradleVersion")
69+
}
70+
71+
patchPluginXml {
72+
version.set(properties("pluginVersion"))
73+
sinceBuild.set(properties("pluginSinceBuild"))
74+
untilBuild.set(properties("pluginUntilBuild"))
75+
changeNotes.set(file("src/main/resources/META-INF/change-notes.html").readText().replace("<html>", "").replace("</html>", ""));
76+
77+
// Get the latest available change notes from the changelog file
78+
// changeNotes.set(provider {
79+
// changelog.run {
80+
// getOrNull(properties("pluginVersion")) ?: getLatest()
81+
// }.toHTML()
82+
// })
83+
}
84+
85+
// Configure UI tests plugin
86+
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
87+
runIdeForUiTests {
88+
systemProperty("robot-server.port", "8082")
89+
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
90+
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
91+
systemProperty("jb.consents.confirmation.enabled", "false")
92+
}
93+
94+
signPlugin {
95+
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
96+
privateKey.set(System.getenv("PRIVATE_KEY"))
97+
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
98+
}
99+
100+
publishPlugin {
101+
// dependsOn("patchChangelog")
102+
token.set(System.getenv("PUBLISH_TOKEN"))
103+
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
104+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
105+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
106+
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
107+
}
108+
109+
test {
110+
// Support "setUp" like "BasePlatformTestCase::setUp" as valid test structure
111+
useJUnitPlatform {
112+
includeEngines("junit-vintage")
113+
}
114+
}
115+
}

gradle.properties

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1-
ideaVersion = IU-2021.1
2-
phpPluginVersion = 211.6693.120
1+
# IntelliJ Platform Artifacts Repositories
2+
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
3+
4+
pluginGroup = de.espend.idea.php.phpunit
5+
pluginName = PHPUnit Enhancement
6+
7+
# SemVer format -> https://semver.org
8+
pluginVersion = 6.2
9+
10+
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
11+
# for insight into build numbers and IntelliJ Platform versions.
12+
# we are able to support a minimum version having at least "TwigElementTypes.ARRAY_LITERAL"
13+
pluginSinceBuild = 223
14+
pluginUntilBuild =
15+
16+
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
17+
platformType = IU
18+
platformVersion = 2022.3.2
19+
20+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
21+
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
22+
platformPlugins = java,yaml,xpath,webDeployment,com.jetbrains.php:223.8617.59
23+
24+
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
25+
javaVersion = 17
26+
27+
# Gradle Releases -> https://github.com/gradle/gradle/releases
28+
gradleVersion = 7.6
29+
30+
# Opt-out flag for bundling Kotlin standard library.
31+
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
32+
# suppress inspection "UnusedProperty"
33+
kotlin.stdlib.default.dependency = false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)