Closed papb closed 4 years ago
Hi
It's unlikely we will want to add sth like this, this solution is quite hacky plus we would be breaking compatibility when changing project structure.
As a workaround, you can modify "project template" in ~/.turtle/workingdir/android/sdk38/android/
directory, when building turtle is making a copy of that dir (to android-shell-app) and doing some processing on that copy, but if changes are minimal you might be able to add that.
You will lose all changes when updating to new turtle if we change that template in a meantime
Hello, thank you, sorry to take long to reply!
I understand. Thanks for sharing this workaround!
In my case, I ended up finding another module that solves my problem without needing to eject. But if I hit a similar issue in the future, I will try the workaround you suggested. Thank you very much!
Feature Request
Motivation Behind Feature
This feature would allow avoiding have to
expo eject
just to make some very minor changes to java/gradle files.Here is my situation as an example:
I want to use
@react-native-firebase/messaging
in my Expo project (managed workflow), but that is not supported, so I'd have to ejectHowever, it seems that the only thing I have to do is the following changes in
MainApplication.java
:Therefore, I wish I could specify some customization to be executed right before the build starts (but after turtle has already made its magic of scaffolding all these files needed under the hood). My idea is to be able to specify a JS file that will be executed automatically by turtle right before starting the build itself.
Feature Description
turtle build:android
to accept a new option--before-build path/to/some/file.js
which, when given, will behave as follows:node path/to/some/file.js
automatically and wait for this command to finish before proceeding.MainApplication.java
file (which will already exist, since it was scaffolded by turtle) and overwrites it however I wish (in my case adding these few lines in the appropriate places)android/build.gradle
, this will also be possible, since the complexity of overwriting files will be a their problem, not turtle's problem.Are there any drawbacks? Will this break anything for existing users?
No. This will be an opt-in usage.
Alternatives or Workarounds
None that I know of. I might try to look at turtle source code to see if I can find the appropriate time to sneak in this call myself...