Dealing with version control (git) and detached Expo project

#1

I have an Expo project that I had to detach to use native libraries. I’m using git for version control. I notice that as I develop the ios/my-project/Supporting/EXShell.json and ios/my-project/Supporting/EXShell.plist keep changing.

I’m wondering if I should keep those files in version control or it’s fine to git ignore? If it’s fine to ignore, won’t those files be needed on a fresh clone of the repo? Or will they get generated? If so, what generates them?

0 Likes

#2

We recently added support for EXBuildConstants.plist to make this less annoying. If you create a new plist file called EXBuildConstants.plist in the same directory as EXShell.plist and add it to your Xcode file tree, that one should get modified rather than EXShell. Then you should be able to add EXShell.plist to version control and ignore EXBuildConstants.plist. New ExpoKit projects have this already set up by default.

0 Likes

#3

Is there something like this for ExponentBuildConstants.java since that file doesn’t get regenerated by exp start?

0 Likes

#4

ExponentBuildConstants gets generated when you build the android project. Not sure I understand your question @domkm.

0 Likes

#5

@jesse On SDK18, it doesn’t seem to be regenerated when I build the project. I get an error from MainActivity.java saying that the generated package doesn’t exist. What should I do to cause the build process to regenerate ExponentBuildConstants.java?

0 Likes

#6

“Generated” isn’t the correct word I guess, it modifies the file to point to the correct url

0 Likes

#7

@jesse Yes, my understanding was that this topic was about how to deal with git for these generated files. ExponentBuildConstants.java can’t be ignored because it is not regenerated during the build process. It shouldn’t be committed when automatically modified because that leads to unnecessary conflicts. My understanding is that this was the case on the iOS side with EXShell.plist until SDK18 when EXShell.plist became static and EXBuildConstants.plist was added and automatically regenerated as needed, making it safely ignorable.

0 Likes

#8

Ok that’s reasonable, we can change the behavior. For now it should be checked in.

1 Like

#9

@ben I think I misunderstood your post. I thought you meant that EXBuildConstants.plist would be generated by exp start and therefore it could be safely ignored. This doesn’t seem to be the case. We can ignore it but each team member needs to manually add it. What do you think of making exp start create EXBuildConstants.plist if it does not already exist?

1 Like

#10

@domkm that seems reasonable, I can add that in the next minor release probably.

(technical note: it’s not exp start which modifies these files, it’s a build hook in your xcode project.)

0 Likes

#11

EXBuildConstants.plist is not being used even I created it and upgrade to sdk 18.0.0
When I build in xcode (a detached project) and run in the ios simulator the app will show error about using the exp in EXSHell instead of the url in EXBuildConstants.plist.

Any reason why?

0 Likes

#12

Looks like it has been fixed after upgrading to SDK 19.

0 Likes