Build fails because UI refuses to build. UI does build and run tests just fine when running yarn build and yarn install in ui folder. Build succeeds when all building is removed from gradel file:
plugins {
id "base"
id "com.github.node-gradle.node" version "7.0.2"
}
def nodeSpec = {
version = '16.16.0'
yarnVersion = '1.22.22'
npmVersion = "8.17.0"
download = true
}
node {
with nodeSpec
}
//task format(type: YarnTask, dependsOn: yarn_install) {
// args = ['run', 'format']
// inputs.files(fileTree('src'))
// outputs.dir('src')
//}
//
//task mybuild(type: YarnTask, dependsOn: yarn_install) {
// inputs.file('package.json')
// inputs.files(fileTree('src'))
// inputs.files(fileTree('public'))
// inputs.file('vite.config.js')
// inputs.file('tsconfig.json')
// inputs.file('shims-vue.d.ts')
// inputs.file('jest.config.js')
// inputs.file('tsconfig.node.json')
// inputs.file('index.html')
// outputs.dir('dist')
//
// outputs.cacheIf { false }
// args = ['run', 'build']
//}
task test(type: YarnTask) {
args = ['run', 'test']
}
/* convert build files into one apps.jar that we can use as a dependency in the java part */
task createJar(type: Zip) {
archiveBaseName = 'ui'
archiveExtension = 'jar'
destinationDirectory = file("${buildDir}/build/libs")
from('dist')
into('public')
}
createJar.dependsOn test
//first mybuild, than createJar
build.dependsOn "createJar"
clean.doLast {
project.delete(files("dist"))
project.delete(files("build"))
}
/* expose as artifact that can be used as dependency by other modules*/
configurations {
appResources
}
configurations.default.extendsFrom(configurations.appResources)
artifacts {
appResources(createJar.getArchiveFile()) {
builtBy createJar
type "jar"
}
}
Seems to only be the case if I first run yarn install and yarn dev in the ui folder and then do clean install in IntelliJ, if I checkout a fresh branch, it will work
How to Reproduce
Run clean install in intellij
Expected behavior
Build succeeds and ui is build as well
Observed behavior
Build fails because UI refuses to build. UI does build and run tests just fine when running
yarn build
andyarn install
in ui folder. Build succeeds when all building is removed from gradel file: