diff --git a/template/build.gradle.template b/template/build.gradle.template index f7b5e77..d3240b8 100644 --- a/template/build.gradle.template +++ b/template/build.gradle.template @@ -35,8 +35,9 @@ tasks.withType(JavaCompile).configureEach { } tasks.register('processUiResources', Copy) { - from project(':ui').tasks.named('buildFrontend') + from project(':ui').layout.buildDirectory.dir('dist') into layout.buildDirectory.dir('resources/main/console') + dependsOn project(':ui').tasks.named('assemble') shouldRunAfter tasks.named('processResources') } diff --git a/template/ui/build.gradle.template b/template/ui/build.gradle.template index 7ba082d..f37299c 100644 --- a/template/ui/build.gradle.template +++ b/template/ui/build.gradle.template @@ -1,30 +1,33 @@ plugins { - id 'base' - id "com.github.node-gradle.node" version "7.1.0" + id 'base' + id "com.github.node-gradle.node" version "7.1.0" } group '{{packageName}}.ui' -tasks.register('buildFrontend', PnpmTask) { - args = ['build'] - dependsOn tasks.named('pnpmInstall') - inputs.dir(layout.projectDirectory.dir('src')) - inputs.files(fileTree( - dir: layout.projectDirectory, - includes: ['*.cjs', '*.ts', '*.js', '*.json', '*.yaml'])) - outputs.dir(layout.buildDirectory.dir('dist')) - shouldRunAfter(tasks.named('check')) +tasks.register('pnpmBuild', PnpmTask) { + group = 'build' + description = 'Build the UI project using pnpm' + args = ['build'] + dependsOn tasks.named('pnpmInstall') + inputs.dir(layout.projectDirectory.dir('src')) + inputs.files(fileTree( + dir: layout.projectDirectory, + includes: ['*.cjs', '*.ts', '*.js', '*.json', '*.yaml'])) + outputs.dir(layout.buildDirectory.dir('dist')) } -tasks.register('checkFrontend', PnpmTask) { - args = ['test:unit'] - dependsOn tasks.named('pnpmInstall') +tasks.register('pnpmCheck', PnpmTask) { + group = 'verification' + description = 'Run unit tests for the UI project using pnpm' + args = ['test:unit'] + dependsOn tasks.named('pnpmInstall') } tasks.named('check') { - dependsOn tasks.named('checkFrontend') + dependsOn tasks.named('pnpmCheck') } -tasks.named('build') { - dependsOn tasks.named('buildFrontend') +tasks.named('assemble') { + dependsOn tasks.named('pnpmBuild') }