module.exports = function(grunt) { grunt.initConfig({ settings: { releaseNotes: grunt.option('notes') || 'CI build', appName: 'Flashlight', ppUuid: '0253600x-ac6d-35b6-b66d-dd25c4fd956f', installrAppToken: '6xC0I8SdJA76kW3pqq7GFZLIyq6fBP4Z' }, titanium: { clean: { options: { command: 'clean' } }, ios: { options: { command: 'build', projectDir: './', platform: 'ios', buildOnly: true, target: 'dist-adhoc', distributionName: 'Flasher (X242ZJ33XX)', ppUuid: '<%= settings.ppUuid %>', outputDir: './dist' } }, android: { options: { command: 'build', projectDir: './', platform: 'android', buildOnly: true, outputDir: './dist' } } }, shell: { ios: { options: { stdout: true }, command: [ "curl -H 'X-InstallrAppToken: <%= settings.installrAppToken %>' https://www.installrapp.com/apps.json " + "-F 'qqfile=@./dist/<%= settings.appName %>.ipa' " + "-F 'releaseNotes=<%= settings.releaseNotes %>' " + "-F 'notify=true'" ].join("&&") }, android: { options: { stdout: true }, command: [ "curl -H 'X-InstallrAppToken: <%= settings.installrAppToken %>' https://www.installrapp.com/apps.json " + "-F 'qqfile=@./dist/<%= settings.appName %>.apk' " + "-F 'releaseNotes=<%= settings.releaseNotes %>' " + "-F 'notify=true'" ].join("&&") } }, }); grunt.loadNpmTasks('grunt-titanium'); grunt.loadNpmTasks('grunt-shell'); grunt.registerTask('tiapp', function() { var tiapp = require('tiapp.xml').load(); var version = tiapp.version.split('.'); tiapp.version = version[0] + '.' + version[1] + '.' + (parseInt(version[2], 10) + 1); tiapp.write(); grunt.log.writeln(require('util').format('Bumped version to: %s', tiapp.version)); }); grunt.registerTask('default', ['tiapp', 'titanium', 'shell']); };