Skip to content

Commit af18828

Browse files
committed
Merge branch 'master' into release
2 parents 4f0b320 + df7922e commit af18828

File tree

61 files changed

+4430
-5187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4430
-5187
lines changed

.github/workflows/ci_checks.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ jobs:
3636
check-latest: true
3737
cache: yarn
3838
- run: yarn install --immutable
39+
- name: Gradle Wrapper Validation
40+
uses: gradle/wrapper-validation-action@v3
41+
- name: Setup Java
42+
uses: actions/setup-java@v3
43+
with:
44+
distribution: zulu
45+
java-version: 17
46+
cache: gradle
3947
- name: Workspace Lint
4048
run: |
41-
npx nx-cloud record -- npx nx format:check
49+
npx nx-cloud record -- ./gradlew projectReportAll
50+
npx nx-cloud record -- npx nx show projects --verbose
51+
npx nx-cloud record -- npx nx format:check --verbose --skip-nx-cache
4252
npx nx-cloud record -- ./gradlew ktfmtCheck
4353
env:
4454
NX_CLOUD_DISTRIBUTED_EXECUTION: false

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Thumbs.db
5959
.gradle
6060
.qodana
6161
apps/intellij/bin/
62+
.intellijPlatform
63+
6264

6365
# WDIO
6466
**/.wdio-vscode-service
@@ -70,4 +72,4 @@ apps/vscode-e2e/.screenshots
7072
.nx/cache
7173
.nx/workspace-data
7274
**/cypress/downloads
73-
migrations.json
75+
migrations.json

.storybook/main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
module.exports = {
2-
addons: ['@storybook/addon-knobs', '@storybook/addon-mdx-gfm'],
2+
addons: [
3+
'@storybook/addon-knobs',
4+
'@storybook/addon-mdx-gfm',
5+
'@chromatic-com/storybook',
6+
],
37
framework: {
48
name: '@storybook/angular',
59
options: {},

apps/intellij/build.gradle.kts

+128-112
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
3+
import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
4+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
35

46
fun isWindows(): Boolean {
57
return System.getProperty("os.name").lowercase().startsWith("windows")
68
}
79

810
val nxlsRoot = "${rootDir}/dist/apps/nxls"
911

10-
buildDir = file("${rootDir}/dist/apps/intellij")
11-
12-
fun properties(key: String) = project.findProperty(key).toString()
12+
layout.buildDirectory = file("${rootDir}/dist/apps/intellij")
1313

1414
plugins {
1515
// Java support
1616
id("java")
1717
// Kotlin support
18-
id("org.jetbrains.kotlin.jvm") version "1.9.22"
18+
id("org.jetbrains.kotlin.jvm") version "2.0.20"
1919
// Kotlin serialization
20-
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.22"
21-
// Gradle IntelliJ Plugin
22-
id("org.jetbrains.intellij") version "1.17.2"
20+
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20"
21+
// Gradle IntelliJ Platform Plugin
22+
id("org.jetbrains.intellij.platform") version "2.0.1"
2323

2424
// Gradle Changelog Plugin
2525
id("org.jetbrains.changelog") version "2.0.0"
@@ -31,10 +31,16 @@ plugins {
3131
id("com.ncorti.ktfmt.gradle") version "0.11.0"
3232
}
3333

34-
group = properties("pluginGroup")
34+
group = providers.gradleProperty("pluginGroup").get()
35+
36+
version = providers.gradleProperty("version").get()
3537

3638
// Configure project's dependencies
37-
repositories { mavenCentral() }
39+
repositories {
40+
mavenCentral()
41+
42+
intellijPlatform { defaultRepositories() }
43+
}
3844

3945
configurations.all {
4046
exclude("org.slf4j", "slf4j-api")
@@ -46,42 +52,131 @@ configurations.all {
4652
}
4753

4854
dependencies {
49-
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:0.21.0")
55+
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:0.23.1")
5056

51-
val ktorVersion = "2.3.8"
57+
val ktorVersion = "2.3.12"
5258
implementation("io.ktor:ktor-client-core:$ktorVersion")
5359
implementation("io.ktor:ktor-client-cio:$ktorVersion")
5460
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
5561
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
5662
implementation("io.ktor:ktor-client-logging:$ktorVersion")
5763

58-
implementation("io.github.z4kn4fein:semver:1.4.2")
64+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
65+
66+
implementation("io.github.z4kn4fein:semver:2.0.0")
67+
68+
implementation("io.github.nsk90:kstatemachine:0.31.0")
69+
implementation("io.github.nsk90:kstatemachine-coroutines:0.31.0")
70+
71+
intellijPlatform {
72+
intellijIdeaUltimate(providers.gradleProperty("platformVersion"))
73+
74+
bundledPlugins(
75+
providers.gradleProperty("platformPlugins").map { plugins ->
76+
plugins.split(',').map(String::trim).filter(String::isNotEmpty)
77+
}
78+
)
79+
pluginVerifier()
80+
zipSigner()
81+
instrumentationTools()
82+
}
5983
}
6084

6185
ktfmt { kotlinLangStyle() }
6286

63-
// Set the JVM language level used to build project. Use Java 11 for 2020.3+, and Java 17 for
64-
// 2022.2+.
6587
kotlin { jvmToolchain(17) }
6688

67-
// Configure Gradle IntelliJ Plugin - read more:
68-
// https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
69-
intellij {
70-
pluginName.set(properties("pluginName"))
71-
version.set(properties("platformVersion"))
72-
type.set(properties("platformType"))
73-
74-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
75-
plugins.set(
76-
properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)
77-
)
89+
intellijPlatform {
90+
projectName = providers.gradleProperty("pluginName").get()
91+
92+
pluginConfiguration {
93+
version = providers.gradleProperty("version").get()
94+
ideaVersion {
95+
sinceBuild = providers.gradleProperty("pluginSinceBuild").get()
96+
untilBuild = providers.gradleProperty("pluginUntilBuild").get()
97+
}
98+
description =
99+
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
100+
val start = "<!-- Plugin description -->"
101+
val end = "<!-- Plugin description end -->"
102+
103+
with(it.lines()) {
104+
if (!containsAll(listOf(start, end))) {
105+
throw GradleException(
106+
"Plugin description section not found in README.md:\n$start ... $end"
107+
)
108+
}
109+
subList(indexOf(start) + 1, indexOf(end))
110+
.joinToString("\n")
111+
.let(::markdownToHTML)
112+
}
113+
}
114+
115+
val changelog = project.changelog // local variable for configuration cache compatibility
116+
// Get the latest available change notes from the changelog file
117+
changeNotes =
118+
providers.gradleProperty("version").map { pluginVersion ->
119+
with(changelog) {
120+
renderItem(
121+
(getOrNull(pluginVersion) ?: getUnreleased())
122+
.withHeader(false)
123+
.withEmptySections(false),
124+
Changelog.OutputType.HTML,
125+
)
126+
}
127+
}
128+
}
129+
signing {
130+
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
131+
privateKey.set(System.getenv("PRIVATE_KEY"))
132+
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
133+
}
134+
publishing {
135+
token.set(System.getenv("PUBLISH_TOKEN"))
136+
// version is based on the SemVer (https://semver.org) and supports pre-release
137+
// labels, like 2.1.7-alpha.3
138+
// Specify pre-release label to publish the plugin in a custom Release Channel
139+
// automatically. Read more:
140+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
141+
// val channel: String =
142+
// properties("pluginVersion").split('-').getOrElse(1) { "default"
143+
// }.split('.').first()
144+
// channels.set(listOf(channel))
145+
}
146+
pluginVerification { ides { recommended() } }
147+
}
148+
149+
intellijPlatformTesting {
150+
runIde {
151+
create("runIntelliJLatest") {
152+
version = "243.12818.47"
153+
prepareSandboxTask {
154+
from(nxlsRoot) {
155+
include("**/*.js")
156+
include("**/package.json")
157+
include("**/*.map")
158+
into(intellijPlatform.projectName.map { "$it/nxls" }.get())
159+
}
160+
doLast {
161+
exec {
162+
workingDir =
163+
File(
164+
destinationDir,
165+
intellijPlatform.projectName.map { "$it/nxls" }.get(),
166+
)
167+
commandLine = buildCommands() + "npm install --force"
168+
}
169+
}
170+
}
171+
}
172+
}
78173
}
79174

80175
// Configure Gradle Changelog Plugin - read more:
81176
// https://github.com/JetBrains/gradle-changelog-plugin
82177
changelog {
83178
groups.set(emptyList())
84-
repositoryUrl.set(properties("pluginRepositoryUrl"))
179+
repositoryUrl.set(providers.gradleProperty("pluginRepositoryUrl").get())
85180
}
86181

87182
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
@@ -96,7 +191,7 @@ qodana {
96191
kover.xmlReport { onCheck.set(true) }
97192

98193
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
99-
kotlinOptions { jvmTarget = "17" }
194+
compilerOptions { jvmTarget.set(JvmTarget.JVM_17) }
100195
}
101196

102197
tasks {
@@ -107,110 +202,31 @@ tasks {
107202
include("**/*.js")
108203
include("**/package.json")
109204
include("**/*.map")
110-
into("${rootProject.name}/nxls")
205+
into(intellijPlatform.projectName.map { "$it/nxls" }.get())
111206
}
112-
113207
doLast {
114208
exec {
115-
logger.warn("rootproject ${rootProject.name}")
116-
logger.warn("Working dir: $workingDir")
117-
logger.warn("Working dir: $destinationDir")
118-
119209
workingDir =
120-
File(
121-
destinationDir,
122-
rootProject.name + "/nxls",
123-
)
210+
File(destinationDir, intellijPlatform.projectName.map { "$it/nxls" }.get())
124211
commandLine = buildCommands() + "npm install --force"
125212
}
126213
}
127214
}
128215

129-
patchPluginXml {
130-
version.set(properties("version"))
131-
sinceBuild.set(properties("pluginSinceBuild"))
132-
untilBuild.set(properties("pluginUntilBuild"))
133-
134-
// Extract the <!-- Plugin description --> section from README.md and provide for the
135-
// plugin's manifest
136-
pluginDescription.set(
137-
file("README.md")
138-
.readText()
139-
.lines()
140-
.run {
141-
val start = "<!-- Plugin description -->"
142-
val end = "<!-- Plugin description end -->"
143-
144-
if (!containsAll(listOf(start, end))) {
145-
throw GradleException(
146-
"Plugin description section not found in README.md:\n$start ... $end"
147-
)
148-
}
149-
subList(indexOf(start) + 1, indexOf(end))
150-
}
151-
.joinToString("\n")
152-
.let { markdownToHTML(it) }
153-
)
154-
155-
// Get the latest available change notes from the changelog file
156-
changeNotes.set(
157-
provider {
158-
with(changelog) {
159-
renderItem(
160-
getOrNull(properties("version")) ?: getLatest(),
161-
Changelog.OutputType.HTML,
162-
)
163-
}
164-
}
165-
)
166-
}
167-
168-
// Configure UI tests plugin
169-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
170-
runIdeForUiTests {
171-
systemProperty("robot-server.port", "8082")
172-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
173-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
174-
systemProperty("jb.consents.confirmation.enabled", "false")
175-
}
176-
177-
runIde { maxHeapSize = "6g" }
178-
179-
signPlugin {
180-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
181-
privateKey.set(System.getenv("PRIVATE_KEY"))
182-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
183-
}
184-
185-
publishPlugin {
186-
dependsOn("patchChangelog")
187-
token.set(System.getenv("PUBLISH_TOKEN"))
188-
// version is based on the SemVer (https://semver.org) and supports pre-release
189-
// labels, like 2.1.7-alpha.3
190-
// Specify pre-release label to publish the plugin in a custom Release Channel
191-
// automatically. Read more:
192-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
193-
// val channel: String =
194-
// properties("pluginVersion").split('-').getOrElse(1) { "default"
195-
// }.split('.').first()
196-
// channels.set(listOf(channel))
197-
}
198-
199216
jar {
200217
dependsOn("copyGenerateUiV2Artifacts")
201-
202218
archiveBaseName.set("nx-console")
203219
}
204220

205-
instrumentedJar {
206-
dependsOn("copyGenerateUiV2Artifacts")
207-
}
221+
instrumentedJar { dependsOn("copyGenerateUiV2Artifacts") }
222+
223+
withType<RunIdeTask> { maxHeapSize = "6g" }
208224
}
209225

210226
tasks.register<Copy>("copyGenerateUiV2Artifacts") {
211227
from("${rootDir}/dist/apps/generate-ui-v2")
212228
include("*.js", "*.css")
213-
into("${buildDir}/resources/main/generate_ui_v2")
229+
into(layout.buildDirectory.file("resources/main/generate_ui_v2"))
214230
}
215231

216232
tasks.register<DefaultTask>("publish") {

0 commit comments

Comments
 (0)