Skip to content

Commit a91c64b

Browse files
authored
Make sure the processUiResources task is executed after processResources (#54)
1 parent c81ec5a commit a91c64b

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ tasks.withType(JavaCompile).configureEach {
3535
}
3636

3737
tasks.register('processUiResources', Copy) {
38-
from project(':ui').tasks.named('buildFrontend')
38+
from project(':ui').layout.buildDirectory.dir('dist')
3939
into layout.buildDirectory.dir('resources/main/console')
40+
dependsOn project(':ui').tasks.named('assemble')
41+
shouldRunAfter tasks.named('processResources')
4042
}
4143

42-
tasks.named('processResources', ProcessResources) {
44+
tasks.named('classes') {
4345
dependsOn tasks.named('processUiResources')
4446
}
4547

ui/build.gradle

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
plugins {
2-
id 'base'
3-
id "com.github.node-gradle.node" version "7.1.0"
2+
id 'base'
3+
id "com.github.node-gradle.node" version "7.1.0"
44
}
55

66
group 'run.halo.starter.ui'
77

88
tasks.register('buildFrontend', PnpmTask) {
9-
args = ['build']
10-
dependsOn tasks.named('pnpmInstall')
11-
inputs.dir(layout.projectDirectory.dir('src'))
12-
inputs.files(fileTree(
13-
dir: layout.projectDirectory,
14-
includes: ['*.cjs', '*.ts', '*.js', '*.json', '*.yaml']))
15-
outputs.dir(layout.buildDirectory.dir('dist'))
16-
shouldRunAfter(tasks.named('check'))
9+
group = 'build'
10+
description = 'Builds the UI project using pnpm.'
11+
args = ['build']
12+
dependsOn tasks.named('pnpmInstall')
13+
inputs.dir(layout.projectDirectory.dir('src'))
14+
inputs.files(fileTree(
15+
dir: layout.projectDirectory,
16+
includes: ['*.cjs', '*.ts', '*.js', '*.json', '*.yaml']))
17+
outputs.dir(layout.buildDirectory.dir('dist'))
1718
}
1819

19-
tasks.register('checkFrontend', PnpmTask) {
20-
args = ['test:unit']
21-
dependsOn tasks.named('pnpmInstall')
20+
tasks.register('pnpmCheck', PnpmTask) {
21+
group = 'verification'
22+
description = 'Runs unit tests using pnpm.'
23+
args = ['test:unit']
24+
dependsOn tasks.named('pnpmInstall')
2225
}
2326

2427
tasks.named('check') {
25-
dependsOn tasks.named('checkFrontend')
28+
dependsOn tasks.named('pnpmCheck')
2629
}
2730

28-
tasks.named('build') {
29-
dependsOn tasks.named('buildFrontend')
31+
tasks.named('assemble') {
32+
dependsOn tasks.named('buildFrontend')
3033
}

0 commit comments

Comments
 (0)