Allow specifying a different output directory than app/?
Is your feature request related to a problem? Please describe.
I'm trying to use bubblewrap on an existing project that, per Rails conventions, has .rb files in folders under app/ such as app/models. This conflicts with the default bubblewrap build outputs under app/build and app/src.
Describe the solution you'd like
Can we have a flag like --outDir to output to a different location?
bubblewrap build --outDir built
Describe alternatives you've considered
Moving the original app/ to a temp dir before build, then moving the build app/ to another temp folder, and moving the original app/ contents back. I don't like this 😄
You should be able to modify your gradle.properties and specify a different build directory, as described here: https://stackoverflow.com/questions/13915351/change-gradles-working-directory-when-compiling-a-groovy-project
We could add this to twa-manifest.json so that gradle.properties is generated with the correct value when the project is regenerated.
+1, having to dive into Gradle for a web project is not something I'd expect to have to do 😉
The goal is that you shouldn't have to.
Generally, you shouldn't have to care about the app folder too. I wonder if the reason is that you are using it in an existing project? Can you provide more details?
Yup! It's an existing Rails project that has app/, config/, and lib/ directories for Ruby code, alongside a webpack/ directory for frontend code.
My solution was to create a custom npm script in the package.json. The script could cd into another directory other than app/ and then run the command. It would look something like this:
"scripts": {
"build-android": "cd ./android && bubblewrap init ..."
}
You could do the same thing with bubblewrap build or combine them into one command. Then all I have to do is run npm run build-android from app/ and it'll do the rest. Or since you're using Rails, you could use the rails equivalent of these custom commands.
Closing out my old issues I no longer have context on. If anybody else is still seeing this, I'd encourage you to file a new issue with more information. Cheers!