Skip to content

Commit

Permalink
Add a couple more optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
scroix committed Apr 1, 2024
1 parent 572f1f2 commit c491c79
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions nodel-webui-js/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ version = gitInfo.branch != 'stable' ? "${project.version}-${branch}_r${rev}" :
node {
version = '16.20.2'
download = true
workDir = file("${project.buildDir}/nodejs")

npmInstallCommand = System.getenv("CI") ? 'ci' : 'install'
workDir = file("${project.buildDir}/nodejs")
nodeProjectDir = file("${project.projectDir}")
}

class FileChecker {
Expand Down Expand Up @@ -88,27 +88,25 @@ def fileChecker = new FileChecker(project)


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

if (shouldInstall) {
dependsOn clean
}
onlyIf { !gruntCliInstalled }

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

inputs.property('filesChanged', shouldInstall)
outputs.dir('node_modules')

onlyIf { shouldInstall }
}

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

if (shouldInstall) {
dependsOn clean
}

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

Expand Down Expand Up @@ -168,6 +166,10 @@ tasks.named('compileJava') {
dependsOn zipContentInterface, copyBuildInfo
}

tasks.named('processResources') {
dependsOn zipContentInterface, copyBuildInfo
}

dependencies {
implementation 'joda-time:joda-time:2.10.10'
implementation 'org.joda:joda-convert:2.2.1'
Expand Down

0 comments on commit c491c79

Please sign in to comment.