Skip to content

Commit

Permalink
fix(android): use maxMemory as property (#13567)
Browse files Browse the repository at this point in the history
* fix(android): use maxMemory as property

* update error, use both values
  • Loading branch information
m1ga authored Oct 1, 2022
1 parent e8e06cd commit f6e6586
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,17 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {
cli.tiapp.properties['ti.deploytype'] = { type: 'string', value: this.deployType };

// Fetch Java max heap size setting.
this.javacMaxMemory = cli.tiapp.properties['android.javac.maxmemory'] && cli.tiapp.properties['android.javac.maxmemory'].value || config.get('android.javac.maxMemory', '3072M');
this.javacMaxMemory = config.get('android.javac.maxMemory', '3072M');

// TODO remove in the next SDK
if (cli.tiapp.properties['android.javac.maxmemory'] && cli.tiapp.properties['android.javac.maxmemory'].value) {
logger.error(__('android.javac.maxmemory is deprecated and will be removed in the next version. Please use android.javac.maxMemory') + '\n');
this.javacMaxMemory = cli.tiapp.properties['android.javac.maxmemory'].value;
}

if (cli.tiapp.properties['android.javac.maxMemory'] && cli.tiapp.properties['android.javac.maxMemory'].value) {
this.javacMaxMemory = cli.tiapp.properties['android.javac.maxMemory'].value;
}

// Transpilation details
this.transpile = cli.tiapp['transpile'] !== false; // Transpiling is an opt-out process now
Expand Down
12 changes: 11 additions & 1 deletion android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,17 @@ AndroidModuleBuilder.prototype.validate = function validate(logger, config, cli)
}

// get javac params
this.javacMaxMemory = cli.timodule.properties['android.javac.maxmemory'] && cli.timodule.properties['android.javac.maxmemory'].value || config.get('android.javac.maxMemory', '3072M');
this.javacMaxMemory = config.get('android.javac.maxMemory', '3072M');

// TODO remove in the next SDK
if (cli.timodule.properties['android.javac.maxmemory'] && cli.timodule.properties['android.javac.maxmemory'].value) {
logger.error(__('android.javac.maxmemory is deprecated and will be removed in the next version. Please use android.javac.maxMemory') + '\n');
this.javacMaxMemory = cli.timodule.properties['android.javac.maxmemory'].value;
}

if (cli.timodule.properties['android.javac.maxMemory'] && cli.timodule.properties['android.javac.maxMemory'].value) {
this.javacMaxMemory = cli.timodule.properties['android.javac.maxMemory'].value;
}

// detect java development kit
appc.jdk.detect(config, null, function (jdkInfo) {
Expand Down

0 comments on commit f6e6586

Please sign in to comment.