Skip to content

Commit

Permalink
revert: add @nx/gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Apr 23, 2024
1 parent e1c30db commit dc0647e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
node_version: 18
node_version: 20

jobs:
main-linux:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
npx nx-cloud record -- ./gradlew ktfmtCheck
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: false
- run: npx nx affected --t=lint,test,build,e2e --configuration=ci --exclude=nx-console
- run: yarn nx affected --t=lint,test,build,e2e --configuration=ci --exclude=nx-console --verbose
main-windows:
name: Main Windows
runs-on: windows-latest
Expand Down Expand Up @@ -71,13 +71,13 @@ jobs:
cache: yarn
- run: yarn install --immutable
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.5
uses: gradle/wrapper-validation-action@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: gradle
# there's no need to check formatting & linting again on windows
- run: npx nx affected --t=test,build,e2e --configuration=ci --exclude=nx-console
- run: yarn nx affected --t=test,build,e2e --configuration=ci --exclude=nx-console --verbose
timeout-minutes: 45
23 changes: 19 additions & 4 deletions apps/intellij/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,31 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"targets": {
"runIde": {
"executor": "nx:run-commands",
"options": {
"command": "node ./apps/intellij/run-gradle.js:apps:intellij:runIde"
}
},
"build": {
"command": "yarn nx run intellij:buildPlugin",
"inputs": ["kotlin"],
"outputs": ["{workspaceRoot}/dist/apps/intellij/distributions"],
"executor": "nx:run-commands",
"options": {
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:buildPlugin"
},
"configurations": {
"production-intellij": {}
},
"dependsOn": ["^build"]
},
"test": {
"command": "yarn nx run intellij:check",
"dependsOn": []
"inputs": ["kotlin"],
"outputs": ["{workspaceRoot}/dist/apps/intellij/reports/tests"],
"executor": "nx:run-commands",
"options": {
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:check"
}
},
"lint": {
"executor": "nx:noop"
Expand All @@ -21,7 +36,7 @@
"//": "Run inspections take a long time on the CI. Disable for now",
"executor": "nx:run-commands",
"options": {
"command": "yarn nx run intellij:runInspections"
"command": "node ./apps/intellij/run-gradle.js :apps:intellij:runInspections"
}
},
"semantic-release": {
Expand Down
17 changes: 17 additions & 0 deletions apps/intellij/run-gradle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { spawn } = require('child_process');
const os = require('os');

const arg = process.argv[2];
const gradlew = os.platform() === 'win32' ? 'gradlew.bat' : './gradlew';

const gradleCommand = os.platform() === 'win32' ? 'gradlew.bat' : './gradlew';

const gradleProcess = spawn(gradleCommand, [arg], { shell: true, stdio: 'inherit' });

gradleProcess.on('error', (err) => {
console.error(`Failed to start subprocess: ${err}`);
});

gradleProcess.on('close', (code) => {
console.log(`Gradle process exited with code ${code}`);
});
7 changes: 0 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,3 @@ tasks {
gradleVersion = project.findProperty("gradleVersion").toString()
}
}


allprojects {
apply {
plugin("project-report")
}
}
8 changes: 0 additions & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,6 @@
"options": {
"targetName": "test"
}
},
{
"plugin": "@nx/gradle",
"options": {
"testTargetName": "test",
"classesTargetName": "classes",
"buildTargetName": "build"
}
}
],
"defaultBase": "master"
Expand Down

0 comments on commit dc0647e

Please sign in to comment.