Skip to content

Commit

Permalink
chore: update project infrastructure
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <[email protected]>
  • Loading branch information
ruibaby committed Jul 22, 2024
1 parent a30f2ad commit 4da3f39
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.node-gradle.node" version "5.0.0"
id "com.github.node-gradle.node" version "7.0.2"
id "run.halo.plugin.devtools" version "0.0.9"
id "io.freefair.lombok" version "8.0.1"
id 'java'
Expand All @@ -26,23 +26,28 @@ test {
useJUnitPlatform()
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}

node {
pnpmVersion = '8'
nodeProjectDir = file("${project.projectDir}/console")
}

tasks.register("installDeps", PnpmTask) {
onlyIf { !file("${project.projectDir}/console/node_modules").exists() }
args = ['install']
tasks.register('buildFrontend', PnpmTask) {
args = ['build']
dependsOn('installDepsForUI')
}

tasks.register("buildFrontend", PnpmTask) {
args = ['build']
dependsOn("installDeps")
tasks.register('installDepsForUI', PnpmTask) {
args = ['install']
}

tasks.named("compileJava").configure {
dependsOn("buildFrontend")
build {
// build frontend before build
tasks.named('compileJava').configure {
dependsOn('buildFrontend')
}
}

halo {
Expand Down

0 comments on commit 4da3f39

Please sign in to comment.