Skip to content
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: mobilesdk-${{ env.vtag }}-linux
- name: Download MacOS artifact
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: mobilesdk-${{ env.vtag }}-osx
Expand Down
4 changes: 2 additions & 2 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ The following APIs were removed in 9.0.0:
| `Ti.UI.View#finishLayout()` | Use the `#applyProperties()` method to batch-update layout properties. |
| `Ti.UI.View#startLayout()` | Use the `#applyProperties()` method to batch-update layout properties. |
| `Ti.UI.View#updateLayout()` | Use the `#applyProperties()` method to batch-update layout properties. |
| `Ti.UI.WebView.error.message` | Use the `error` property instead. Removed on ios in 8.0.0. Removed on android in 9.0.0. |
| `Ti.UI.WebView.error.errorCode` | Use the `code` property instead. Removed on ios in 8.0.0. Removed on android in 9.0.0. |
| `Ti.UI.WebView.error.message` | Use the `error` property instead. Removed on iOS in 8.0.0. Removed on Android in 9.0.0. |
| `Ti.UI.WebView.error.errorCode` | Use the `code` property instead. Removed on iOS in 8.0.0. Removed on Android in 9.0.0. |
| `Ti.UI.WebView.onStopBlacklistedUrl` | Use the cross-platform `blacklisturl` event instead. |
| `Ti.UI.Window.android:back` | Use the `Ti.UI.Window.androidback` event instead. |
| `Ti.UI.Window.android:camera` | Use the `Ti.UI.Window.androidcamera` event instead. |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ npm run test:ipad

The test suite generates a single Titanium SDK project targeting the specified platform(s), builds the project for emulator, launches the app on the emulator and then runs a series of tests defined via ti-mocha and should.js.

The tests spit out their results to the console log, and the test scripts listen to the logs to gather the results. We then generate an overview on the console as well as a junit report xml file (to be consume by CI build systems like Jenkins).
The tests spit out their results to the console log, and the test scripts listen to the logs to gather the results. We then generate an overview on the console as well as a junit report XML file (to be consume by CI build systems like Jenkins).

#### How to modify the tests locally and in your PRs

Expand Down
4 changes: 2 additions & 2 deletions STARTUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ At SDK build time, `./android/titanium/prebuild.js` script is run which takes JS
- then call...

`V8Runtime#nativeInit()`
- from java down to JNI
- from Java down to JNI
- sets up platform, isolate, debugger, then calls...
`V8Runtime#bootstrap()`
- sets up `EventEmitter` in C code
Expand All @@ -40,7 +40,7 @@ back to `V8Runtime#bootstrap()`
- set up `global.global`
- set default `global.__dirname` and `__filename`

back to java `V8Runtime#initRuntime()`
back to Java `V8Runtime#initRuntime()`
- start debugger
- load external native modules

Expand Down
2 changes: 1 addition & 1 deletion android/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SpacesInParentheses: false
TabWidth: 4
UseTab: ForContinuationAndIndentation
SpaceAfterCStyleCast: true
# Spaces inside {} for array literals, i.e. "new Object[] { args }"
# Spaces inside {} for array literals, e.g. "new Object[] { args }"
Cpp11BracedListStyle: false
ReflowComments: false
JavaImportGroups: ['java', 'javax', 'org', 'android', 'com']
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tasks.register('checkstyleChanged', Checkstyle) {
include getChangedFiles()
}

// Used to strip the src dir prefixes from the changed java files
// Used to strip the src dir prefixes from the changed Java files
def getChangedFiles() {
if (!project.hasProperty('changedFiles')) {
return new ArrayList<>()
Expand Down
70 changes: 35 additions & 35 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AndroidBuilder extends Builder {
// we hook into the pre-validate event so that we can stop the build before
// prompting if we know the build is going to fail.
//
// this is also where we can detect android and jdk environments before
// this is also where we can detect Android and JDK environments before
// prompting occurs. because detection is expensive we also do it here instead
// of during config() because there's no sense detecting if config() is being
// called because of the help command.
Expand All @@ -110,13 +110,13 @@ class AndroidBuilder extends Builder {

async.series([
function (next) {
// detect android environment
// detect Android environment
androidDetect(config, { packageJson: _t.packageJson }, function (androidInfo) {
_t.androidInfo = androidInfo;
assertIssue(logger, androidInfo.issues, 'ANDROID_JDK_NOT_FOUND');
assertIssue(logger, androidInfo.issues, 'ANDROID_JDK_PATH_CONTAINS_AMPERSANDS');

// if --android-sdk was not specified, then we simply try to set a default android sdk
// if --android-sdk was not specified, then we simply try to set a default Android SDK
if (!cli.argv['android-sdk']) {
let androidSdkPath = config.android && config.android.sdkPath;
if (!androidSdkPath && androidInfo.sdk) {
Expand All @@ -130,7 +130,7 @@ class AndroidBuilder extends Builder {
},

function (next) {
// detect java development kit
// detect JDK
appc.jdk.detect(config, null, function (jdkInfo) {
assertIssue(logger, jdkInfo.issues, 'JDK_NOT_INSTALLED');
assertIssue(logger, jdkInfo.issues, 'JDK_MISSING_PROGRAMS');
Expand Down Expand Up @@ -252,7 +252,7 @@ class AndroidBuilder extends Builder {
}));
},
validate: function (value, callback) {
// if there's a value, then they entered something, otherwise let the cli prompt
// if there's a value, then they entered something, otherwise let the CLI prompt
if (value) {
const selectedAlias = value.toLowerCase(),
alias = _t.keystoreAlias = _t.keystoreAliases.filter(function (a) { return a.name && a.name.toLowerCase() === selectedAlias; }).shift();
Expand Down Expand Up @@ -300,19 +300,19 @@ class AndroidBuilder extends Builder {
} else if (_t.androidInfo.sdk && _t.androidInfo.sdk.path === afs.resolvePath(value)) {
callback(null, value);
} else {
// attempt to find android sdk
// attempt to find Android SDK
android.findSDK(value, config, loadPackageJson(__dirname), function () {

// NOTE: ignore errors when finding sdk, let gradle validate the sdk
// NOTE: ignore errors when finding SDK, let gradle validate the SDK

function next() {
// set the android sdk in the config just in case a plugin or something needs it
// set the Android SDK in the config just in case a plugin or something needs it
config.set('android.sdkPath', value);

// path looks good, do a full scan again
androidDetect(config, { packageJson: _t.packageJson, bypassCache: true }, function (androidInfo) {

// assume sdk is valid, let gradle validate the sdk
// assume SDK is valid, let gradle validate the SDK
if (!androidInfo.sdk) {
androidInfo.sdk = { path: value };
}
Expand All @@ -322,8 +322,8 @@ class AndroidBuilder extends Builder {
});
}

// new android sdk path looks good
// if we found an android sdk in the pre-validate hook, then we need to kill the other sdk's adb server
// new Android SDK path looks good
// if we found an Android SDK in the pre-validate hook, then we need to kill the other SDK's adb server
if (_t.androidInfo.sdk) {
new ADB(config).stopServer(next);
} else {
Expand All @@ -335,7 +335,7 @@ class AndroidBuilder extends Builder {
},
'avd-abi': {
abbr: 'B',
desc: 'the abi for the Android emulator; deprecated, use --device-id',
desc: 'the ABI for the Android emulator; deprecated, use --device-id',
hint: 'abi'
},
'avd-id': {
Expand Down Expand Up @@ -462,15 +462,15 @@ class AndroidBuilder extends Builder {
name = 'titanium_' + cli.argv['avd-id'] + '_';

if (avds.length) {
// try finding the first avd that starts with the avd id
// try finding the first AVD that starts with the AVD id
avds = avds.filter(function (avd) {
return avd.indexOf(name) === 0;
});
if (avds.length === 1) {
cli.argv['device-id'] = avds[0];
return callback();
} else if (avds.length > 1) {
// next try using the avd skin
// next try using the AVD skin
if (!cli.argv['avd-skin']) {
// we have more than one match
logger.error(`Found ${avds.length} avd${avds.length === 1 ? '' : 's'} with id "${cli.argv['avd-id']}"`);
Expand Down Expand Up @@ -499,7 +499,7 @@ class AndroidBuilder extends Builder {
cli.argv['device-id'] = avds[0];
return callback();
} else if (!cli.argv['avd-abi']) {
// we have more than one matching avd, but no abi to filter by so we have to error
// we have more than one matching AVD, but no ABI to filter by so we have to error
logger.error(`Found ${
avds.length
} avd${avds.length === 1 ? '' : 's'} with id "${
Expand All @@ -523,9 +523,9 @@ class AndroidBuilder extends Builder {
});
}
if (avds.length === 0) {
logger.error(`No emulators found with id "${cli.argv['avd-id']}", skin "${cli.argv['avd-skin']}", and abi "${cli.argv['avd-abi']}"\n`);
logger.error(`No emulators found with id "${cli.argv['avd-id']}", skin "${cli.argv['avd-skin']}", and ABI "${cli.argv['avd-abi']}"\n`);
} else {
// there is one or more avds, but we'll just return the first one
// there is one or more AVDs, but we'll just return the first one
cli.argv['device-id'] = avds[0];
return callback();
}
Expand All @@ -536,7 +536,7 @@ class AndroidBuilder extends Builder {

logger.warn(`${'--avd-*'.cyan} options have been ${'deprecated'.red}, please use ${'--device-id'.cyan}\n`);

// print list of available avds
// print list of available AVDs
if (results.length && !cli.argv.prompt) {
logger.log('Available Emulators:');
results.forEach(function (emu) {
Expand Down Expand Up @@ -980,7 +980,7 @@ class AndroidBuilder extends Builder {
logger.error('The app id must consist only of letters, numbers, dashes, and underscores.');
logger.error('Note: Android does not allow dashes.');
logger.error('The first character must be a letter or underscore.');
logger.error('Usually the app id is your company\'s reversed Internet domain name. (i.e. com.example.myapp)\n');
logger.error('Usually the app id is your company\'s reversed Internet domain name. (e.g. com.example.myapp)\n');
process.exit(1);
}

Expand All @@ -989,7 +989,7 @@ class AndroidBuilder extends Builder {
logger.error('The app id must consist of letters, numbers, and underscores.');
logger.error('The first character must be a letter or underscore.');
logger.error('The first character after a period must not be a number.');
logger.error('Usually the app id is your company\'s reversed Internet domain name. (i.e. com.example.myapp)\n');
logger.error('Usually the app id is your company\'s reversed Internet domain name. (e.g. com.example.myapp)\n');
process.exit(1);
}

Expand Down Expand Up @@ -1033,7 +1033,7 @@ class AndroidBuilder extends Builder {
process.exit(1);
}

// map sdk versions to sdk targets instead of by id
// map SDK versions to SDK targets instead of by id
const targetSDKMap = {
// placeholder for gradle to use
[this.compileSdkVersion]: {
Expand Down Expand Up @@ -1080,7 +1080,7 @@ class AndroidBuilder extends Builder {
process.exit(1);
}

// validate the sdk levels
// validate the SDK levels
const usesSDK = this.customAndroidManifest ? this.customAndroidManifest.getUsesSdk() : null;

this.minSDK = this.minSupportedApiLevel;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ class AndroidBuilder extends Builder {
usesSDK.maxSdkVersion && (this.maxSDK = usesSDK.maxSdkVersion);
}

// we need to translate the sdk to a real api level (i.e. L => 20, MNC => 22) so that
// we need to translate the SDK to a real API level (e.g. L => 20, MNC => 22) so that
// we can validate them
function getRealAPILevel(ver) {
return (ver && targetSDKMap[ver] && targetSDKMap[ver].sdk) || ver;
Expand All @@ -1120,7 +1120,7 @@ class AndroidBuilder extends Builder {
this.realTargetSDK = getRealAPILevel(this.targetSDK);
this.realMaxSDK = getRealAPILevel(this.maxSDK);

// min sdk is too old
// min SDK is too old
if (this.minSDK && this.realMinSDK < this.minSupportedApiLevel) {
logger.error(`The minimum supported SDK API version must be ${
this.minSupportedApiLevel
Expand Down Expand Up @@ -1156,7 +1156,7 @@ class AndroidBuilder extends Builder {
}

if (this.targetSDK) {
// target sdk is too old
// target SDK is too old
if (this.realTargetSDK < this.minTargetApiLevel) {
logger.error(`The target SDK API ${
this.targetSDK
Expand Down Expand Up @@ -1192,7 +1192,7 @@ class AndroidBuilder extends Builder {
process.exit(1);
}

// target sdk < min sdk
// target SDK < min SDK
if (this.realTargetSDK < this.realMinSDK) {
logger.error(`The target SDK API must be greater than or equal to the minimum SDK ${
this.minSDK
Expand All @@ -1211,7 +1211,7 @@ class AndroidBuilder extends Builder {
this.realTargetSDK = this.targetSDK;
}

// check that we have this target sdk installed
// check that we have this target SDK installed
this.androidTargetSDK = targetSDKMap[this.targetSDK];

if (!this.androidTargetSDK) {
Expand Down Expand Up @@ -1784,7 +1784,7 @@ class AndroidBuilder extends Builder {
this.logger.info('Profiler disabled');
}

this.logger.info(`Transpile javascript: ${(this.transpile ? 'true' : 'false').cyan}`);
this.logger.info(`Transpile JavaScript: ${(this.transpile ? 'true' : 'false').cyan}`);
this.logger.info(`Generate source maps: ${(this.sourceMaps ? 'true' : 'false').cyan}`);
}

Expand Down Expand Up @@ -1854,15 +1854,15 @@ class AndroidBuilder extends Builder {
return true;
}

// if encryptJS changed, then we need to recompile the java files
// if encryptJS changed, then we need to recompile the Java files
if (this.encryptJS !== manifest.encryptJS) {
this.logger.info('Forcing rebuild: JavaScript encryption flag changed');
this.logger.info(` Was: ${manifest.encryptJS}`);
this.logger.info(` Now: ${this.encryptJS}`);
return true;
}

// check if the titanium sdk paths are different
// check if the Titanium SDK paths are different
if (this.platformPath !== manifest.platformPath) {
this.logger.info('Forcing rebuild: Titanium SDK path changed since last build');
this.logger.info(` Was: ${manifest.platformPath}`);
Expand Down Expand Up @@ -2535,7 +2535,7 @@ class AndroidBuilder extends Builder {
combined = gather.mergeMaps(allModulesResults);

// Ok, so we have a Map<string, FileInfo> for the full set of unique relative paths
// now categorize (i.e. lump into buckets of js/css/html/assets/generic resources)
// now categorize (e.g. lump into buckets of js/css/html/assets/generic resources)
const categorizer = new gather.Categorizer({
tiappIcon: this.tiapp.icon,
jsFilesNotToProcess: Object.keys(this.htmlJsFiles),
Expand All @@ -2545,7 +2545,7 @@ class AndroidBuilder extends Builder {
}

/**
* Optionally mifies the input css files and copies them to the app
* Optionally minifies the input CSS files and copies them to the app
* @param {Map<string,object>} files map from filename to file info
* @returns {Promise<void>}
*/
Expand Down Expand Up @@ -2677,7 +2677,7 @@ class AndroidBuilder extends Builder {
});
await task.run();
if (this.useWebpack) {
// Merge Ti symbols from Webpack with the ones from legacy js processing
// Merge Ti symbols from Webpack with the ones from legacy JS processing
Object.keys(task.data.tiSymbols).forEach(file => {
const existingSymbols = this.tiSymbols[file] || [];
const additionalSymbols = task.data.tiSymbols[file];
Expand Down Expand Up @@ -2714,7 +2714,7 @@ class AndroidBuilder extends Builder {
}

/**
* @param {string[]} jsBootstrapFiles list of bootstrap js files to add to listing we generate
* @param {string[]} jsBootstrapFiles list of bootstrap JS files to add to listing we generate
* @returns {Promise<void>}
*/
async writeBootstrapJson(jsBootstrapFiles) {
Expand Down Expand Up @@ -2874,7 +2874,7 @@ class AndroidBuilder extends Builder {
throw new Error('Could not load encryption library!');
}

this.logger.info('Encrypting javascript assets...');
this.logger.info('Encrypting JavaScript assets...');

// NOTE: maintain 'build.android.titaniumprep' hook for remote encryption policy.
const hook = this.cli.createHook('build.android.titaniumprep', this, async function (exe, args, opts, next) {
Expand Down
8 changes: 4 additions & 4 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class AndroidModuleBuilder extends Builder {

this.manifest = this.cli.manifest;

// detect android environment
// detect Android environment
androidDetect(config, { packageJson: this.packageJson }, function (androidInfo) {
this.androidInfo = androidInfo;

Expand All @@ -232,7 +232,7 @@ export class AndroidModuleBuilder extends Builder {
// check the Android SDK we require to build exists
this.androidCompileSDK = targetSDKMap[this.compileSdkVersion];

// if no target sdk, then default to most recent supported/installed
// if no target SDK, then default to most recent supported/installed
if (!this.targetSDK) {
this.targetSDK = this.maxSupportedApiLevel;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ export class AndroidModuleBuilder extends Builder {
this.javacMaxMemory = cli.timodule.properties['android.javac.maxMemory'].value;
}

// detect java development kit
// detect JDK
appc.jdk.detect(config, null, function (jdkInfo) {
if (!jdkInfo.version) {
logger.error('Unable to locate the Java Development Kit\n');
Expand Down Expand Up @@ -957,7 +957,7 @@ export class AndroidModuleBuilder extends Builder {
}
}

// create the builder instance and expose the public api
// create the builder instance and expose the public API
const moduleBuilder = new AndroidModuleBuilder();
export const config = moduleBuilder.config.bind(moduleBuilder);
export const validate = moduleBuilder.validate.bind(moduleBuilder);
Expand Down
2 changes: 1 addition & 1 deletion android/cli/lib/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export { detect };
* Detects connected Android emulators.
* @param {Object} config - The CLI config object
* @param {Object} [opts] - Detection options
* @param {String} [opts.type] - The type of emulator to load (avd, genymotion); defaults to all
* @param {String} [opts.type] - The type of emulator to load (AVD, genymotion); defaults to all
* @param {Function} finished - Callback when detection is finished
*/
export function detectEmulators(config, opts, finished) {
Expand Down
Loading
Loading