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

[TIMOB-24000] Module build should error if the apiversion in manifest… #9563

Merged
merged 3 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ AndroidModuleBuilder.prototype.validate = function validate(logger, config, cli)

this.manifest = this.cli.manifest;

const sdkModuleAPIVersion = this.cli.sdk && this.cli.sdk.manifest && this.cli.sdk.manifest.moduleAPIVersion && this.cli.sdk.manifest.moduleAPIVersion['android'];
if (this.manifest.apiversion && sdkModuleAPIVersion && this.manifest.apiversion !== sdkModuleAPIVersion) {
logger.error(__('The module manifest apiversion is currently set to %s', this.manifest.apiversion));
logger.error(__('Titanium SDK %s Android module apiversion is at %s', this.titaniumSdkVersion, sdkModuleAPIVersion));
logger.error(__('Please update module manifest apiversion to match Titanium SDK module apiversion.'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to also alert them that they likely need to update the minSDK value too.

process.exit(1);
}

// detect android environment
androidDetect(config, { packageJson: this.packageJson }, function (androidInfo) {
this.androidInfo = androidInfo;
Expand Down
8 changes: 8 additions & 0 deletions iphone/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ iOSModuleBuilder.prototype.validate = function validate(logger, config, cli) {
this.buildOnly = cli.argv['build-only'];
this.xcodeEnv = null;

const sdkModuleAPIVersion = cli.sdk.manifest && cli.sdk.manifest.moduleAPIVersion && cli.sdk.manifest.moduleAPIVersion['iphone'];
if (this.manifest.apiversion && sdkModuleAPIVersion && this.manifest.apiversion !== sdkModuleAPIVersion) {
logger.error(__('The module manifest apiversion is currently set to %s', this.manifest.apiversion));
logger.error(__('Titanium SDK %s iOS module apiversion is at %s', this.titaniumSdkVersion, sdkModuleAPIVersion));
logger.error(__('Please update module manifest apiversion to match Titanium SDK module apiversion.'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alert about minSDK too.

process.exit(1);
}

return function (finished) {
ioslib.detect({
// env
Expand Down