[TIMOB-23668] iOS: Hyperloop - Differential build not working
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop, iOS, Tooling |
Labels | n/a |
Reporter | Chee Kiat Ng |
Assignee | Jan Vennemann |
Created | 2016-07-21T08:24:43.000+0000 |
Updated | 2017-08-09T15:57:02.000+0000 |
Description
It looks like differential build is not working when hyperloop is used.
What's happening here is that before Hyperloop kicks in, there is a step during the build that triggers the creation of a new Xcode project (Not sure yet where exactly this happens). Hyperloop then changes the project and adds the required files. On subsequent builds this happens over and over again and Hyperloop always starts altering a fresh Xcode project, thus forcing a rebuild.
[~cbarber] any advice on this? [~jvennemann] I thought Hyperloop has a check to see if new metabase needs to be generated. If it determines that metabase generation can be skipped, can't we assume that we can skip hyperloop changing the Xcode project and adding required files?
If Hyperloop is going to modify the generated Xcode project, it should do it during the
build.ios.xcodeproject
hook.Just for the record, here is a summary about my findings regarding this issue. Hyperloop only uses the
build.ios.xcodeproject
hook to store the Xcode project data. The actual changes to the project are made during thebuild.pre.build
hook. So the normal Titanium iOS builder has no idea of the changes Hyperloop made and overwrites the Xcode project without any Hyperloop generated files included on the next build. I thought about changing the order when Hyperloop generates its metabase but it relies on thebuild.ios.copyResource
hook to detect if any relevant files were required and only then triggers a metabase generation. And this hook happens afterbuild.ios.xcodeproject
so it would require some (major?) refactoring to the whole hyperloop metabase workflow. If at all viable (how do we get the js files before the copyResource hook?). Also our current strategy to decide if we need to invoke a build with xcode is quite trivial. Xcode project file changed? Rebuild! Assuming we can fix the differential build issue, another one would arise. If we use custom Swift or Objective-C code and would change something there, neither the sdk or hyperloop would trigger a rebuild simply because the file is already in the xcode project. => file monitor or something like that is needed.So what changed? This used to work, albeit not great. Because Allow does not support differential builds, the iOS build was always recompiling, but I personally made the Hyperloop CLI plugin support differential builds. You may need to do your file operations during the
build.ios.xcodeproject
hook, which is not ideal. I don't want more file I/O that we need. If we're VERY careful, we could write the Xcode project later in the build, possibly after the resources have been copied, but we must call xcodebuild "clean" because we use schemes now and we don't nuke the derived data like we used to.[~jvennemann] status on this? Didn't see this bug for a long time and it's scheduled for 6.1.0.
This is still happening. The CLI writes the Xcode project, then Hyperloop adds stuff which CLI isn't aware of. On the next build the CLI will replace the Xcode project again without any Hyperloop related changes, forcing constant rebuilds. I can spend time on this as soon as i got the Android AAR stuff sorted out.
Hyperloop should be making changes to the Xcode project during the
build.ios.xcodeproject
hook.