A system to enable compiled sources easily with your Titanium projects.
Features:
- Incremental builds. It only compiles files that are new or have changed
- Does not package CoffeeScript or LESS source files with your Titanium binary
- No extra build steps to forget
The system treats your project's Resources directory as a build target for compiled sources such as your .coffee files. The plugin hooks into Titanium's build system to compile only newly updated files without any extra steps.
-
Rename your
Resourcesdirectory toResources-static -
Add your CoffeeScript and LESS files into a new directory called
Resources-compile -
Create a directory called
pluginsand recursively copy the this project directory (titanium-assets) into it -
To
tiapp.xmladd a plugins section if you don't already have one and register thetitanium-assetsplugin:<plugins> <plugin>titanium-assets</plugin> </plugins>
-
Recommended: Add your
Resourcesdirectory to your .gitignore file (like you do with your build files)
The end result is a directory structure that looks roughly like:
Project Dir
|- Resources-static (*.js, images, etc)
|- Resources-compile (*.coffee, *.less)
|- plugins
|- titanium-assets
|- 1.0
|- hooks
Once you have your files in place, run a Titanium build as you normally would. Before the Titanium build takes place, the plugin will:
- Ensure you have a
Resourcesdirectory - Recursively copy all the files in
Resources-staticintoResources(maintaining directory structure) - Recursively compile all the CoffeeScript and LESS files in
Resources-compileintoResources(maintaining directory structure)
Note: When you run a Titanium clean, the Resources directory will be completely removed.
Things to keep in mind for this early version
- I've only tested in via command line builds
- I've only tested it on a Mac
- I've only tested it on my own projects
Copyright 2013 Front Seat, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This is a tool created for our own internal use. It is not supported by Appcelerator. If you have questions, issues, etc. then please file them in the GitHub Issues section of the repository. Even better, fork the project and make it better :)
This project brought to you by Front Seat

