I’m trying to split up a frontend build from our backend build. The frontend build outputs a directory of stuff that needs to be imported into the classpath by the backend. I’d really like to simply do something like this:
artifacts {
smartBuild dir(“$buildDir/somepath/dist”)staticNodeModules dir("$buildDir/static_node_modules")
}
I would then depend on it in the runtime/testRuntime of my parent project.
runtime project(“:frontend”).smartBuild
runtime project(“:frontend”).staticNodeModules
Being able to separate the project like this would be super awesome, but I can’t figure out how to do this. I’d like gradle to handle the proper dependencies and stuff, have tasks that output those files and hook it all together, but I cannot figure this out from the documentation here: ArtifactHandler - Gradle DSL Version 8.4 There’s something about a DirectoryProvider, but I don’t get it, and using dir()
doesn’t seem to work.
I’m having trouble googling for this, because there’s lots about publishing extra jars, or extra files, which is not what I’m aiming for. I really don’t want to “publish” anything, just define it as an output of the sub project, so that gradle can properly figure out the dependencies.
Is this even possible?