Skip to content

Commit

Permalink
Revert node version to simplify grunt issue
Browse files Browse the repository at this point in the history
  • Loading branch information
scroix committed Apr 1, 2024
1 parent c491c79 commit 529ceb7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2,773 deletions.
26 changes: 11 additions & 15 deletions nodel-webui-js/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def branch = gitInfo.branch
version = gitInfo.branch != 'stable' ? "${project.version}-${branch}_r${rev}" : project.version

node {
version = '16.20.2'
version = '12.19.0'
download = true

workDir = file("${project.buildDir}/nodejs")
Expand Down Expand Up @@ -85,32 +85,28 @@ class FileChecker {

def fileChecker = new FileChecker(project)



tasks.register('installGruntCli', NpmTask) {
def gruntCliInstalled = file('node_modules/grunt-cli').exists()

onlyIf { !gruntCliInstalled }

args = ['install', 'grunt-cli', '--save-dev', '--legacy-peer-deps']

outputs.dir('node_modules')
}

tasks.register('gruntRun', NpxTask) {
def shouldInstall = fileChecker.checkFilesChanged()

if (shouldInstall) {
dependsOn clean
dependsOn clean, npmInstall
}

dependsOn 'installGruntCli'
command = "grunt"
args = ["build"]
inputs.property('filesChanged', shouldInstall)
inputs.dir("node_modules")
outputs.dir("build/grunt")

onlyIf { shouldInstall }

doLast {
if (shouldInstall) {
logger.info('Running Grunt build task as files have changed or node_modules is missing.')
} else {
logger.info('Skipping Grunt build task as no files have changed and node_modules is present.')
}
}
}

tasks.named('clean', Delete) {
Expand Down
Loading

0 comments on commit 529ceb7

Please sign in to comment.