fix: ui/build.gradle cross-platform pnpm command for Linux CI
This commit is contained in:
+7
-3
@@ -15,18 +15,22 @@ node {
|
|||||||
tasks.named('pnpmSetup').configure { enabled = false }
|
tasks.named('pnpmSetup').configure { enabled = false }
|
||||||
tasks.named('pnpmInstall').configure { enabled = false }
|
tasks.named('pnpmInstall').configure { enabled = false }
|
||||||
|
|
||||||
|
// Cross-platform: use 'cmd /c' on Windows, direct 'pnpm' on Linux/macOS
|
||||||
|
def isWindows = System.properties['os.name'].toLowerCase().contains('windows')
|
||||||
|
def pnpmCmd = isWindows ? ['cmd', '/c', 'pnpm'] : ['pnpm']
|
||||||
|
|
||||||
tasks.register('uiInstall', Exec) {
|
tasks.register('uiInstall', Exec) {
|
||||||
group = 'build'
|
group = 'build'
|
||||||
description = 'Install UI dependencies using system pnpm'
|
description = 'Install UI dependencies using system pnpm'
|
||||||
workingDir layout.projectDirectory
|
workingDir layout.projectDirectory
|
||||||
commandLine 'cmd', '/c', 'pnpm', 'install'
|
commandLine(pnpmCmd + ['install'])
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('uiBuild', Exec) {
|
tasks.register('uiBuild', Exec) {
|
||||||
group = 'build'
|
group = 'build'
|
||||||
description = 'Build the UI project using pnpm'
|
description = 'Build the UI project using pnpm'
|
||||||
workingDir layout.projectDirectory
|
workingDir layout.projectDirectory
|
||||||
commandLine 'cmd', '/c', 'pnpm', 'run', 'build'
|
commandLine(pnpmCmd + ['run', 'build'])
|
||||||
dependsOn uiInstall
|
dependsOn uiInstall
|
||||||
inputs.dir(layout.projectDirectory.dir('src'))
|
inputs.dir(layout.projectDirectory.dir('src'))
|
||||||
inputs.files(fileTree(
|
inputs.files(fileTree(
|
||||||
@@ -39,7 +43,7 @@ tasks.register('uiCheck', Exec) {
|
|||||||
group = 'verification'
|
group = 'verification'
|
||||||
description = 'Run unit tests for the UI project using pnpm'
|
description = 'Run unit tests for the UI project using pnpm'
|
||||||
workingDir layout.projectDirectory
|
workingDir layout.projectDirectory
|
||||||
commandLine 'cmd', '/c', 'pnpm', 'run', 'test:unit'
|
commandLine(pnpmCmd + ['run', 'test:unit'])
|
||||||
dependsOn uiInstall
|
dependsOn uiInstall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user