From c468e85e2f823050261af001d71cf37ac8e29344 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Fri, 22 Aug 2025 15:51:36 +0200 Subject: [PATCH 01/45] chore(repo): migrate intellij to nx gradle plugin v2 --- apps/intellij/build.gradle.kts | 17 +++++++---------- build.gradle.kts | 17 +++++++++++++++-- nx.json | 5 ++--- settings.gradle.kts | 2 ++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 0076b5ac9a..f71e24b028 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -25,12 +25,16 @@ plugins { id("org.jetbrains.changelog") version "2.4.0" id("com.ncorti.ktfmt.gradle") version "0.24.0" + id("dev.nx.gradle.project-graph") version "0.1.5" + + } group = providers.gradleProperty("pluginGroup").get() version = providers.gradleProperty("version").get() + // Configure project's dependencies repositories { mavenCentral() @@ -40,19 +44,12 @@ repositories { allprojects { apply { - plugin("project-report") + plugin("dev.nx.gradle.project-graph") + plugin("org.jetbrains.kotlin.jvm") plugin("com.ncorti.ktfmt.gradle") } } -tasks.register("projectReportAll") { - // All project reports of subprojects - allprojects.forEach { dependsOn(it.tasks.get("projectReport")) } - - // All projectReportAll of included builds - gradle.includedBuilds.forEach { dependsOn(it.task(":projectReportAll")) } -} - configurations.all { exclude("org.slf4j", "slf4j-api") exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk7") @@ -89,7 +86,7 @@ dependencies { // Add test framework configuration testFramework(org.jetbrains.intellij.platform.gradle.TestFrameworkType.Platform) } - implementation(project(":libs:intellij:models")) + implementation(project("intellij-models")) } ktfmt { kotlinLangStyle() } diff --git a/build.gradle.kts b/build.gradle.kts index 6b69ee166c..6f39125323 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,15 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") -allprojects { apply { plugin("project-report") } } +plugins { + id("dev.nx.gradle.project-graph") version "0.1.5" +} + +allprojects { + apply { + plugin("dev.nx.gradle.project-graph") + } +} tasks { register("projectReportAll") { @@ -30,4 +38,9 @@ tasks { println("Compiled test classes for ${gradle.includedBuilds.size} included builds") } } -} + + register("publish") { + description = "Placeholder task to workaround the semantic-release plugin" + group = "publishing" + } +} \ No newline at end of file diff --git a/nx.json b/nx.json index 5fcb2b9bea..4f16557165 100644 --- a/nx.json +++ b/nx.json @@ -140,12 +140,11 @@ } }, { - "plugin": "@nx/gradle/plugin-v1", + "plugin": "@nx/gradle", "options": { "testTargetName": "test", "classesTargetName": "classes", - "buildTargetName": "build", - "includeSubprojectsTasks": true + "buildTargetName": "build" } }, "@nx/enterprise-cloud", diff --git a/settings.gradle.kts b/settings.gradle.kts index fcfc81474d..b411974234 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,3 +3,5 @@ rootProject.name = "nx-console" plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" } includeBuild("apps/intellij") + + From 3fc9c02f33141c088f1c197b3b27ecefc090c28b Mon Sep 17 00:00:00 2001 From: Max Kless Date: Fri, 22 Aug 2025 16:49:39 +0200 Subject: [PATCH 02/45] dont call projectReportAll in CI --- .github/workflows/ci_checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index e1e12e87dd..5fbaee93aa 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -65,7 +65,6 @@ jobs: # and we do not want to give the false impression that the artifact download time is part of nx commands. - name: Gradle artifacts and formatting run: | - yarn nx-cloud record -- ./gradlew projectReportAll yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - name: Check project graph creation From 2b12fb4b5b3b1403dc9246cb94c26e5805703066 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Fri, 22 Aug 2025 17:08:11 +0200 Subject: [PATCH 03/45] review comment --- apps/intellij/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index f71e24b028..2f0c8d8569 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -86,7 +86,7 @@ dependencies { // Add test framework configuration testFramework(org.jetbrains.intellij.platform.gradle.TestFrameworkType.Platform) } - implementation(project("intellij-models")) + implementation(project(":intellij-models")) } ktfmt { kotlinLangStyle() } From 6f623bc36f65f570a6a11d5325c885bd874635a6 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 13:14:25 +0200 Subject: [PATCH 04/45] add storage logging --- .github/workflows/ci_checks.yml | 61 +++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 5fbaee93aa..be46614fed 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -61,14 +61,71 @@ jobs: - name: Install NPM dependencies run: yarn install --immutable + - name: Check storage before + run: | + echo "=== Filesystem summary ===" + echo "=== Filesystem space usage (blocks) ===" + df -h + + echo + echo "=== Filesystem inode usage ===" + df -ih + + echo + echo "=== Root filesystem breakdown (top dirs) ===" + sudo du -h --max-depth=1 / | sort -h | tail -n 20 + + echo + echo "=== Home dir breakdown ===" + du -h --max-depth=1 /home/runner | sort -h + # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. - name: Gradle artifacts and formatting run: | yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - - name: Check project graph creation - run: yarn nx show projects --verbose + - name: Check storage after + run: | + echo "=== Filesystem space usage (blocks) ===" + df -h + + echo + echo "=== Filesystem inode usage ===" + df -ih + + echo + echo "=== Root filesystem breakdown (top dirs) ===" + sudo du -h --max-depth=1 / | sort -h | tail -n 20 + + echo + echo "=== Home dir breakdown ===" + du -h --max-depth=1 /home/runner | sort -h + + - name: Run Nx project graph with disk monitor + run: | + ( + echo "== monitor start $(date -Is) =="; + while true; do + echo "---- $(date -Is) ----" + df -h / + df -ih / + du -h -d1 /home/runner | sort -h | tail -n 20 + du -h -d2 ~/.gradle 2>/dev/null | sort -h | tail -n 25 + du -h -d2 "$GITHUB_WORKSPACE" 2>/dev/null | sort -h | tail -n 30 + du -h -d2 "$GITHUB_WORKSPACE/.nx" 2>/dev/null | sort -h | tail -n 20 + sleep 5 + done + ) 2>&1 & + + MON_PID=$! + # === Your actual Nx task === + yarn nx graph --verbose || true + # =========================== + + kill $MON_PID || true + echo "== monitor end $(date -Is) ==" >> disk.log + shell: bash - name: Check formatting of other files run: yarn nx-cloud record -- yarn nx format:check --verbose From 9d3dccd4a0cd60d5648e32d0fa8c4571da1d03d1 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 15:23:45 +0200 Subject: [PATCH 05/45] no before/after --- .github/workflows/ci_checks.yml | 39 ++------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index be46614fed..77db4e66b6 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -61,47 +61,12 @@ jobs: - name: Install NPM dependencies run: yarn install --immutable - - name: Check storage before - run: | - echo "=== Filesystem summary ===" - echo "=== Filesystem space usage (blocks) ===" - df -h - - echo - echo "=== Filesystem inode usage ===" - df -ih - - echo - echo "=== Root filesystem breakdown (top dirs) ===" - sudo du -h --max-depth=1 / | sort -h | tail -n 20 - - echo - echo "=== Home dir breakdown ===" - du -h --max-depth=1 /home/runner | sort -h - # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. - name: Gradle artifacts and formatting run: | yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - - name: Check storage after - run: | - echo "=== Filesystem space usage (blocks) ===" - df -h - - echo - echo "=== Filesystem inode usage ===" - df -ih - - echo - echo "=== Root filesystem breakdown (top dirs) ===" - sudo du -h --max-depth=1 / | sort -h | tail -n 20 - - echo - echo "=== Home dir breakdown ===" - du -h --max-depth=1 /home/runner | sort -h - - name: Run Nx project graph with disk monitor run: | ( @@ -114,13 +79,13 @@ jobs: du -h -d2 ~/.gradle 2>/dev/null | sort -h | tail -n 25 du -h -d2 "$GITHUB_WORKSPACE" 2>/dev/null | sort -h | tail -n 30 du -h -d2 "$GITHUB_WORKSPACE/.nx" 2>/dev/null | sort -h | tail -n 20 - sleep 5 + sleep 20 done ) 2>&1 & MON_PID=$! # === Your actual Nx task === - yarn nx graph --verbose || true + npx nx show projects # =========================== kill $MON_PID || true From ca62349c88a967eaf2b8030910871b9a54133702 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 15:49:45 +0200 Subject: [PATCH 06/45] add cleanup --- .github/workflows/ci_checks.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 77db4e66b6..8a85a2b210 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -19,6 +19,11 @@ jobs: NX_CI_EXECUTION_ENV: 'linux' NX_VERBOSE_LOGGING: true steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + - uses: actions/checkout@v4 with: fetch-depth: 0 From 2884725ce7b6f542d43b2dae8d80713874eae75f Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 15:52:50 +0200 Subject: [PATCH 07/45] lmao lets see if this works --- .github/workflows/ci_checks.yml | 35 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 8a85a2b210..d0e08977c3 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -72,30 +72,37 @@ jobs: run: | yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - - name: Run Nx project graph with disk monitor + - name: Nx graph + identify biggest Gradle downloads + shell: bash run: | - ( - echo "== monitor start $(date -Is) =="; - while true; do + set -Eeuo pipefail + INTERVAL=20 + GRADLE_DIR="${GRADLE_USER_HOME:-$HOME/.gradle}" + + monitor() { + while :; do echo "---- $(date -Is) ----" df -h / df -ih / du -h -d1 /home/runner | sort -h | tail -n 20 - du -h -d2 ~/.gradle 2>/dev/null | sort -h | tail -n 25 + du -h -d2 "$GRADLE_DIR" 2>/dev/null | sort -h | tail -n 25 du -h -d2 "$GITHUB_WORKSPACE" 2>/dev/null | sort -h | tail -n 30 du -h -d2 "$GITHUB_WORKSPACE/.nx" 2>/dev/null | sort -h | tail -n 20 - sleep 20 + sleep "$INTERVAL" done - ) 2>&1 & + } - MON_PID=$! - # === Your actual Nx task === - npx nx show projects - # =========================== + monitor & MON_PID=$! - kill $MON_PID || true - echo "== monitor end $(date -Is) ==" >> disk.log - shell: bash + # --- run the Nx project graph task --- + yarn nx show projects --verbose + NX_RC=$? + # ------------------------------------- + + kill "$MON_PID" 2>/dev/null || true + wait "$MON_PID" 2>/dev/null || true + + exit "$NX_RC" - name: Check formatting of other files run: yarn nx-cloud record -- yarn nx format:check --verbose From 68f7552af4cee9134176c63af30558e696d69368 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 16:42:20 +0200 Subject: [PATCH 08/45] gradle wrapper --- .github/workflows/ci_checks.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index d0e08977c3..2b89cc2fcb 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -66,10 +66,14 @@ jobs: - name: Install NPM dependencies run: yarn install --immutable + - name: Setup Gradle Wrapper + run: ./gradlew wrapper + # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. - name: Gradle artifacts and formatting run: | + yarn nx-cloud record -- ./gradlew nxProjectReport yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - name: Nx graph + identify biggest Gradle downloads From f95a979c466901fc84977cb7ba626c9c918fa3f8 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 17:01:44 +0200 Subject: [PATCH 09/45] make ci yaml normal again --- .github/workflows/ci_checks.yml | 37 ++++----------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 2b89cc2fcb..42abb7e5e7 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -67,46 +67,17 @@ jobs: run: yarn install --immutable - name: Setup Gradle Wrapper - run: ./gradlew wrapper + run: ./gradlew wrapper --info # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. - name: Gradle artifacts and formatting run: | - yarn nx-cloud record -- ./gradlew nxProjectReport + yarn nx-cloud record -- ./gradlew nxProjectReport --info yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - - name: Nx graph + identify biggest Gradle downloads - shell: bash - run: | - set -Eeuo pipefail - INTERVAL=20 - GRADLE_DIR="${GRADLE_USER_HOME:-$HOME/.gradle}" - - monitor() { - while :; do - echo "---- $(date -Is) ----" - df -h / - df -ih / - du -h -d1 /home/runner | sort -h | tail -n 20 - du -h -d2 "$GRADLE_DIR" 2>/dev/null | sort -h | tail -n 25 - du -h -d2 "$GITHUB_WORKSPACE" 2>/dev/null | sort -h | tail -n 30 - du -h -d2 "$GITHUB_WORKSPACE/.nx" 2>/dev/null | sort -h | tail -n 20 - sleep "$INTERVAL" - done - } - - monitor & MON_PID=$! - - # --- run the Nx project graph task --- - yarn nx show projects --verbose - NX_RC=$? - # ------------------------------------- - - kill "$MON_PID" 2>/dev/null || true - wait "$MON_PID" 2>/dev/null || true - - exit "$NX_RC" + - name: Verify Nx project graph + run: yarn nx show projects - name: Check formatting of other files run: yarn nx-cloud record -- yarn nx format:check --verbose From f9efd856989cbfe576b3af39ad0404e194a132bd Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 17:54:56 +0200 Subject: [PATCH 10/45] move formatting --- .github/workflows/ci_checks.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 42abb7e5e7..327fa7dc6a 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -71,16 +71,17 @@ jobs: # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. - - name: Gradle artifacts and formatting + - name: Gradle artifacts run: | yarn nx-cloud record -- ./gradlew nxProjectReport --info - yarn nx-cloud record -- ./gradlew :intellij:ktfmtCheck --info - name: Verify Nx project graph run: yarn nx show projects - - name: Check formatting of other files - run: yarn nx-cloud record -- yarn nx format:check --verbose + - name: Check formatting + run: | + yarn nx-cloud record -- yarn nx format:check --verbose + yarn nx-cloud record -- yarn nx run-many -t ktfmtFormatTest - name: Ensure the workspace configuration is in sync run: yarn nx-cloud record -- yarn nx sync:check From 050c716af3f046d91b24879a0a8effbea09579ee Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 25 Aug 2025 18:54:08 +0200 Subject: [PATCH 11/45] do not free space for everything --- .github/workflows/ci_checks.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 327fa7dc6a..557ada010c 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -22,7 +22,13 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: + # we just need a little bit more space, we save CI time by not deleting everything tool-cache: false + dotnet: false + haskell: false + large-packages: false + docker-images: false + swap-storage: false - uses: actions/checkout@v4 with: From 62c38e05bb92a4f51ed793a52279f76c011b6e18 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 26 Aug 2025 10:25:50 +0200 Subject: [PATCH 12/45] run projectReport on java agents --- .nx/workflows/agents.yaml | 49 ++++++++++++++++---- .nx/workflows/linux-distribution-config.yaml | 12 ++--- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 0cc131ded2..1e79483a86 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -1,10 +1,42 @@ launch-templates: - windows-medium-js: - resource-class: 'windows/medium' - image: 'windows-2022' + # windows-medium-js: + # resource-class: 'windows/medium' + # image: 'windows-2022' + # init-steps: + # - name: Checkout + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' + # - name: Restore Node Modules Cache + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + # inputs: + # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' + # paths: 'node_modules' + # base-branch: 'main' + # - name: Restore Browser Binary Cache + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + # inputs: + # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' + # paths: | + # '../.cache/Cypress' + # '../.cache/ms-playwright' + # base-branch: 'main' + # - name: Install Node Modules + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' + # - name: Install Browsers (if needed) + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + # - name: Install cypress with --force + # script: npx cypress install --force + linux-medium-plus-js: + resource-class: 'docker_linux_amd64/medium+' + image: 'ubuntu22.04-node20.11-v10' init-steps: - name: Checkout uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' + - name: Setup Java 21 + script: | + sudo apt update + sudo apt install -y openjdk-21-jdk + sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java + java -version - name: Restore Node Modules Cache uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' inputs: @@ -17,16 +49,13 @@ launch-templates: key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' paths: | '../.cache/Cypress' - '../.cache/ms-playwright' base-branch: 'main' - name: Install Node Modules uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - - name: Install cypress with --force - script: npx cypress install --force - linux-medium-plus-js: - resource-class: 'docker_linux_amd64/medium+' + linux-large-js: + resource-class: 'docker_linux_amd64/large' image: 'ubuntu22.04-node20.11-v10' init-steps: - name: Checkout @@ -54,7 +83,7 @@ launch-templates: uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - linux-large-js: + linux-large-java: resource-class: 'docker_linux_amd64/large' image: 'ubuntu22.04-node20.11-v10' init-steps: @@ -83,3 +112,5 @@ launch-templates: uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + - name: Create Gradle project report + script: ./gradlew nxProjectReport --info diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index 21a4232f24..2b92407807 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -1,10 +1,10 @@ distribute-on: - small-changeset: 2 linux-medium-plus-js, 1 linux-large-js - medium-changeset: 3 linux-medium-plus-js, 1 linux-large-js - large-changeset: 5 linux-medium-plus-js, 1 linux-large-js + small-changeset: 1 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java + medium-changeset: 2 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java + large-changeset: 5 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java assignment-rules: - - project: intellij - target: build + - projects: + - intellij runs-on: - - linux-large-js + - linux-large-java From cafc67cca9c13ca56b6160b5537135ef5f38268f Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 11:27:58 +0200 Subject: [PATCH 13/45] bump to 0.1.6 --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6f39125323..57f10b7a03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.5" + id("dev.nx.gradle.project-graph") version "0.1.6" } allprojects { @@ -43,4 +43,4 @@ tasks { description = "Placeholder task to workaround the semantic-release plugin" group = "publishing" } -} \ No newline at end of file +} From 114ad9ff6ea932e76d697852e43400d82fb2c91d Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 11:36:07 +0200 Subject: [PATCH 14/45] back to 0.1.5 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 57f10b7a03..726e131843 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.6" + id("dev.nx.gradle.project-graph") version "0.1.5" } allprojects { From f0c7f98904768368f6b70477e18121a18224ad2c Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 11:38:48 +0200 Subject: [PATCH 15/45] try again --- apps/intellij/build.gradle.kts | 2 ++ build.gradle.kts | 2 +- libs/intellij/models/build.gradle.kts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 2f0c8d8569..9dbc52a663 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -37,7 +37,9 @@ version = providers.gradleProperty("version").get() // Configure project's dependencies repositories { + mavenLocal() mavenCentral() + gradlePluginPortal() intellijPlatform { defaultRepositories() } } diff --git a/build.gradle.kts b/build.gradle.kts index 726e131843..57f10b7a03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.5" + id("dev.nx.gradle.project-graph") version "0.1.6" } allprojects { diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index b589ba91f6..ee1048117b 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -15,7 +15,9 @@ version = providers.gradleProperty("version").get() // Configure project's dependencies repositories { + mavenLocal() mavenCentral() + gradlePluginPortal() intellijPlatform { defaultRepositories() } } From 99b5fb93f0c7ecdb5f9f50d13648577c0e2e9842 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 13:14:55 +0200 Subject: [PATCH 16/45] parallelism: 1 --- .nx/workflows/linux-distribution-config.yaml | 1 + build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index 2b92407807..07ffe85abd 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -8,3 +8,4 @@ assignment-rules: - intellij runs-on: - linux-large-java + parallelism: 1 diff --git a/build.gradle.kts b/build.gradle.kts index 57f10b7a03..726e131843 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.6" + id("dev.nx.gradle.project-graph") version "0.1.5" } allprojects { From 8d996234cd6da63be6cbf1b7e51ea343d525d9ff Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 14:14:43 +0200 Subject: [PATCH 17/45] no extra runner --- .nx/workflows/agents.yaml | 62 ++++++++++---------- .nx/workflows/linux-distribution-config.yaml | 8 +-- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 1e79483a86..162f501448 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -83,34 +83,34 @@ launch-templates: uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - linux-large-java: - resource-class: 'docker_linux_amd64/large' - image: 'ubuntu22.04-node20.11-v10' - init-steps: - - name: Checkout - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - - name: Setup Java 21 - script: | - sudo apt update - sudo apt install -y openjdk-21-jdk - sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - java -version - - name: Restore Node Modules Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' - paths: 'node_modules' - base-branch: 'main' - - name: Restore Browser Binary Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' - paths: | - '../.cache/Cypress' - base-branch: 'main' - - name: Install Node Modules - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - - name: Install Browsers (if needed) - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - - name: Create Gradle project report - script: ./gradlew nxProjectReport --info + # linux-large-java: + # resource-class: 'docker_linux_amd64/large' + # image: 'ubuntu22.04-node20.11-v10' + # init-steps: + # - name: Checkout + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' + # - name: Setup Java 21 + # script: | + # sudo apt update + # sudo apt install -y openjdk-21-jdk + # sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java + # java -version + # - name: Restore Node Modules Cache + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + # inputs: + # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' + # paths: 'node_modules' + # base-branch: 'main' + # - name: Restore Browser Binary Cache + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + # inputs: + # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' + # paths: | + # '../.cache/Cypress' + # base-branch: 'main' + # - name: Install Node Modules + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' + # - name: Install Browsers (if needed) + # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + # - name: Create Gradle project report + # script: ./gradlew nxProjectReport --info diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index 07ffe85abd..5e9095e1ae 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -1,11 +1,11 @@ distribute-on: - small-changeset: 1 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java - medium-changeset: 2 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java - large-changeset: 5 linux-medium-plus-js, 1 linux-large-js, 1 linux-large-java + small-changeset: 2 linux-medium-plus-js, 1 linux-large-js + medium-changeset: 3 linux-medium-plus-js, 1 linux-large-js + large-changeset: 6 linux-medium-plus-js, 1 linux-large-js assignment-rules: - projects: - intellij runs-on: - - linux-large-java + - linux-large-js parallelism: 1 From 73dc7b358d265167705378fb4f27ac39d8bbbaaa Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 28 Aug 2025 18:13:33 +0200 Subject: [PATCH 18/45] no plugin timeouts --- .github/workflows/ci_checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 557ada010c..34018c08bc 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -10,6 +10,7 @@ env: JAVA_VERSION: 21 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_READ_WRITE_TOKEN }} NX_CLOUD_NO_TIMEOUTS: true + NX_PLUGIN_NO_TIMEOUTS: true jobs: main-linux: From 41e75b890828fea9f88ee0e92e89f4df209768e9 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Fri, 29 Aug 2025 12:50:16 +0200 Subject: [PATCH 19/45] add more logs to gradle plugin --- package.json | 3 +- scripts/apply-gradle-patches.js | 182 ++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+), 1 deletion(-) create mode 100755 scripts/apply-gradle-patches.js diff --git a/package.json b/package.json index 0568517f9d..4a0dc56b4a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "watch": "nx run vscode:watch:debug", "e2e": "nx e2e vscode-e2e", "update": "nx migrate latest", - "prepare": "husky" + "prepare": "husky", + "postinstall": "node scripts/apply-gradle-patches.js || true" }, "dependencies": { "@lit-labs/context": "^0.3.1", diff --git a/scripts/apply-gradle-patches.js b/scripts/apply-gradle-patches.js new file mode 100755 index 0000000000..6f7f4f295d --- /dev/null +++ b/scripts/apply-gradle-patches.js @@ -0,0 +1,182 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); + +console.log('šŸ”§ Applying Gradle logging patches...'); + +const gradlePackagePath = path.join(__dirname, '..', 'node_modules', '@nx', 'gradle'); + +// Check if the gradle package exists +if (!fs.existsSync(gradlePackagePath)) { + console.log('āš ļø @nx/gradle package not found, skipping patch application'); + process.exit(0); +} + +// Define the patches to apply +const patches = [ + { + file: 'src/plugin/utils/get-project-graph-from-gradle-plugin.js', + modifications: [ + { + search: `async function populateProjectGraph(workspaceRoot, gradlewFiles, options) { + const gradleConfigHash = (0, devkit_1.hashArray)([`, + replace: `async function populateProjectGraph(workspaceRoot, gradlewFiles, options) { + console.log('šŸ” [GRADLE] Starting project graph population with hash calculation...'); + const gradleConfigHash = (0, devkit_1.hashArray)([` + }, + { + search: ` if (projectGraphReportCache && + (!gradleCurrentConfigHash || gradleConfigHash === gradleCurrentConfigHash)) { + return; + }`, + replace: ` if (projectGraphReportCache && + (!gradleCurrentConfigHash || gradleConfigHash === gradleCurrentConfigHash)) { + console.log('šŸŽÆ [GRADLE] Using cached project graph report', { hash: gradleConfigHash }); + return; + } + console.log('šŸ“Š [GRADLE] Cache miss or hash mismatch, generating new project graph...', { + currentHash: gradleConfigHash, previousHash: gradleCurrentConfigHash, gradlewFiles: gradlewFiles.length });` + }, + { + search: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); + return [...allLines, ...currentLines];`, + replace: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); + console.log('⚔ [GRADLE] Processed gradlew file', { file: gradlewFile, + linesCount: currentLines.length, totalLines: allLines.length + currentLines.length }); + return [...allLines, ...currentLines];` + }, + { + search: ` writeProjectGraphReportToCache(projectGraphReportCachePath, projectGraphReportCache); +}`, + replace: ` writeProjectGraphReportToCache(projectGraphReportCachePath, projectGraphReportCache); + console.log('āœ… [GRADLE] Successfully populated project graph', { + hash: gradleConfigHash, totalLines: projectGraphLines.length, + nodes: Object.keys(projectGraphReportCache.nodes || {}).length, + dependencies: projectGraphReportCache.dependencies?.length || 0 }); +}` + }, + { + search: `function processNxProjectGraph(projectGraphLines) { + let index = 0; + let projectGraphReportForAllProjects = {`, + replace: `function processNxProjectGraph(projectGraphLines) { + let index = 0; + console.log('šŸ”„ [GRADLE] Processing project graph lines...', { totalLines: projectGraphLines.length }); + let projectGraphReportForAllProjects = {` + } + ] + }, + { + file: 'src/plugin/dependencies.js', + modifications: [ + { + search: `const createDependencies = async (options, context) => { + const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));`, + replace: `const createDependencies = async (options, context) => { + console.log('šŸ”— [GRADLE] Starting dependency creation...', { options }); + const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));` + }, + { + search: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); + await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);`, + replace: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); + console.log('šŸ“ [GRADLE] Found gradlew files', { count: gradlewFiles.length, files: gradlewFiles }); + await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);` + }, + { + search: ` const dependencies = []; + dependenciesFromReport.forEach((dependencyFromPlugin) => {`, + replace: ` const dependencies = []; + console.log('šŸ“Š [GRADLE] Processing dependencies from report', { count: dependenciesFromReport.length }); + let processedCount = 0, skippedCount = 0; + dependenciesFromReport.forEach((dependencyFromPlugin) => {` + }, + { + search: ` if (!sourceProjectName || + !targetProjectName || + !(0, node_fs_1.existsSync)(dependencyFromPlugin.sourceFile)) { + return; + }`, + replace: ` if (!sourceProjectName || + !targetProjectName || + !(0, node_fs_1.existsSync)(dependencyFromPlugin.sourceFile)) { + skippedCount++; + console.log('ā­ļø [GRADLE] Skipping dependency (missing project or file)', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target, sourceFile: dependencyFromPlugin.sourceFile }); + return; + }` + }, + { + search: ` (0, devkit_1.validateDependency)(dependency, context); + dependencies.push(dependency); + }`, + replace: ` (0, devkit_1.validateDependency)(dependency, context); + dependencies.push(dependency); + processedCount++; + }` + }, + { + search: ` catch { + devkit_1.logger.warn(\`Unable to parse dependency from gradle plugin: \${dependencyFromPlugin.source} -> \${dependencyFromPlugin.target}\`); + }`, + replace: ` catch { + skippedCount++; + console.warn('āš ļø [GRADLE] Failed to process dependency', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target }); + devkit_1.logger.warn(\`Unable to parse dependency from gradle plugin: \${dependencyFromPlugin.source} -> \${dependencyFromPlugin.target}\`); + }` + }, + { + search: ` }); + return dependencies;`, + replace: ` }); + console.log('āœ… [GRADLE] Dependency creation completed', { processed: processedCount, skipped: skippedCount, total: dependencies.length }); + return dependencies;` + } + ] + } +]; + +// Apply patches +let patchedFiles = 0; +let failedPatches = 0; + +for (const patch of patches) { + const filePath = path.join(gradlePackagePath, patch.file); + + if (!fs.existsSync(filePath)) { + console.log(`āš ļø File not found: ${patch.file}, skipping...`); + failedPatches++; + continue; + } + + try { + let content = fs.readFileSync(filePath, 'utf-8'); + let fileModified = false; + + for (const mod of patch.modifications) { + if (content.includes(mod.search)) { + content = content.replace(mod.search, mod.replace); + fileModified = true; + } + } + + if (fileModified) { + fs.writeFileSync(filePath, content, 'utf-8'); + console.log(`āœ… Patched: ${patch.file}`); + patchedFiles++; + } else { + console.log(`ā­ļø Already patched or no matches: ${patch.file}`); + } + } catch (error) { + console.error(`āŒ Failed to patch ${patch.file}:`, error.message); + failedPatches++; + } +} + +console.log(`\nšŸŽÆ Patch application completed: ${patchedFiles} files patched, ${failedPatches} failed`); + +if (patchedFiles > 0) { + console.log('šŸš€ Gradle logging patches applied successfully! CI will now show comprehensive logs.'); +} else if (failedPatches === 0) { + console.log('šŸ“‹ All patches already applied or no files found to patch.'); +} \ No newline at end of file From f41fdd7ffe9d26282d8d64fd3e8b8f5c98af26c1 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Fri, 29 Aug 2025 13:18:52 +0200 Subject: [PATCH 20/45] formatting --- scripts/apply-gradle-patches.js | 60 +++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/scripts/apply-gradle-patches.js b/scripts/apply-gradle-patches.js index 6f7f4f295d..7c0faeb301 100755 --- a/scripts/apply-gradle-patches.js +++ b/scripts/apply-gradle-patches.js @@ -5,7 +5,13 @@ const path = require('path'); console.log('šŸ”§ Applying Gradle logging patches...'); -const gradlePackagePath = path.join(__dirname, '..', 'node_modules', '@nx', 'gradle'); +const gradlePackagePath = path.join( + __dirname, + '..', + 'node_modules', + '@nx', + 'gradle', +); // Check if the gradle package exists if (!fs.existsSync(gradlePackagePath)) { @@ -23,7 +29,7 @@ const patches = [ const gradleConfigHash = (0, devkit_1.hashArray)([`, replace: `async function populateProjectGraph(workspaceRoot, gradlewFiles, options) { console.log('šŸ” [GRADLE] Starting project graph population with hash calculation...'); - const gradleConfigHash = (0, devkit_1.hashArray)([` + const gradleConfigHash = (0, devkit_1.hashArray)([`, }, { search: ` if (projectGraphReportCache && @@ -36,7 +42,7 @@ const patches = [ return; } console.log('šŸ“Š [GRADLE] Cache miss or hash mismatch, generating new project graph...', { - currentHash: gradleConfigHash, previousHash: gradleCurrentConfigHash, gradlewFiles: gradlewFiles.length });` + currentHash: gradleConfigHash, previousHash: gradleCurrentConfigHash, gradlewFiles: gradlewFiles.length });`, }, { search: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); @@ -44,7 +50,7 @@ const patches = [ replace: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); console.log('⚔ [GRADLE] Processed gradlew file', { file: gradlewFile, linesCount: currentLines.length, totalLines: allLines.length + currentLines.length }); - return [...allLines, ...currentLines];` + return [...allLines, ...currentLines];`, }, { search: ` writeProjectGraphReportToCache(projectGraphReportCachePath, projectGraphReportCache); @@ -54,7 +60,7 @@ const patches = [ hash: gradleConfigHash, totalLines: projectGraphLines.length, nodes: Object.keys(projectGraphReportCache.nodes || {}).length, dependencies: projectGraphReportCache.dependencies?.length || 0 }); -}` +}`, }, { search: `function processNxProjectGraph(projectGraphLines) { @@ -63,9 +69,9 @@ const patches = [ replace: `function processNxProjectGraph(projectGraphLines) { let index = 0; console.log('šŸ”„ [GRADLE] Processing project graph lines...', { totalLines: projectGraphLines.length }); - let projectGraphReportForAllProjects = {` - } - ] + let projectGraphReportForAllProjects = {`, + }, + ], }, { file: 'src/plugin/dependencies.js', @@ -75,14 +81,14 @@ const patches = [ const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));`, replace: `const createDependencies = async (options, context) => { console.log('šŸ”— [GRADLE] Starting dependency creation...', { options }); - const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));` + const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));`, }, { search: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);`, replace: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); console.log('šŸ“ [GRADLE] Found gradlew files', { count: gradlewFiles.length, files: gradlewFiles }); - await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);` + await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);`, }, { search: ` const dependencies = []; @@ -90,7 +96,7 @@ const patches = [ replace: ` const dependencies = []; console.log('šŸ“Š [GRADLE] Processing dependencies from report', { count: dependenciesFromReport.length }); let processedCount = 0, skippedCount = 0; - dependenciesFromReport.forEach((dependencyFromPlugin) => {` + dependenciesFromReport.forEach((dependencyFromPlugin) => {`, }, { search: ` if (!sourceProjectName || @@ -104,7 +110,7 @@ const patches = [ skippedCount++; console.log('ā­ļø [GRADLE] Skipping dependency (missing project or file)', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target, sourceFile: dependencyFromPlugin.sourceFile }); return; - }` + }`, }, { search: ` (0, devkit_1.validateDependency)(dependency, context); @@ -113,7 +119,7 @@ const patches = [ replace: ` (0, devkit_1.validateDependency)(dependency, context); dependencies.push(dependency); processedCount++; - }` + }`, }, { search: ` catch { @@ -123,17 +129,17 @@ const patches = [ skippedCount++; console.warn('āš ļø [GRADLE] Failed to process dependency', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target }); devkit_1.logger.warn(\`Unable to parse dependency from gradle plugin: \${dependencyFromPlugin.source} -> \${dependencyFromPlugin.target}\`); - }` + }`, }, { search: ` }); return dependencies;`, replace: ` }); console.log('āœ… [GRADLE] Dependency creation completed', { processed: processedCount, skipped: skippedCount, total: dependencies.length }); - return dependencies;` - } - ] - } + return dependencies;`, + }, + ], + }, ]; // Apply patches @@ -142,24 +148,24 @@ let failedPatches = 0; for (const patch of patches) { const filePath = path.join(gradlePackagePath, patch.file); - + if (!fs.existsSync(filePath)) { console.log(`āš ļø File not found: ${patch.file}, skipping...`); failedPatches++; continue; } - + try { let content = fs.readFileSync(filePath, 'utf-8'); let fileModified = false; - + for (const mod of patch.modifications) { if (content.includes(mod.search)) { content = content.replace(mod.search, mod.replace); fileModified = true; } } - + if (fileModified) { fs.writeFileSync(filePath, content, 'utf-8'); console.log(`āœ… Patched: ${patch.file}`); @@ -173,10 +179,14 @@ for (const patch of patches) { } } -console.log(`\nšŸŽÆ Patch application completed: ${patchedFiles} files patched, ${failedPatches} failed`); +console.log( + `\nšŸŽÆ Patch application completed: ${patchedFiles} files patched, ${failedPatches} failed`, +); if (patchedFiles > 0) { - console.log('šŸš€ Gradle logging patches applied successfully! CI will now show comprehensive logs.'); + console.log( + 'šŸš€ Gradle logging patches applied successfully! CI will now show comprehensive logs.', + ); } else if (failedPatches === 0) { console.log('šŸ“‹ All patches already applied or no files found to patch.'); -} \ No newline at end of file +} From c146b6949c115ffb94e18ee3c152ad57a79b6796 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 8 Sep 2025 16:47:39 +0200 Subject: [PATCH 21/45] migrate to 0.1.7 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 726e131843..0595279d35 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.5" + id("dev.nx.gradle.project-graph") version "0.1.7" } allprojects { From 8d699eec45bab23c708085f26833ebc7e15a9904 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 9 Sep 2025 12:27:48 +0200 Subject: [PATCH 22/45] lil bit more space --- .github/workflows/ci_checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 34018c08bc..5e5a2348d3 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -26,7 +26,7 @@ jobs: # we just need a little bit more space, we save CI time by not deleting everything tool-cache: false dotnet: false - haskell: false + haskell: true large-packages: false docker-images: false swap-storage: false From b584de03f6dd70dda4ff3977e9f3623edc6c6441 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 9 Sep 2025 15:54:15 +0200 Subject: [PATCH 23/45] add more logging --- scripts/apply-gradle-patches.js | 257 ++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) diff --git a/scripts/apply-gradle-patches.js b/scripts/apply-gradle-patches.js index 7c0faeb301..384e097fa4 100755 --- a/scripts/apply-gradle-patches.js +++ b/scripts/apply-gradle-patches.js @@ -21,6 +21,121 @@ if (!fs.existsSync(gradlePackagePath)) { // Define the patches to apply const patches = [ + // Add exec-gradle.js patches for process tracking + { + file: 'src/utils/exec-gradle.js', + modifications: [ + { + search: `function execGradleAsync(gradleBinaryPath, args, execOptions = {}) { + return new Promise((res, rej) => { + const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args, {`, + replace: `function execGradleAsync(gradleBinaryPath, args, execOptions = {}) { + const startTime = Date.now(); + console.log('šŸš€ [GRADLE EXEC] Starting Gradle process', { + binary: gradleBinaryPath, + args: args.filter(arg => arg).join(' '), + timestamp: new Date().toISOString() + }); + + return new Promise((res, rej) => { + const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args, {`, + }, + { + search: ` let stdout = Buffer.from(''); + cp.stdout?.on('data', (data) => { + stdout += data; + }); + cp.stderr?.on('data', (data) => { + stdout += data; + });`, + replace: ` let stdout = Buffer.from(''); + let totalBytes = 0; + let lastOutputTime = Date.now(); + let outputLineCount = 0; + + // Set up watchdog timer + const watchdogInterval = setInterval(() => { + const timeSinceLastOutput = Date.now() - lastOutputTime; + if (timeSinceLastOutput > 30000) { + console.warn('āš ļø [GRADLE EXEC] No output for 30+ seconds', { + timeSinceLastOutput: Math.round(timeSinceLastOutput / 1000) + 's', + totalBytes, + outputLineCount, + elapsed: Math.round((Date.now() - startTime) / 1000) + 's' + }); + } + }, 10000); + + cp.stdout?.on('data', (data) => { + stdout += data; + totalBytes += data.length; + lastOutputTime = Date.now(); + outputLineCount += (data.toString().match(/\\n/g) || []).length; + + // Log progress every 100KB + if (totalBytes % 102400 < data.length) { + console.log('šŸ“Š [GRADLE EXEC] Receiving output', { + bytes: totalBytes, + lines: outputLineCount, + elapsed: Math.round((Date.now() - startTime) / 1000) + 's', + lastChunk: data.toString().slice(-100).replace(/\\n/g, ' ') + }); + } + }); + cp.stderr?.on('data', (data) => { + stdout += data; + totalBytes += data.length; + lastOutputTime = Date.now(); + const errStr = data.toString(); + console.log('āš ļø [GRADLE EXEC] Stderr output', { + message: errStr.slice(0, 200), + bytes: data.length + }); + });`, + }, + { + search: ` cp.on('exit', (code) => { + if (code === 0) { + res(stdout); + } + else { + rej(stdout); + } + });`, + replace: ` cp.on('exit', (code) => { + clearInterval(watchdogInterval); + const elapsed = Math.round((Date.now() - startTime) / 1000); + console.log('šŸ [GRADLE EXEC] Process exited', { + code, + totalBytes, + outputLineCount, + elapsed: elapsed + 's', + success: code === 0 + }); + + if (code === 0) { + res(stdout); + } + else { + console.error('āŒ [GRADLE EXEC] Process failed', { + code, + lastOutput: stdout.toString().slice(-500) + }); + rej(stdout); + } + }); + + cp.on('error', (err) => { + clearInterval(watchdogInterval); + console.error('āŒ [GRADLE EXEC] Process error', { + error: err.message, + elapsed: Math.round((Date.now() - startTime) / 1000) + 's' + }); + rej(err); + });`, + }, + ], + }, { file: 'src/plugin/utils/get-project-graph-from-gradle-plugin.js', modifications: [ @@ -71,6 +186,72 @@ const patches = [ console.log('šŸ”„ [GRADLE] Processing project graph lines...', { totalLines: projectGraphLines.length }); let projectGraphReportForAllProjects = {`, }, + { + search: ` while (index < projectGraphLines.length) { + const line = projectGraphLines[index];`, + replace: ` let processedProjects = new Set(); + let lastLogTime = Date.now(); + let linesSinceLastLog = 0; + + while (index < projectGraphLines.length) { + const line = projectGraphLines[index]; + linesSinceLastLog++; + + // Log progress every 50 lines or every 5 seconds + if (linesSinceLastLog >= 50 || Date.now() - lastLogTime > 5000) { + console.log('šŸ”„ [GRADLE] Processing progress', { + currentIndex: index, + totalLines: projectGraphLines.length, + percentComplete: Math.round((index / projectGraphLines.length) * 100) + '%', + currentLine: line?.slice(0, 100), + projectsProcessed: processedProjects.size + }); + linesSinceLastLog = 0; + lastLogTime = Date.now(); + }`, + }, + { + search: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_START')) {`, + replace: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_START')) { + const projectName = line.split(' ')[1]; + if (projectName) { + processedProjects.add(projectName); + console.log('šŸ—ļø [GRADLE] Starting project batch', { + project: projectName, + lineIndex: index, + totalProcessed: processedProjects.size + }); + }`, + }, + { + search: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_END')) { + index++; + continue; + }`, + replace: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_END')) { + const projectName = line.split(' ')[1]; + console.log('āœ“ [GRADLE] Completed project batch', { + project: projectName, + lineIndex: index + }); + index++; + continue; + }`, + }, + { + search: ` } + return projectGraphReportForAllProjects;`, + replace: ` } + + console.log('āœ… [GRADLE] Completed processing all project graph lines', { + totalProjects: processedProjects.size, + projects: Array.from(processedProjects), + nodesCount: Object.keys(projectGraphReportForAllProjects.nodes || {}).length, + dependenciesCount: projectGraphReportForAllProjects.dependencies?.length || 0 + }); + + return projectGraphReportForAllProjects;`, + }, ], }, { @@ -140,6 +321,82 @@ const patches = [ }, ], }, + // Add patches for get-project-graph-lines.js + { + file: 'src/plugin/utils/get-project-graph-lines.js', + modifications: [ + { + search: `async function getNxProjectGraphLines(gradlewFile, gradleConfigHash, gradlePluginOptions) { + if (process.env.VERCEL) { + // skip on Vercel + return []; + } + let nxProjectGraphBuffer;`, + replace: `async function getNxProjectGraphLines(gradlewFile, gradleConfigHash, gradlePluginOptions) { + if (process.env.VERCEL) { + // skip on Vercel + return []; + } + console.log('šŸ“‹ [GRADLE LINES] Getting project graph lines', { + gradlewFile, + hash: gradleConfigHash, + options: gradlePluginOptions, + timestamp: new Date().toISOString() + }); + let nxProjectGraphBuffer;`, + }, + { + search: ` const projectGraphLines = nxProjectGraphBuffer + .toString() + .split(exec_gradle_1.newLineSeparator) + .filter((line) => line.trim() !== '');`, + replace: ` const outputString = nxProjectGraphBuffer.toString(); + console.log('šŸ“ [GRADLE LINES] Processing Gradle output', { + outputSize: outputString.length, + firstChars: outputString.slice(0, 200), + lastChars: outputString.slice(-200) + }); + + const allLines = outputString.split(exec_gradle_1.newLineSeparator); + console.log('šŸ“Š [GRADLE LINES] Split output into lines', { + totalLines: allLines.length, + emptyLines: allLines.filter(line => !line.trim()).length + }); + + const projectGraphLines = allLines.filter((line, index) => { + const trimmed = line.trim(); + if (!trimmed) { + return false; + } + + // Log every 100th line for progress tracking + if (index % 100 === 0) { + console.log('šŸ” [GRADLE LINES] Processing line', { + lineNumber: index, + linePreview: trimmed.slice(0, 100), + isTaskLine: trimmed.includes('task') || trimmed.includes('Task') + }); + } + + // Log specific task-related lines + if (trimmed.includes('Processing task') || trimmed.includes('Processed task')) { + console.log('šŸ“Œ [GRADLE LINES] Task line found', { + lineNumber: index, + content: trimmed + }); + } + + return true; + }); + + console.log('āœ… [GRADLE LINES] Filtered project graph lines', { + originalLines: allLines.length, + filteredLines: projectGraphLines.length, + lastLine: projectGraphLines[projectGraphLines.length - 1]?.slice(0, 100) + });`, + }, + ], + }, ]; // Apply patches From 97f014d83287b954db015600deb32f24ff693857 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 11 Sep 2025 08:57:47 -0700 Subject: [PATCH 24/45] chore(repo): simplify agents.yaml --- .nx/workflows/agents.yaml | 130 ++++++++++++-------------------------- 1 file changed, 41 insertions(+), 89 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 162f501448..e688bb5848 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -1,100 +1,50 @@ launch-templates: - # windows-medium-js: - # resource-class: 'windows/medium' - # image: 'windows-2022' - # init-steps: - # - name: Checkout - # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - # - name: Restore Node Modules Cache - # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - # inputs: - # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' - # paths: 'node_modules' - # base-branch: 'main' - # - name: Restore Browser Binary Cache - # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - # inputs: - # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' - # paths: | - # '../.cache/Cypress' - # '../.cache/ms-playwright' - # base-branch: 'main' - # - name: Install Node Modules - # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - # - name: Install Browsers (if needed) - # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - # - name: Install cypress with --force - # script: npx cypress install --force - linux-medium-plus-js: - resource-class: 'docker_linux_amd64/medium+' - image: 'ubuntu22.04-node20.11-v10' + common-init-steps: &common-init-steps init-steps: - name: Checkout uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - - name: Setup Java 21 - script: | - sudo apt update - sudo apt install -y openjdk-21-jdk - sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - java -version - - name: Restore Node Modules Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' - paths: 'node_modules' - base-branch: 'main' - - name: Restore Browser Binary Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' - paths: | - '../.cache/Cypress' - base-branch: 'main' - - name: Install Node Modules - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - - name: Install Browsers (if needed) - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + - group-name: Restore Caches + steps: + - name: Restore Node Modules Cache + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + inputs: + key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' + paths: 'node_modules' + base-branch: 'main' + - name: Restore Browser Binary Cache + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + inputs: + key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' + paths: | + '../.cache/Cypress' + base-branch: 'main' + - group-name: Install Dependencies + parallel: true + steps: + - name: Setup Java 21 + script: | + sudo apt update + sudo apt install -y openjdk-21-jdk + sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java + java -version + - name: Install Node Modules + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' + - name: Install Browsers (if needed) + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + linux-medium-plus-js: + resource-class: 'docker_linux_amd64/medium+' + image: 'ubuntu22.04-node20.11-v10' + init-steps: *common-init-steps linux-large-js: resource-class: 'docker_linux_amd64/large' image: 'ubuntu22.04-node20.11-v10' - init-steps: - - name: Checkout - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - - name: Setup Java 21 - script: | - sudo apt update - sudo apt install -y openjdk-21-jdk - sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - java -version - - name: Restore Node Modules Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' - paths: 'node_modules' - base-branch: 'main' - - name: Restore Browser Binary Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' - paths: | - '../.cache/Cypress' - base-branch: 'main' - - name: Install Node Modules - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - - name: Install Browsers (if needed) - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - # linux-large-java: - # resource-class: 'docker_linux_amd64/large' - # image: 'ubuntu22.04-node20.11-v10' + init-steps: *common-init-steps + # windows-medium-js: + # resource-class: 'windows/medium' + # image: 'windows-2022' # init-steps: # - name: Checkout # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - # - name: Setup Java 21 - # script: | - # sudo apt update - # sudo apt install -y openjdk-21-jdk - # sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - # java -version # - name: Restore Node Modules Cache # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' # inputs: @@ -107,10 +57,12 @@ launch-templates: # key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' # paths: | # '../.cache/Cypress' + # '../.cache/ms-playwright' # base-branch: 'main' # - name: Install Node Modules # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' # - name: Install Browsers (if needed) # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - # - name: Create Gradle project report - # script: ./gradlew nxProjectReport --info + # - name: Install cypress with --force + # script: npx cypress install --force + From 13b53cc4dea66662d06c14e41094397b818abb6f Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 11 Sep 2025 09:00:07 -0700 Subject: [PATCH 25/45] chore(repo): remove patches --- .nx/workflows/agents.yaml | 67 ++--- package.json | 3 +- scripts/apply-gradle-patches.js | 449 -------------------------------- 3 files changed, 35 insertions(+), 484 deletions(-) delete mode 100755 scripts/apply-gradle-patches.js diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index e688bb5848..83b7af1482 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -1,36 +1,38 @@ +common-init-steps: &common-init-steps + - name: Checkout + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' + - group-name: Restore Caches + steps: + - name: Setup Java 21 + script: | + sudo apt update + sudo apt install -y openjdk-21-jdk + sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java + java -version + - name: Restore Node Modules Cache + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + inputs: + key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' + paths: 'node_modules' + base-branch: 'main' + - name: Restore Browser Binary Cache + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' + inputs: + key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' + paths: | + '../.cache/Cypress' + base-branch: 'main' + - group-name: Install Dependencies + parallel: true + steps: + - name: Install Node Modules + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' + - name: Install Browsers (if needed) + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + - name: Gradlew Wrapper + script: ./gradlew wrapper + launch-templates: - common-init-steps: &common-init-steps - init-steps: - - name: Checkout - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' - - group-name: Restore Caches - steps: - - name: Restore Node Modules Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml' - paths: 'node_modules' - base-branch: 'main' - - name: Restore Browser Binary Cache - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml' - inputs: - key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"' - paths: | - '../.cache/Cypress' - base-branch: 'main' - - group-name: Install Dependencies - parallel: true - steps: - - name: Setup Java 21 - script: | - sudo apt update - sudo apt install -y openjdk-21-jdk - sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - java -version - - name: Install Node Modules - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - - name: Install Browsers (if needed) - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' linux-medium-plus-js: resource-class: 'docker_linux_amd64/medium+' image: 'ubuntu22.04-node20.11-v10' @@ -65,4 +67,3 @@ launch-templates: # uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' # - name: Install cypress with --force # script: npx cypress install --force - diff --git a/package.json b/package.json index 4a0dc56b4a..0568517f9d 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "watch": "nx run vscode:watch:debug", "e2e": "nx e2e vscode-e2e", "update": "nx migrate latest", - "prepare": "husky", - "postinstall": "node scripts/apply-gradle-patches.js || true" + "prepare": "husky" }, "dependencies": { "@lit-labs/context": "^0.3.1", diff --git a/scripts/apply-gradle-patches.js b/scripts/apply-gradle-patches.js deleted file mode 100755 index 384e097fa4..0000000000 --- a/scripts/apply-gradle-patches.js +++ /dev/null @@ -1,449 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); - -console.log('šŸ”§ Applying Gradle logging patches...'); - -const gradlePackagePath = path.join( - __dirname, - '..', - 'node_modules', - '@nx', - 'gradle', -); - -// Check if the gradle package exists -if (!fs.existsSync(gradlePackagePath)) { - console.log('āš ļø @nx/gradle package not found, skipping patch application'); - process.exit(0); -} - -// Define the patches to apply -const patches = [ - // Add exec-gradle.js patches for process tracking - { - file: 'src/utils/exec-gradle.js', - modifications: [ - { - search: `function execGradleAsync(gradleBinaryPath, args, execOptions = {}) { - return new Promise((res, rej) => { - const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args, {`, - replace: `function execGradleAsync(gradleBinaryPath, args, execOptions = {}) { - const startTime = Date.now(); - console.log('šŸš€ [GRADLE EXEC] Starting Gradle process', { - binary: gradleBinaryPath, - args: args.filter(arg => arg).join(' '), - timestamp: new Date().toISOString() - }); - - return new Promise((res, rej) => { - const cp = (0, node_child_process_1.execFile)(gradleBinaryPath, args, {`, - }, - { - search: ` let stdout = Buffer.from(''); - cp.stdout?.on('data', (data) => { - stdout += data; - }); - cp.stderr?.on('data', (data) => { - stdout += data; - });`, - replace: ` let stdout = Buffer.from(''); - let totalBytes = 0; - let lastOutputTime = Date.now(); - let outputLineCount = 0; - - // Set up watchdog timer - const watchdogInterval = setInterval(() => { - const timeSinceLastOutput = Date.now() - lastOutputTime; - if (timeSinceLastOutput > 30000) { - console.warn('āš ļø [GRADLE EXEC] No output for 30+ seconds', { - timeSinceLastOutput: Math.round(timeSinceLastOutput / 1000) + 's', - totalBytes, - outputLineCount, - elapsed: Math.round((Date.now() - startTime) / 1000) + 's' - }); - } - }, 10000); - - cp.stdout?.on('data', (data) => { - stdout += data; - totalBytes += data.length; - lastOutputTime = Date.now(); - outputLineCount += (data.toString().match(/\\n/g) || []).length; - - // Log progress every 100KB - if (totalBytes % 102400 < data.length) { - console.log('šŸ“Š [GRADLE EXEC] Receiving output', { - bytes: totalBytes, - lines: outputLineCount, - elapsed: Math.round((Date.now() - startTime) / 1000) + 's', - lastChunk: data.toString().slice(-100).replace(/\\n/g, ' ') - }); - } - }); - cp.stderr?.on('data', (data) => { - stdout += data; - totalBytes += data.length; - lastOutputTime = Date.now(); - const errStr = data.toString(); - console.log('āš ļø [GRADLE EXEC] Stderr output', { - message: errStr.slice(0, 200), - bytes: data.length - }); - });`, - }, - { - search: ` cp.on('exit', (code) => { - if (code === 0) { - res(stdout); - } - else { - rej(stdout); - } - });`, - replace: ` cp.on('exit', (code) => { - clearInterval(watchdogInterval); - const elapsed = Math.round((Date.now() - startTime) / 1000); - console.log('šŸ [GRADLE EXEC] Process exited', { - code, - totalBytes, - outputLineCount, - elapsed: elapsed + 's', - success: code === 0 - }); - - if (code === 0) { - res(stdout); - } - else { - console.error('āŒ [GRADLE EXEC] Process failed', { - code, - lastOutput: stdout.toString().slice(-500) - }); - rej(stdout); - } - }); - - cp.on('error', (err) => { - clearInterval(watchdogInterval); - console.error('āŒ [GRADLE EXEC] Process error', { - error: err.message, - elapsed: Math.round((Date.now() - startTime) / 1000) + 's' - }); - rej(err); - });`, - }, - ], - }, - { - file: 'src/plugin/utils/get-project-graph-from-gradle-plugin.js', - modifications: [ - { - search: `async function populateProjectGraph(workspaceRoot, gradlewFiles, options) { - const gradleConfigHash = (0, devkit_1.hashArray)([`, - replace: `async function populateProjectGraph(workspaceRoot, gradlewFiles, options) { - console.log('šŸ” [GRADLE] Starting project graph population with hash calculation...'); - const gradleConfigHash = (0, devkit_1.hashArray)([`, - }, - { - search: ` if (projectGraphReportCache && - (!gradleCurrentConfigHash || gradleConfigHash === gradleCurrentConfigHash)) { - return; - }`, - replace: ` if (projectGraphReportCache && - (!gradleCurrentConfigHash || gradleConfigHash === gradleCurrentConfigHash)) { - console.log('šŸŽÆ [GRADLE] Using cached project graph report', { hash: gradleConfigHash }); - return; - } - console.log('šŸ“Š [GRADLE] Cache miss or hash mismatch, generating new project graph...', { - currentHash: gradleConfigHash, previousHash: gradleCurrentConfigHash, gradlewFiles: gradlewFiles.length });`, - }, - { - search: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); - return [...allLines, ...currentLines];`, - replace: ` performance.measure(\`\${gradlewFile}GetNxProjectGraphLines\`, getNxProjectGraphLinesStart.name, getNxProjectGraphLinesEnd.name); - console.log('⚔ [GRADLE] Processed gradlew file', { file: gradlewFile, - linesCount: currentLines.length, totalLines: allLines.length + currentLines.length }); - return [...allLines, ...currentLines];`, - }, - { - search: ` writeProjectGraphReportToCache(projectGraphReportCachePath, projectGraphReportCache); -}`, - replace: ` writeProjectGraphReportToCache(projectGraphReportCachePath, projectGraphReportCache); - console.log('āœ… [GRADLE] Successfully populated project graph', { - hash: gradleConfigHash, totalLines: projectGraphLines.length, - nodes: Object.keys(projectGraphReportCache.nodes || {}).length, - dependencies: projectGraphReportCache.dependencies?.length || 0 }); -}`, - }, - { - search: `function processNxProjectGraph(projectGraphLines) { - let index = 0; - let projectGraphReportForAllProjects = {`, - replace: `function processNxProjectGraph(projectGraphLines) { - let index = 0; - console.log('šŸ”„ [GRADLE] Processing project graph lines...', { totalLines: projectGraphLines.length }); - let projectGraphReportForAllProjects = {`, - }, - { - search: ` while (index < projectGraphLines.length) { - const line = projectGraphLines[index];`, - replace: ` let processedProjects = new Set(); - let lastLogTime = Date.now(); - let linesSinceLastLog = 0; - - while (index < projectGraphLines.length) { - const line = projectGraphLines[index]; - linesSinceLastLog++; - - // Log progress every 50 lines or every 5 seconds - if (linesSinceLastLog >= 50 || Date.now() - lastLogTime > 5000) { - console.log('šŸ”„ [GRADLE] Processing progress', { - currentIndex: index, - totalLines: projectGraphLines.length, - percentComplete: Math.round((index / projectGraphLines.length) * 100) + '%', - currentLine: line?.slice(0, 100), - projectsProcessed: processedProjects.size - }); - linesSinceLastLog = 0; - lastLogTime = Date.now(); - }`, - }, - { - search: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_START')) {`, - replace: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_START')) { - const projectName = line.split(' ')[1]; - if (projectName) { - processedProjects.add(projectName); - console.log('šŸ—ļø [GRADLE] Starting project batch', { - project: projectName, - lineIndex: index, - totalProcessed: processedProjects.size - }); - }`, - }, - { - search: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_END')) { - index++; - continue; - }`, - replace: ` if (line.startsWith('NX_PROJECT_GRAPH_BATCH_END')) { - const projectName = line.split(' ')[1]; - console.log('āœ“ [GRADLE] Completed project batch', { - project: projectName, - lineIndex: index - }); - index++; - continue; - }`, - }, - { - search: ` } - return projectGraphReportForAllProjects;`, - replace: ` } - - console.log('āœ… [GRADLE] Completed processing all project graph lines', { - totalProjects: processedProjects.size, - projects: Array.from(processedProjects), - nodesCount: Object.keys(projectGraphReportForAllProjects.nodes || {}).length, - dependenciesCount: projectGraphReportForAllProjects.dependencies?.length || 0 - }); - - return projectGraphReportForAllProjects;`, - }, - ], - }, - { - file: 'src/plugin/dependencies.js', - modifications: [ - { - search: `const createDependencies = async (options, context) => { - const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));`, - replace: `const createDependencies = async (options, context) => { - console.log('šŸ”— [GRADLE] Starting dependency creation...', { options }); - const files = await (0, workspace_context_1.globWithWorkspaceContext)(devkit_1.workspaceRoot, Array.from(split_config_files_1.GRALDEW_FILES));`, - }, - { - search: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); - await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);`, - replace: ` const { gradlewFiles } = (0, split_config_files_1.splitConfigFiles)(files); - console.log('šŸ“ [GRADLE] Found gradlew files', { count: gradlewFiles.length, files: gradlewFiles }); - await (0, get_project_graph_from_gradle_plugin_1.populateProjectGraph)(context.workspaceRoot, gradlewFiles.map((file) => (0, node_path_1.join)(devkit_1.workspaceRoot, file)), options);`, - }, - { - search: ` const dependencies = []; - dependenciesFromReport.forEach((dependencyFromPlugin) => {`, - replace: ` const dependencies = []; - console.log('šŸ“Š [GRADLE] Processing dependencies from report', { count: dependenciesFromReport.length }); - let processedCount = 0, skippedCount = 0; - dependenciesFromReport.forEach((dependencyFromPlugin) => {`, - }, - { - search: ` if (!sourceProjectName || - !targetProjectName || - !(0, node_fs_1.existsSync)(dependencyFromPlugin.sourceFile)) { - return; - }`, - replace: ` if (!sourceProjectName || - !targetProjectName || - !(0, node_fs_1.existsSync)(dependencyFromPlugin.sourceFile)) { - skippedCount++; - console.log('ā­ļø [GRADLE] Skipping dependency (missing project or file)', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target, sourceFile: dependencyFromPlugin.sourceFile }); - return; - }`, - }, - { - search: ` (0, devkit_1.validateDependency)(dependency, context); - dependencies.push(dependency); - }`, - replace: ` (0, devkit_1.validateDependency)(dependency, context); - dependencies.push(dependency); - processedCount++; - }`, - }, - { - search: ` catch { - devkit_1.logger.warn(\`Unable to parse dependency from gradle plugin: \${dependencyFromPlugin.source} -> \${dependencyFromPlugin.target}\`); - }`, - replace: ` catch { - skippedCount++; - console.warn('āš ļø [GRADLE] Failed to process dependency', { source: dependencyFromPlugin.source, target: dependencyFromPlugin.target }); - devkit_1.logger.warn(\`Unable to parse dependency from gradle plugin: \${dependencyFromPlugin.source} -> \${dependencyFromPlugin.target}\`); - }`, - }, - { - search: ` }); - return dependencies;`, - replace: ` }); - console.log('āœ… [GRADLE] Dependency creation completed', { processed: processedCount, skipped: skippedCount, total: dependencies.length }); - return dependencies;`, - }, - ], - }, - // Add patches for get-project-graph-lines.js - { - file: 'src/plugin/utils/get-project-graph-lines.js', - modifications: [ - { - search: `async function getNxProjectGraphLines(gradlewFile, gradleConfigHash, gradlePluginOptions) { - if (process.env.VERCEL) { - // skip on Vercel - return []; - } - let nxProjectGraphBuffer;`, - replace: `async function getNxProjectGraphLines(gradlewFile, gradleConfigHash, gradlePluginOptions) { - if (process.env.VERCEL) { - // skip on Vercel - return []; - } - console.log('šŸ“‹ [GRADLE LINES] Getting project graph lines', { - gradlewFile, - hash: gradleConfigHash, - options: gradlePluginOptions, - timestamp: new Date().toISOString() - }); - let nxProjectGraphBuffer;`, - }, - { - search: ` const projectGraphLines = nxProjectGraphBuffer - .toString() - .split(exec_gradle_1.newLineSeparator) - .filter((line) => line.trim() !== '');`, - replace: ` const outputString = nxProjectGraphBuffer.toString(); - console.log('šŸ“ [GRADLE LINES] Processing Gradle output', { - outputSize: outputString.length, - firstChars: outputString.slice(0, 200), - lastChars: outputString.slice(-200) - }); - - const allLines = outputString.split(exec_gradle_1.newLineSeparator); - console.log('šŸ“Š [GRADLE LINES] Split output into lines', { - totalLines: allLines.length, - emptyLines: allLines.filter(line => !line.trim()).length - }); - - const projectGraphLines = allLines.filter((line, index) => { - const trimmed = line.trim(); - if (!trimmed) { - return false; - } - - // Log every 100th line for progress tracking - if (index % 100 === 0) { - console.log('šŸ” [GRADLE LINES] Processing line', { - lineNumber: index, - linePreview: trimmed.slice(0, 100), - isTaskLine: trimmed.includes('task') || trimmed.includes('Task') - }); - } - - // Log specific task-related lines - if (trimmed.includes('Processing task') || trimmed.includes('Processed task')) { - console.log('šŸ“Œ [GRADLE LINES] Task line found', { - lineNumber: index, - content: trimmed - }); - } - - return true; - }); - - console.log('āœ… [GRADLE LINES] Filtered project graph lines', { - originalLines: allLines.length, - filteredLines: projectGraphLines.length, - lastLine: projectGraphLines[projectGraphLines.length - 1]?.slice(0, 100) - });`, - }, - ], - }, -]; - -// Apply patches -let patchedFiles = 0; -let failedPatches = 0; - -for (const patch of patches) { - const filePath = path.join(gradlePackagePath, patch.file); - - if (!fs.existsSync(filePath)) { - console.log(`āš ļø File not found: ${patch.file}, skipping...`); - failedPatches++; - continue; - } - - try { - let content = fs.readFileSync(filePath, 'utf-8'); - let fileModified = false; - - for (const mod of patch.modifications) { - if (content.includes(mod.search)) { - content = content.replace(mod.search, mod.replace); - fileModified = true; - } - } - - if (fileModified) { - fs.writeFileSync(filePath, content, 'utf-8'); - console.log(`āœ… Patched: ${patch.file}`); - patchedFiles++; - } else { - console.log(`ā­ļø Already patched or no matches: ${patch.file}`); - } - } catch (error) { - console.error(`āŒ Failed to patch ${patch.file}:`, error.message); - failedPatches++; - } -} - -console.log( - `\nšŸŽÆ Patch application completed: ${patchedFiles} files patched, ${failedPatches} failed`, -); - -if (patchedFiles > 0) { - console.log( - 'šŸš€ Gradle logging patches applied successfully! CI will now show comprehensive logs.', - ); -} else if (failedPatches === 0) { - console.log('šŸ“‹ All patches already applied or no files found to patch.'); -} From a9dcdde673cf06955d844029da23d53b40513d6e Mon Sep 17 00:00:00 2001 From: Louie Weng <56288712+lourw@users.noreply.github.com> Date: Wed, 17 Sep 2025 01:27:38 -0700 Subject: [PATCH 26/45] Update distribution config for changeset sizes --- .nx/workflows/linux-distribution-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index 5e9095e1ae..dc917df384 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -1,7 +1,7 @@ distribute-on: - small-changeset: 2 linux-medium-plus-js, 1 linux-large-js - medium-changeset: 3 linux-medium-plus-js, 1 linux-large-js - large-changeset: 6 linux-medium-plus-js, 1 linux-large-js + small-changeset: 3 linux-large-js + medium-changeset: 4 linux-large-js + large-changeset: 6 linux-large-js assignment-rules: - projects: From 112f3dd1ece8ea1f2d48420d2af43f927d54c89f Mon Sep 17 00:00:00 2001 From: Louie Weng <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 08:10:25 -0700 Subject: [PATCH 27/45] Remove Gradlew Wrapper step from agents.yaml Removed Gradlew Wrapper step from agents workflow. --- .nx/workflows/agents.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 83b7af1482..3dd98e8151 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -29,8 +29,6 @@ common-init-steps: &common-init-steps uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - - name: Gradlew Wrapper - script: ./gradlew wrapper launch-templates: linux-medium-plus-js: From 0bcbc2622b4a85d0a178a1dedb1c134e9790654f Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:34:05 -0700 Subject: [PATCH 28/45] chore(repo): update tasks --- build.gradle.kts | 14 +------------- libs/intellij/models/build.gradle.kts | 1 - settings.gradle.kts | 1 + 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0595279d35..8a0216bc3c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.7" + id("dev.nx.gradle.project-graph") version "0.1.8" } allprojects { @@ -13,13 +13,6 @@ allprojects { } tasks { - register("projectReportAll") { - // All project reports of subprojects - allprojects.forEach { dependsOn(it.tasks.get("projectReport")) } - - // All projectReportAll of included builds - gradle.includedBuilds.forEach { dependsOn(it.task(":projectReportAll")) } - } register("publish") { group = "publish" description = "Placeholder task to workaround the semantic-release plugin" @@ -38,9 +31,4 @@ tasks { println("Compiled test classes for ${gradle.includedBuilds.size} included builds") } } - - register("publish") { - description = "Placeholder task to workaround the semantic-release plugin" - group = "publishing" - } } diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index ee1048117b..a8b1c9cad4 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -34,7 +34,6 @@ dependencies { ) pluginVerifier() zipSigner() - instrumentationTools() } } diff --git a/settings.gradle.kts b/settings.gradle.kts index b411974234..0db6396da7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,4 +4,5 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" includeBuild("apps/intellij") +includeBuild("/Users/lourw/nrwl/nx/packages/gradle/project-graph") From 26be2a33993cbe19b9949dc79b0a2fd2ebdf6989 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:44:17 -0700 Subject: [PATCH 29/45] chore(repo): remove build --- .github/CODEOWNERS | 2 ++ settings.gradle.kts | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6290077188..5fcdf38e42 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,6 +12,8 @@ /libs/vscode/nx-cloud-onboarding-webview/ @MaxKless +/../../nx/packages/gradle/project-graph/ @MaxKless + /libs/vscode/nx-help-and-feedback-view/ @MaxKless /libs/vscode/typescript-import-plugin/ @MaxKless diff --git a/settings.gradle.kts b/settings.gradle.kts index 0db6396da7..fcfc81474d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,6 +3,3 @@ rootProject.name = "nx-console" plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" } includeBuild("apps/intellij") - -includeBuild("/Users/lourw/nrwl/nx/packages/gradle/project-graph") - From 2d658a64ac34ce209a333eba1f69ff7a28329c02 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:56:23 -0700 Subject: [PATCH 30/45] chore(repo): move gradle home --- .nx/workflows/agents.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 3dd98e8151..7d212a5fbc 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -1,3 +1,5 @@ +common-env: &common-env + GRADLE_USER_HOME: ~/workspace/.gradle common-init-steps: &common-init-steps - name: Checkout uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' @@ -34,10 +36,12 @@ launch-templates: linux-medium-plus-js: resource-class: 'docker_linux_amd64/medium+' image: 'ubuntu22.04-node20.11-v10' + env: *common-env init-steps: *common-init-steps linux-large-js: resource-class: 'docker_linux_amd64/large' image: 'ubuntu22.04-node20.11-v10' + env: *common-env init-steps: *common-init-steps # windows-medium-js: # resource-class: 'windows/medium' From cf5723b04347252562ad671f267bc7e0de64a806 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:22:02 -0700 Subject: [PATCH 31/45] chore(repo): update gradle deps step --- .nx/workflows/agents.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 7d212a5fbc..7a46db2057 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -27,6 +27,8 @@ common-init-steps: &common-init-steps - group-name: Install Dependencies parallel: true steps: + - name: Install Gradle Dependencies + script: ./gradlew dependencies - name: Install Node Modules uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) From 3d33b2a8284c440d23e1c2b088670b297657d84d Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:37:13 -0700 Subject: [PATCH 32/45] chore(repo): fix agents --- .github/CODEOWNERS | 2 -- .github/workflows/ci_checks.yml | 15 ++------------- .nx/workflows/agents.yaml | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5fcdf38e42..6290077188 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,8 +12,6 @@ /libs/vscode/nx-cloud-onboarding-webview/ @MaxKless -/../../nx/packages/gradle/project-graph/ @MaxKless - /libs/vscode/nx-help-and-feedback-view/ @MaxKless /libs/vscode/typescript-import-plugin/ @MaxKless diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 5e5a2348d3..2547b970b3 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -20,17 +20,6 @@ jobs: NX_CI_EXECUTION_ENV: 'linux' NX_VERBOSE_LOGGING: true steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # we just need a little bit more space, we save CI time by not deleting everything - tool-cache: false - dotnet: false - haskell: true - large-packages: false - docker-images: false - swap-storage: false - - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -73,8 +62,8 @@ jobs: - name: Install NPM dependencies run: yarn install --immutable - - name: Setup Gradle Wrapper - run: ./gradlew wrapper --info + - name: Setup Gradle Dependencies + run: ./gradlew dependencies # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction # and we do not want to give the false impression that the artifact download time is part of nx commands. diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 7a46db2057..4b3742857a 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -1,5 +1,5 @@ common-env: &common-env - GRADLE_USER_HOME: ~/workspace/.gradle + NX_VERBOSE_LOGGING: true common-init-steps: &common-init-steps - name: Checkout uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml' From 34a38fba20c7f1207290f8e2ab2ad96daa4aceb4 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 12:36:59 -0700 Subject: [PATCH 33/45] chore(gradle): bump plugin --- .github/CODEOWNERS | 2 ++ apps/intellij/build.gradle.kts | 1 - libs/intellij/models/build.gradle.kts | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6290077188..5fcdf38e42 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,6 +12,8 @@ /libs/vscode/nx-cloud-onboarding-webview/ @MaxKless +/../../nx/packages/gradle/project-graph/ @MaxKless + /libs/vscode/nx-help-and-feedback-view/ @MaxKless /libs/vscode/typescript-import-plugin/ @MaxKless diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 9dbc52a663..53247001ab 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -40,7 +40,6 @@ repositories { mavenLocal() mavenCentral() gradlePluginPortal() - intellijPlatform { defaultRepositories() } } diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index a8b1c9cad4..9f3ed67bfc 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -25,7 +25,9 @@ repositories { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0") intellijPlatform { - intellijIdeaUltimate(providers.gradleProperty("platformVersion")) + intellijIdea(providers.gradleProperty("platformVersion")) { + useCache = true + } bundledPlugins( providers.gradleProperty("platformPlugins").map { plugins -> From 70f96286ef3b1d1a3df48ce9e77244e39163e4bd Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:00:43 -0700 Subject: [PATCH 34/45] chore(gradle): bump plugin version --- .github/CODEOWNERS | 2 -- apps/intellij/build.gradle.kts | 9 +++++++-- apps/intellij/gradle.properties | 1 + libs/intellij/models/build.gradle.kts | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5fcdf38e42..6290077188 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,8 +12,6 @@ /libs/vscode/nx-cloud-onboarding-webview/ @MaxKless -/../../nx/packages/gradle/project-graph/ @MaxKless - /libs/vscode/nx-help-and-feedback-view/ @MaxKless /libs/vscode/typescript-import-plugin/ @MaxKless diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 53247001ab..8122015f6c 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -75,8 +75,13 @@ dependencies { testImplementation("junit:junit:4.13.2") intellijPlatform { - intellijIdeaUltimate(providers.gradleProperty("platformVersion")) - plugin("com.intellij.ml.llm:252.25557.171") + val type = providers.gradleProperty("platformType") + val version = providers.gradleProperty("platformVersion") + create(type, version) { + useCache = true + } + + plugin("com.intellij.ml.llm:252.25557.171") bundledPlugins( providers.gradleProperty("platformPlugins").map { plugins -> plugins.split(',').map(String::trim).filter(String::isNotEmpty) diff --git a/apps/intellij/gradle.properties b/apps/intellij/gradle.properties index e1da188432..5a32fba8cf 100644 --- a/apps/intellij/gradle.properties +++ b/apps/intellij/gradle.properties @@ -7,6 +7,7 @@ version=0.0.1 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild=252 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension +platformType=IU platformVersion=2025.2.1 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 9f3ed67bfc..83dbd7f3b6 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -25,7 +25,9 @@ repositories { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0") intellijPlatform { - intellijIdea(providers.gradleProperty("platformVersion")) { + val type = providers.gradleProperty("platformType") + val version = providers.gradleProperty("platformVersion") + create(type, version) { useCache = true } From 3920296e8d53f0791daf435f10eda8f533c874d2 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:15:07 -0700 Subject: [PATCH 35/45] chore(repo): fix agents --- .nx/workflows/agents.yaml | 4 ++-- .nx/workflows/linux-distribution-config.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 4b3742857a..a18d331b02 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -40,8 +40,8 @@ launch-templates: image: 'ubuntu22.04-node20.11-v10' env: *common-env init-steps: *common-init-steps - linux-large-js: - resource-class: 'docker_linux_amd64/large' + linux-large-plus-js: + resource-class: 'docker_linux_amd64/large+' image: 'ubuntu22.04-node20.11-v10' env: *common-env init-steps: *common-init-steps diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index dc917df384..3a20077a32 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -1,7 +1,7 @@ distribute-on: - small-changeset: 3 linux-large-js - medium-changeset: 4 linux-large-js - large-changeset: 6 linux-large-js + small-changeset: 3 linux-large-plus-js + medium-changeset: 4 linux-large-plus-js + large-changeset: 6 linux-large-plus-js assignment-rules: - projects: From 4a2103d6c322c12277f6470f8191ee03e80aba2d Mon Sep 17 00:00:00 2001 From: Louie Weng <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:17:57 -0700 Subject: [PATCH 36/45] Apply suggestions from code review --- .nx/workflows/linux-distribution-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nx/workflows/linux-distribution-config.yaml b/.nx/workflows/linux-distribution-config.yaml index 3a20077a32..7fa6142c3f 100644 --- a/.nx/workflows/linux-distribution-config.yaml +++ b/.nx/workflows/linux-distribution-config.yaml @@ -7,5 +7,5 @@ assignment-rules: - projects: - intellij runs-on: - - linux-large-js + - linux-large-plus-js parallelism: 1 From 9f4b3f90c6deff9078d78608df889aca8827cf0e Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:41:39 -0700 Subject: [PATCH 37/45] chore(repo): ci fixes --- .github/workflows/ci_checks.yml | 9 --------- .nx/workflows/agents.yaml | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 2547b970b3..5b2bb97f63 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -65,15 +65,6 @@ jobs: - name: Setup Gradle Dependencies run: ./gradlew dependencies - # We intentionally put the gradle tasks first because their artifacts are needed for project graph construction - # and we do not want to give the false impression that the artifact download time is part of nx commands. - - name: Gradle artifacts - run: | - yarn nx-cloud record -- ./gradlew nxProjectReport --info - - - name: Verify Nx project graph - run: yarn nx show projects - - name: Check formatting run: | yarn nx-cloud record -- yarn nx format:check --verbose diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index a18d331b02..8ef73b9b5e 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -33,6 +33,8 @@ common-init-steps: &common-init-steps uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - name: Install Browsers (if needed) uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' + - name: Project graph + script: ./gradlew nxProjectReport --info launch-templates: linux-medium-plus-js: From 5ebe29b1449197654f0d59e729a83781e5303f34 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:30:53 -0700 Subject: [PATCH 38/45] chore(repo): reorganize gradle --- apps/intellij/build.gradle.kts | 11 +------- apps/intellij/settings.gradle.kts | 1 - build.gradle.kts | 27 +++++++++---------- .../gradle.properties => gradle.properties | 0 settings.gradle.kts | 6 ++++- 5 files changed, 19 insertions(+), 26 deletions(-) rename apps/intellij/gradle.properties => gradle.properties (100%) diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 8122015f6c..673b08e24d 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -25,13 +25,12 @@ plugins { id("org.jetbrains.changelog") version "2.4.0" id("com.ncorti.ktfmt.gradle") version "0.24.0" - id("dev.nx.gradle.project-graph") version "0.1.5" + id("dev.nx.gradle.project-graph") version "0.1.8" } group = providers.gradleProperty("pluginGroup").get() - version = providers.gradleProperty("version").get() @@ -43,14 +42,6 @@ repositories { intellijPlatform { defaultRepositories() } } -allprojects { - apply { - plugin("dev.nx.gradle.project-graph") - plugin("org.jetbrains.kotlin.jvm") - plugin("com.ncorti.ktfmt.gradle") - } -} - configurations.all { exclude("org.slf4j", "slf4j-api") exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk7") diff --git a/apps/intellij/settings.gradle.kts b/apps/intellij/settings.gradle.kts index b8859bc4ec..16bca142ed 100644 --- a/apps/intellij/settings.gradle.kts +++ b/apps/intellij/settings.gradle.kts @@ -1,5 +1,4 @@ rootProject.name = "intellij-app" include("libs:intellij:models") - project(":libs:intellij:models").projectDir = file("../../libs/intellij/models") diff --git a/build.gradle.kts b/build.gradle.kts index 8a0216bc3c..d1dae12374 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,11 +4,24 @@ layout.buildDirectory = File("dist") plugins { id("dev.nx.gradle.project-graph") version "0.1.8" + id("com.ncorti.ktfmt.gradle") version "0.11.0" + + // Java support + id("java") + // Kotlin support + id("org.jetbrains.kotlin.jvm") version "2.0.21" + // Kotlin serialization + id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21" + // Gradle IntelliJ Platform Plugin + id("org.jetbrains.intellij.platform") version "2.9.0" } allprojects { apply { plugin("dev.nx.gradle.project-graph") + plugin("com.ncorti.ktfmt.gradle") + plugin("org.jetbrains.kotlin.jvm") + plugin("org.jetbrains.intellij.platform") } } @@ -17,18 +30,4 @@ tasks { group = "publish" description = "Placeholder task to workaround the semantic-release plugin" } - - register("clean") { - description = "Cleans all included builds" - dependsOn(gradle.includedBuilds.map { it.task(":clean") }) - doLast { println("Cleaned ${gradle.includedBuilds.size} included builds") } - } - - register("testClasses") { - description = "Compiles test classes for all included builds" - dependsOn(gradle.includedBuilds.map { it.task(":testClasses") }) - doLast { - println("Compiled test classes for ${gradle.includedBuilds.size} included builds") - } - } } diff --git a/apps/intellij/gradle.properties b/gradle.properties similarity index 100% rename from apps/intellij/gradle.properties rename to gradle.properties diff --git a/settings.gradle.kts b/settings.gradle.kts index fcfc81474d..b8eefcacca 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,4 +2,8 @@ rootProject.name = "nx-console" plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" } -includeBuild("apps/intellij") +include("intellij-models") +project(":intellij-models").projectDir = file("libs/intellij/models") + +include("intellij") +project(":intellij").projectDir = file("apps/intellij") From 9a6178248079b04edb9add21147adf7ff0c7a7ef Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Fri, 19 Sep 2025 00:55:58 -0700 Subject: [PATCH 39/45] chore(gradle): exclude path --- apps/intellij/project.json | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/intellij/project.json b/apps/intellij/project.json index 372cdc187c..36607589bc 100644 --- a/apps/intellij/project.json +++ b/apps/intellij/project.json @@ -3,28 +3,24 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "targets": { - "build": { - "command": "yarn nx run intellij:buildPlugin", - "configurations": { - "production-intellij": {} - }, - "dependsOn": ["^build"] - }, - "runIde": { - "dependsOn": ["^build"] + "initializeIntellijPlatformPlugin": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"] }, "verifyPlugin": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"], "cache": true }, - "ktfmtFormat": { - "//": "TODO: remove this after gradle refactor, probably fixed with different build setup", - "cache": false + "compileJava": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"] + }, + "compileTestJava": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"] }, - "test": { - "command": "yarn nx run intellij:check" + "verifyPluginProjectConfiguration": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"] }, - "lint": { - "executor": "nx:noop" + "javadoc": { + "inputs": ["!{workspaceRoot}/.intellijPlatform"] }, "x-lint": { "//": "Run inspections take a long time on the CI. Disable for now", From 2345fab88cb4edffc33de685ec53c7e085f7cb7c Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Fri, 19 Sep 2025 01:06:38 -0700 Subject: [PATCH 40/45] chore(gradle): remove intellij from models --- apps/intellij/project.json | 3 +++ libs/intellij/models/build.gradle.kts | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/intellij/project.json b/apps/intellij/project.json index 36607589bc..eb8ecf1698 100644 --- a/apps/intellij/project.json +++ b/apps/intellij/project.json @@ -6,6 +6,9 @@ "initializeIntellijPlatformPlugin": { "inputs": ["!{workspaceRoot}/.intellijPlatform"] }, + "runInspections": { + "inputs": ["!{projectRoot}/.intellijPlatform"] + }, "verifyPlugin": { "inputs": ["!{workspaceRoot}/.intellijPlatform"], "cache": true diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 83dbd7f3b6..359048bc19 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -1,8 +1,6 @@ plugins { // Java support id("java-library") - id("org.jetbrains.kotlin.jvm") version "2.2.0" - // Kotlin serialization id("org.jetbrains.kotlin.plugin.serialization") version "2.2.0" // Gradle IntelliJ Platform Plugin From 5efca28cabf1c84698ae2e7fd0f0e5ab7442d94d Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Fri, 19 Sep 2025 01:29:27 -0700 Subject: [PATCH 41/45] chore(gradle): simplify more --- apps/intellij/build.gradle.kts | 6 ++---- build.gradle.kts | 1 - libs/intellij/models/build.gradle.kts | 22 +++++++--------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 673b08e24d..a0512c1930 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -7,9 +7,9 @@ fun isWindows(): Boolean { return System.getProperty("os.name").lowercase().startsWith("windows") } -val nxlsRoot = "${rootDir}/../../dist/apps/nxls" +val nxlsRoot = "${rootDir}/dist/apps/nxls" -layout.buildDirectory = file("${rootDir}/../../dist/apps/intellij") +layout.buildDirectory = file("${rootDir}/dist/apps/intellij") plugins { // Java support @@ -26,8 +26,6 @@ plugins { id("com.ncorti.ktfmt.gradle") version "0.24.0" id("dev.nx.gradle.project-graph") version "0.1.8" - - } group = providers.gradleProperty("pluginGroup").get() diff --git a/build.gradle.kts b/build.gradle.kts index d1dae12374..0824ade5d8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,6 @@ plugins { id("org.jetbrains.kotlin.jvm") version "2.0.21" // Kotlin serialization id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21" - // Gradle IntelliJ Platform Plugin id("org.jetbrains.intellij.platform") version "2.9.0" } diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 359048bc19..8a2d33c9b6 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -16,29 +16,21 @@ repositories { mavenLocal() mavenCentral() gradlePluginPortal() - intellijPlatform { defaultRepositories() } } dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0") - intellijPlatform { - val type = providers.gradleProperty("platformType") - val version = providers.gradleProperty("platformVersion") - create(type, version) { - useCache = true - } + implementation("com.google.code.gson:gson:2.10.1") - bundledPlugins( - providers.gradleProperty("platformPlugins").map { plugins -> - plugins.split(',').map(String::trim).filter(String::isNotEmpty) - } - ) - pluginVerifier() - zipSigner() + intellijPlatform { + val type = providers.gradleProperty("platformType") + val version = providers.gradleProperty("platformVersion") + create(type, version) { + useCache = true + } } } ktfmt { kotlinLangStyle() } - kotlin { jvmToolchain(21) } From 732c46fe0526d20b84694ab228bfc600c0ebb14a Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Fri, 19 Sep 2025 02:23:17 -0700 Subject: [PATCH 42/45] chore(gradle): ignore paths --- .nx/workflows/agents.yaml | 10 +++---- apps/intellij/build.gradle.kts | 32 +++++----------------- apps/intellij/project.json | 22 --------------- apps/intellij/settings.gradle.kts | 5 ++-- build.gradle.kts | 39 ++++++++++++++------------- libs/intellij/models/build.gradle.kts | 22 +++++---------- settings.gradle.kts | 2 ++ 7 files changed, 42 insertions(+), 90 deletions(-) diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml index 8ef73b9b5e..536c4e3dc1 100644 --- a/.nx/workflows/agents.yaml +++ b/.nx/workflows/agents.yaml @@ -27,14 +27,12 @@ common-init-steps: &common-init-steps - group-name: Install Dependencies parallel: true steps: - - name: Install Gradle Dependencies - script: ./gradlew dependencies - name: Install Node Modules uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml' - - name: Install Browsers (if needed) - uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' - - name: Project graph - script: ./gradlew nxProjectReport --info + - name: Generate workspace data + script: npx nx show projects + - name: Install Browsers + uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-browsers/main.yaml' launch-templates: linux-medium-plus-js: diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index a0512c1930..7703551aee 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -12,33 +12,17 @@ val nxlsRoot = "${rootDir}/dist/apps/nxls" layout.buildDirectory = file("${rootDir}/dist/apps/intellij") plugins { - // Java support id("java") - // Kotlin support - id("org.jetbrains.kotlin.jvm") version "2.2.0" - // Kotlin serialization - id("org.jetbrains.kotlin.plugin.serialization") version "2.2.0" - // Gradle IntelliJ Platform Plugin - id("org.jetbrains.intellij.platform") version "2.9.0" - - // Gradle Changelog Plugin id("org.jetbrains.changelog") version "2.4.0" - - id("com.ncorti.ktfmt.gradle") version "0.24.0" - id("dev.nx.gradle.project-graph") version "0.1.8" + id("org.jetbrains.intellij.platform") version "2.9.0" } group = providers.gradleProperty("pluginGroup").get() -version = providers.gradleProperty("version").get() +version = providers.gradleProperty("version").get() // Configure project's dependencies -repositories { - mavenLocal() - mavenCentral() - gradlePluginPortal() - intellijPlatform { defaultRepositories() } -} +repositories { intellijPlatform { defaultRepositories() } } configurations.all { exclude("org.slf4j", "slf4j-api") @@ -64,13 +48,11 @@ dependencies { testImplementation("junit:junit:4.13.2") intellijPlatform { - val type = providers.gradleProperty("platformType") - val version = providers.gradleProperty("platformVersion") - create(type, version) { - useCache = true - } + val type = providers.gradleProperty("platformType") + val version = providers.gradleProperty("platformVersion") + create(type, version) { useCache = true } - plugin("com.intellij.ml.llm:252.25557.171") + plugin("com.intellij.ml.llm:252.25557.171") bundledPlugins( providers.gradleProperty("platformPlugins").map { plugins -> plugins.split(',').map(String::trim).filter(String::isNotEmpty) diff --git a/apps/intellij/project.json b/apps/intellij/project.json index eb8ecf1698..a1b4a7b489 100644 --- a/apps/intellij/project.json +++ b/apps/intellij/project.json @@ -3,28 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "targets": { - "initializeIntellijPlatformPlugin": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"] - }, - "runInspections": { - "inputs": ["!{projectRoot}/.intellijPlatform"] - }, - "verifyPlugin": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"], - "cache": true - }, - "compileJava": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"] - }, - "compileTestJava": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"] - }, - "verifyPluginProjectConfiguration": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"] - }, - "javadoc": { - "inputs": ["!{workspaceRoot}/.intellijPlatform"] - }, "x-lint": { "//": "Run inspections take a long time on the CI. Disable for now", "executor": "nx:run-commands", diff --git a/apps/intellij/settings.gradle.kts b/apps/intellij/settings.gradle.kts index 16bca142ed..d650a881ce 100644 --- a/apps/intellij/settings.gradle.kts +++ b/apps/intellij/settings.gradle.kts @@ -1,4 +1,5 @@ rootProject.name = "intellij-app" -include("libs:intellij:models") -project(":libs:intellij:models").projectDir = file("../../libs/intellij/models") +include("intellij-models") + +project(":intellij-models").projectDir = file("../../libs/intellij/models") diff --git a/build.gradle.kts b/build.gradle.kts index 0824ade5d8..acfa173daa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,30 +3,31 @@ group = "dev.nx.console" layout.buildDirectory = File("dist") plugins { - id("dev.nx.gradle.project-graph") version "0.1.8" - id("com.ncorti.ktfmt.gradle") version "0.11.0" + id("dev.nx.gradle.project-graph") version "0.1.8" + id("com.ncorti.ktfmt.gradle") version "0.24.0" - // Java support - id("java") - // Kotlin support - id("org.jetbrains.kotlin.jvm") version "2.0.21" - // Kotlin serialization - id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21" - id("org.jetbrains.intellij.platform") version "2.9.0" + id("org.jetbrains.kotlin.jvm") version "2.2.0" + id("org.jetbrains.kotlin.plugin.serialization") version "2.2.0" } allprojects { - apply { - plugin("dev.nx.gradle.project-graph") - plugin("com.ncorti.ktfmt.gradle") - plugin("org.jetbrains.kotlin.jvm") - plugin("org.jetbrains.intellij.platform") - } + repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() + } + + apply { + plugin("dev.nx.gradle.project-graph") + plugin("com.ncorti.ktfmt.gradle") + plugin("org.jetbrains.kotlin.jvm") + plugin("org.jetbrains.kotlin.plugin.serialization") + } } tasks { - register("publish") { - group = "publish" - description = "Placeholder task to workaround the semantic-release plugin" - } + register("publish") { + group = "publish" + description = "Placeholder task to workaround the semantic-release plugin" + } } diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 8a2d33c9b6..0e5ee303ab 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -1,10 +1,6 @@ plugins { - // Java support id("java-library") - // Kotlin serialization - id("org.jetbrains.kotlin.plugin.serialization") version "2.2.0" - // Gradle IntelliJ Platform Plugin - id("org.jetbrains.intellij.platform.module") + id("org.jetbrains.intellij.platform") version "2.9.0" } group = providers.gradleProperty("pluginGroup").get() @@ -12,25 +8,19 @@ group = providers.gradleProperty("pluginGroup").get() version = providers.gradleProperty("version").get() // Configure project's dependencies -repositories { - mavenLocal() - mavenCentral() - gradlePluginPortal() - intellijPlatform { defaultRepositories() } -} +repositories { intellijPlatform { defaultRepositories() } } dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0") implementation("com.google.code.gson:gson:2.10.1") intellijPlatform { - val type = providers.gradleProperty("platformType") - val version = providers.gradleProperty("platformVersion") - create(type, version) { - useCache = true - } + val type = providers.gradleProperty("platformType") + val version = providers.gradleProperty("platformVersion") + create(type, version) { useCache = true } } } ktfmt { kotlinLangStyle() } + kotlin { jvmToolchain(21) } diff --git a/settings.gradle.kts b/settings.gradle.kts index b8eefcacca..268fb781b0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,7 +3,9 @@ rootProject.name = "nx-console" plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" } include("intellij-models") + project(":intellij-models").projectDir = file("libs/intellij/models") include("intellij") + project(":intellij").projectDir = file("apps/intellij") From 935b976fc032127aed92db3fdbe504301dfcf225 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 23 Sep 2025 13:24:24 +0200 Subject: [PATCH 43/45] build with 2025.2.2 --- .github/workflows/ci_checks.yml | 2 +- apps/intellij/build.gradle.kts | 2 +- apps/intellij/project.json | 7 ------- .../src/main/kotlin/dev/nx/console/llm/FixCIPEService.kt | 3 +-- gradle.properties | 2 +- libs/intellij/models/build.gradle.kts | 4 +++- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 5b2bb97f63..53d0d7d9b3 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -68,7 +68,7 @@ jobs: - name: Check formatting run: | yarn nx-cloud record -- yarn nx format:check --verbose - yarn nx-cloud record -- yarn nx run-many -t ktfmtFormatTest + yarn nx-cloud record -- yarn nx run-many -t ktfmtFormat - name: Ensure the workspace configuration is in sync run: yarn nx-cloud record -- yarn nx sync:check diff --git a/apps/intellij/build.gradle.kts b/apps/intellij/build.gradle.kts index 7703551aee..3fba437a79 100644 --- a/apps/intellij/build.gradle.kts +++ b/apps/intellij/build.gradle.kts @@ -52,7 +52,7 @@ dependencies { val version = providers.gradleProperty("platformVersion") create(type, version) { useCache = true } - plugin("com.intellij.ml.llm:252.25557.171") + plugin("com.intellij.ml.llm:252.26199.169") bundledPlugins( providers.gradleProperty("platformPlugins").map { plugins -> plugins.split(',').map(String::trim).filter(String::isNotEmpty) diff --git a/apps/intellij/project.json b/apps/intellij/project.json index a1b4a7b489..b3bd2e5594 100644 --- a/apps/intellij/project.json +++ b/apps/intellij/project.json @@ -3,13 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "targets": { - "x-lint": { - "//": "Run inspections take a long time on the CI. Disable for now", - "executor": "nx:run-commands", - "options": { - "command": "node ./apps/intellij/run-gradle.js :apps:intellij:runInspections" - } - }, "semantic-release": { "executor": "@theunderscorer/nx-semantic-release:semantic-release", "options": { diff --git a/apps/intellij/src/main/kotlin/dev/nx/console/llm/FixCIPEService.kt b/apps/intellij/src/main/kotlin/dev/nx/console/llm/FixCIPEService.kt index 7abbf0c8aa..7a3e74fafe 100644 --- a/apps/intellij/src/main/kotlin/dev/nx/console/llm/FixCIPEService.kt +++ b/apps/intellij/src/main/kotlin/dev/nx/console/llm/FixCIPEService.kt @@ -44,8 +44,7 @@ class FixCIPEService(private val project: Project, private val cs: CoroutineScop .createChatSession( ChatCreationContext( origin = ChatOrigin.CustomIntention, - sourceActionForStatistic = ChatSessionStorage.SourceAction.NEW_CHAT, - null, + sourceActionForStatistic = ChatSourceAction.NEW_CHAT, ) ) chatSession.setActiveMode(ChatSessionMode.CODE_GENERATION) diff --git a/gradle.properties b/gradle.properties index 5a32fba8cf..c8ec5d9ac1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ version=0.0.1 pluginSinceBuild=252 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType=IU -platformVersion=2025.2.1 +platformVersion=2025.2.2 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 platformPlugins=JavaScript, org.jetbrains.plugins.terminal, AngularJS, com.intellij.modules.json, Git4Idea diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 0e5ee303ab..270215e421 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType + plugins { id("java-library") id("org.jetbrains.intellij.platform") version "2.9.0" @@ -15,8 +17,8 @@ dependencies { implementation("com.google.code.gson:gson:2.10.1") intellijPlatform { - val type = providers.gradleProperty("platformType") val version = providers.gradleProperty("platformVersion") + val type = providers.gradleProperty("platformType") create(type, version) { useCache = true } } } From c35c5fc76f6d8c4abb39780f134329ee832c00e8 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Tue, 23 Sep 2025 17:12:19 +0200 Subject: [PATCH 44/45] format & buildPlugin in CI --- .github/workflows/ci_checks.yml | 2 +- libs/intellij/models/build.gradle.kts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 53d0d7d9b3..7449bb7f66 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -78,7 +78,7 @@ jobs: # todo(cammisuli): disable verifyPlugin for now as its constantly failing on CI # - run: yarn nx affected --targets=lint,test,build,e2e-ci,typecheck,verifyPlugin,telemetry-check --configuration=ci --exclude=nx-console --parallel=3 - - run: yarn nx affected --targets=lint,test,build,e2e-ci,typecheck,telemetry-check --configuration=ci --exclude=nx-console --parallel=3 + - run: yarn nx affected --targets=lint,test,build,e2e-ci,typecheck,telemetry-check,buildPlugin --configuration=ci --exclude=nx-console --parallel=3 timeout-minutes: 60 - run: npx nx-cloud fix-ci diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 270215e421..638b7aba5f 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType - plugins { id("java-library") id("org.jetbrains.intellij.platform") version "2.9.0" From ed930bc9975030843a7df9f94ebf7debc46e3079 Mon Sep 17 00:00:00 2001 From: lourw <56288712+lourw@users.noreply.github.com> Date: Tue, 23 Sep 2025 12:27:04 -0700 Subject: [PATCH 45/45] chore(repo): add semver4j --- apps/intellij/project.json | 7 +++++++ libs/intellij/models/build.gradle.kts | 14 +++----------- .../main/kotlin/dev/nx/console/models/NxVersion.kt | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/intellij/project.json b/apps/intellij/project.json index b3bd2e5594..c9edaac9cb 100644 --- a/apps/intellij/project.json +++ b/apps/intellij/project.json @@ -3,6 +3,13 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "targets": { + "composedJar": { + "executor": "@nx/gradle:gradle", + "options": { + "taskName": ":intellij:composedJar", + "excludeDependsOn": false + } + }, "semantic-release": { "executor": "@theunderscorer/nx-semantic-release:semantic-release", "options": { diff --git a/libs/intellij/models/build.gradle.kts b/libs/intellij/models/build.gradle.kts index 638b7aba5f..41c7c8f214 100644 --- a/libs/intellij/models/build.gradle.kts +++ b/libs/intellij/models/build.gradle.kts @@ -1,24 +1,16 @@ -plugins { - id("java-library") - id("org.jetbrains.intellij.platform") version "2.9.0" -} +plugins { id("java-library") } group = providers.gradleProperty("pluginGroup").get() version = providers.gradleProperty("version").get() // Configure project's dependencies -repositories { intellijPlatform { defaultRepositories() } } +repositories { mavenCentral() } dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0") implementation("com.google.code.gson:gson:2.10.1") - - intellijPlatform { - val version = providers.gradleProperty("platformVersion") - val type = providers.gradleProperty("platformType") - create(type, version) { useCache = true } - } + implementation("org.semver4j:semver4j:6.0.0") } ktfmt { kotlinLangStyle() } diff --git a/libs/intellij/models/src/main/kotlin/dev/nx/console/models/NxVersion.kt b/libs/intellij/models/src/main/kotlin/dev/nx/console/models/NxVersion.kt index 2dc0b6277a..5a93a1bb2f 100644 --- a/libs/intellij/models/src/main/kotlin/dev/nx/console/models/NxVersion.kt +++ b/libs/intellij/models/src/main/kotlin/dev/nx/console/models/NxVersion.kt @@ -1,7 +1,7 @@ package dev.nx.console.models -import com.intellij.util.text.SemVer import kotlinx.serialization.Serializable +import org.semver4j.Semver @Serializable() data class NxVersion(val minor: Int, val major: Int, val full: String) { @@ -12,8 +12,8 @@ data class NxVersion(val minor: Int, val major: Int, val full: String) { if (other.full.startsWith("0.0.0-pr-")) { return false } - val semVerThis = SemVer.parseFromText(this.full) - val semVerOther = SemVer.parseFromText(other.full) + val semVerThis = Semver.parse(this.full) + val semVerOther = Semver.parse(other.full) if (semVerThis != null && semVerOther != null) { return semVerThis >= semVerOther }