Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [ "axway/env-alloy" ],
"rules": {
"import/no-absolute-path": "off",
"indent": ["error", 2]
}
}
21 changes: 21 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = function (grunt) {

// Project configuration.
grunt.initConfig({
appcJs: {
src: [
'app/'
]
}
});
grunt.loadNpmTasks('grunt-appc-js');

// linting: run eslint against js, standard appc checks, check ios/android format via clang, run doc validation script
grunt.registerTask('lint', [ 'appcJs' ]);

// Tasks for formatting the source code according to our clang/eslint rules
grunt.registerTask('format:js', [ 'appcJs:src:lint:fix' ]);

// By default, run linting
grunt.registerTask('default', [ 'lint' ]);
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
======================================
Appcelerator Movies App
Copyright 2008-2015 Appcelerator, Inc.
Copyright 2008-present Appcelerator, Inc.
======================================

Apache License
Expand Down
48 changes: 24 additions & 24 deletions app/alloy.jmk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Movies
*
*
* @copyright
* Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2015-present by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
Expand All @@ -11,30 +11,30 @@

/**
* pre compile callback
*
*
* - removes tests directory from production builds and when config.run_logic_tests is false
*/
task("pre:compile", function(event, logger) {
task('pre:compile', function (event, logger) {

var env = event.alloyConfig.deploytype;
logger.info("Pre compile (" + env + ")");
var fs = require("fs");
var config = JSON.parse(fs.readFileSync(event.dir.config + ".json", "utf8"));
logger.info(JSON.stringify(config["env:" + env]));
if ("production" === env
|| !config["env:" + env].run_logic_tests) {
logger.info("*** Excluding tests from build");
logger.info(event.alloyConfig.platform)
logger.info('Pre compile (' + env + ')');

var fs = require('fs');
var config = JSON.parse(fs.readFileSync(event.dir.config + '.json', 'utf8'));

logger.info(JSON.stringify(config['env:' + env]));

if (env === 'production'
|| !config['env:' + env].run_logic_tests) {

logger.info('*** Excluding tests from build');
logger.info(event.alloyConfig.platform);
var path = (event.alloyConfig.platform === 'ios') ? 'iphone' : event.alloyConfig.platform;
var tests_dir = event.dir.resources + "/" + path + "/tests";
var fs = require("fs-extra");
var tests_dir = event.dir.resources + '/' + path + '/tests';
var fs = require('fs-extra');
fs.removeSync(tests_dir);
} else {
logger.info("*** Including tests in build");
}
});

} else {
logger.info('*** Including tests in build');
}
});
Loading