Skip to content

Instantly share code, notes, and snippets.

@csemrm
Forked from FokkeZB/Gruntfile.js
Created March 14, 2018 18:15
Show Gist options
  • Save csemrm/89d4a84828d8567a3f11a91a66deb871 to your computer and use it in GitHub Desktop.
Save csemrm/89d4a84828d8567a3f11a91a66deb871 to your computer and use it in GitHub Desktop.

Revisions

  1. @FokkeZB FokkeZB created this gist Oct 18, 2014.
    78 changes: 78 additions & 0 deletions Gruntfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    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']);
    };