birdofpreyru / react-native-static-server

Embedded HTTP server for React Native
https://dr.pogodin.studio/docs/react-native-static-server
Other
142 stars 22 forks source link

iOS: Specify outputs in podspec to optimize recurrent builds #41

Closed birdofpreyru closed 1 year ago

birdofpreyru commented 1 year ago

https://github.com/birdofpreyru/react-native-static-server/blob/0cb38c83867ea7dfdd40bfc62bab84666a088a8d/dr-pogodin-react-native-static-server.podspec#L26-L31

ospfranco commented 1 year ago

Is it possible to do it for Android as well? I think it is also happening there, but not 100% sure.

birdofpreyru commented 1 year ago

I'm not sure regarding Android. Though, as the build in all cases is managed by CMake, it already caches build artefacts, and avoids unnecessary repeating of build operations. Thus, specifying output artefacts is a minor optimisation anyway.

ospfranco commented 1 year ago

well, whenever my app is built on Android I can see static-server being compiled, it adds about 20 - 30 seconds to my compilation time on my mac, and on the CI that would be some extra minutes.

birdofpreyru commented 1 year ago

Be it as it may be, I currently don't know a way to improve it for Android builds, but I am not a deep expert in native Android builds, thus neither I can claim there is not way to. You know, the Android build is managed by Gradle, the current config we use is here, and here is the documentation for that version of Android Gradle Plugin. More specifically, the CMake part of the build is ordered by this block, documented here. So, if you have some time to spare digging into the documentation, and able to find any way to speed-up stuff, I don't mind it at all; otherwise, the current build performance does not feel like a huge issue to me either.

ospfranco commented 1 year ago

I just took another look, I think I was wrong, maybe it was because for the emulator it compiles x86_64 but further builds are actually quite fast. So, nevermind my comment about Android. Thanks a lot!