[DAEMON-231] @appcd/plugin-titanium: New Titanium Build Pipeline
DescriptionThe current Titanium build process is duplicated for each target (iOS, Android, Windows). We need to unify this pipeline and allow hooks for platform specific logic to be executed. Things like reading the project file, compiling Alloy, transpiling source, optimizing images, encryption, etc are all common tasks that this pipeline must process. The idea of the pipeline is implemented as a data structure. The Titanium SDK build then creates the pipeline instance and begins to process the files in the project directory. The pipeline API will support things like adding a file, removing a file, assign metadata to a file (e.g. encrypted, minified, etc), and in some cases, the entire contents of the file. It will also need to support persisting the state to disk and "diffing" to see if the state of the pipeline has changed. The idea is the pipeline is created, then the last build state is loaded into the pipeline and "committed" like a git commit. Then we walk the project directory finding files, processing them, and adding them to the pipeline. As the build progresses through the various stages, the state of the pipeline can be drastically changed such as when Alloy compiles views into .js files. At the end of the build, it can see what changed and figure out what needs to be written to disk. In some cases it's copying a file. In others it's simply writing the new file contents (such as transpiled code) to disk. The destination may not only be disk. It's possible with LiveView 2 that we ship the new files over the wire to the app or do something like TiShadow.