Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(7_1_X) [TIMOB-25875] Babel rewrites app.js in classic project to generated ES5 code #9939

Merged
merged 3 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 31 additions & 28 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function AndroidBuilder() {
this.maxSupportedApiLevel = parseInt(version.parseMax(this.packageJson.vendorDependencies['android sdk']));

this.deployTypes = {
'emulator': 'development',
'device': 'test',
emulator: 'development',
device: 'test',
'dist-playstore': 'production'
};

Expand Down Expand Up @@ -263,15 +263,15 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
cli.createHook('build.android.config', this, function (callback) {
const conf = {
flags: {
'launch': {
launch: {
desc: __('disable launching the app after installing'),
default: true,
hideDefault: true,
negate: true
}
},
options: {
'alias': {
alias: {
abbr: 'L',
desc: __('the alias for the keystore'),
hint: 'alias',
Expand Down Expand Up @@ -678,7 +678,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
});
}
},
'keystore': {
keystore: {
abbr: 'K',
callback: function () {
_t.conf.options['alias'].required = true;
Expand Down Expand Up @@ -861,7 +861,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
});
}
},
'target': {
target: {
abbr: 'T',
callback: function (value) {
// as soon as we know the target, toggle required options for validation
Expand All @@ -880,7 +880,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
required: true,
values: _t.targets
},
'sigalg': {
sigalg: {
desc: __('the type of a digital signature algorithm. only used when overriding keystore signing algorithm'),
hint: __('signing'),
order: 170,
Expand Down Expand Up @@ -2740,6 +2740,9 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
} else {
// TODO If dest file exists and contents match, don't do anything?
this.logger.debug(__('Writing modified contents to %s', to.cyan));
// if it exists, wipe it first, as it may be a symlink back to the original, and updating that would be BAD.
// See TIMOB-25875
fs.existsSync(to) && fs.unlinkSync(to);
fs.writeFile(to, newContents, cb2);
}
})(r, from, to, cb);
Expand Down Expand Up @@ -2815,7 +2818,7 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
const opts = {
env: appc.util.mix({}, process.env, {
// we force the JAVA_HOME so that titaniumprep doesn't complain
'JAVA_HOME': this.jdkInfo.home
JAVA_HOME: this.jdkInfo.home
})
},
fatal = function fatal(err) {
Expand Down Expand Up @@ -3030,11 +3033,11 @@ AndroidBuilder.prototype.processTiSymbols = function processTiSymbols(next) {

function createModuleDescriptor(namespace) {
var results = {
'api_name': '',
'class_name': '',
'bindings': tiNamespaces[namespace],
'external_child_modules': [],
'on_app_create': null
api_name: '',
class_name: '',
bindings: tiNamespaces[namespace],
external_child_modules: [],
on_app_create: null
},
moduleBindingKeys = Object.keys(moduleBindings),
len = moduleBindingKeys.length,
Expand Down Expand Up @@ -3601,7 +3604,7 @@ AndroidBuilder.prototype.generateAndroidManifest = function generateAndroidManif
},

tiNamespacePermissions = {
'geolocation': geoPermissions
geolocation: geoPermissions
},

tiMethodPermissions = {
Expand Down Expand Up @@ -3637,28 +3640,28 @@ AndroidBuilder.prototype.generateAndroidManifest = function generateAndroidManif

tiMethodActivities = {
'Map.createView': {
'activity': {
'name': 'ti.modules.titanium.map.TiMapActivity',
'configChanges': [ 'keyboardHidden', 'orientation' ],
'launchMode': 'singleTask'
activity: {
name: 'ti.modules.titanium.map.TiMapActivity',
configChanges: [ 'keyboardHidden', 'orientation' ],
launchMode: 'singleTask'
},
'uses-library': {
'name': 'com.google.android.maps'
name: 'com.google.android.maps'
}
},
'Media.createVideoPlayer': {
'activity': {
'name': 'ti.modules.titanium.media.TiVideoActivity',
'configChanges': [ 'keyboardHidden', 'orientation' ],
'theme': '@style/Theme.AppCompat.Fullscreen',
'launchMode': 'singleTask'
activity: {
name: 'ti.modules.titanium.media.TiVideoActivity',
configChanges: [ 'keyboardHidden', 'orientation' ],
theme: '@style/Theme.AppCompat.Fullscreen',
launchMode: 'singleTask'
}
},
'Media.showCamera': {
'activity': {
'name': 'ti.modules.titanium.media.TiCameraActivity',
'configChanges': [ 'keyboardHidden', 'orientation' ],
'theme': '@style/Theme.AppCompat.Translucent.NoTitleBar.Fullscreen'
activity: {
name: 'ti.modules.titanium.media.TiCameraActivity',
configChanges: [ 'keyboardHidden', 'orientation' ],
theme: '@style/Theme.AppCompat.Translucent.NoTitleBar.Fullscreen'
}
}
},
Expand Down