Skip to content

Instantly share code, notes, and snippets.

@hisamekms
Created April 7, 2014 12:16
Show Gist options
  • Save hisamekms/10019204 to your computer and use it in GitHub Desktop.
Save hisamekms/10019204 to your computer and use it in GitHub Desktop.
Titanium Mobile, TiShadow, Alloy, CoffeeScript.
module.exports = (grunt) ->
'use strict'
# Grunt Initialize
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
options:
bare: true
souceMap: true
alloy:
files: [
expand: true
cwd: 'src'
src: ['**/*.coffee']
dest: 'app'
ext: '.js'
]
test:
files: [
expand: true
cwd: 'test'
src: ['**/*.coffee']
dest: 'spec'
ext: '.js'
]
copy:
alloy:
files: [
expand: true
dot: true
cwd: 'src'
dest: 'app'
src: [
'**'
'!**/*.coffee'
'!**/*.jade'
'!**/*.ltss'
]
]
jade:
alloy:
files: [
expand: true
cwd: 'src'
src: [ '**/*.jade' ]
dest: 'app'
ext: '.xml'
]
ltss:
alloy:
files: [
expand: true
cwd: 'src'
src: [ '**/*.ltss' ]
dest: 'app'
ext: '.tss'
]
watch:
alloy:
files: ['src/**/*']
tasks: [
'run'
]
tishadow:
options:
update: false
withAlloy: true
run:
command: 'run'
options:
alloy:
platform: ['ios']
clear:
command: 'clear'
options:
alloy:
platform: ['ios']
spec:
command: 'spec'
options:
alloy:
platform: ['ios']
# Tasks
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-tishadow'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-ltss'
grunt.loadNpmTasks 'grunt-contrib-jade'
# Register Task
grunt.registerTask 'default', ['watch']
grunt.registerTask 'build:ti', [
'coffee:alloy'
'coffee:test'
'jade:alloy'
'ltss:alloy'
]
grunt.registerTask 'run', [
'build:ti'
'tishadow:run'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment