Skip to content

Commit

Permalink
Merge branch 'master' into chore_cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed May 23, 2024
2 parents a26f862 + bbde0c3 commit b4b2c97
Show file tree
Hide file tree
Showing 273 changed files with 7,748 additions and 8,602 deletions.
8 changes: 2 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
"kroll": "readonly"
},
"rules": {
"node/no-deprecated-api": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": ["warn", { "version": "10.11.0" }]
"node/no-unsupported-features/es-syntax": "off"
}
},
{
Expand All @@ -61,9 +59,7 @@
"sourceType": "module"
},
"rules": {
"node/no-deprecated-api": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": ["warn", { "version": "10.11.0" }]
"node/no-unsupported-features/es-syntax": "off"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ today and benefit from 1:1 sessions with the core team, exclusive modules, merch

Learn more about sponsoring TiDev, the organization behind the Titanium SDK, [here](https://github.com/sponsors/tidev) 🚀.

<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/AvinashDalvi89"><img src="https://github.com/AvinashDalvi89.png" width="60px" alt="Avinash Dalvi" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/petervaradi"><img src="https://github.com/petervaradi.png" width="60px" alt="" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/AvinashDalvi89"><img src="https://github.com/AvinashDalvi89.png" width="60px" alt="Avinash Dalvi" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/petervaradi"><img src="https://github.com/petervaradi.png" width="60px" alt="" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https://github.com/eddyinet.png" width="60px" alt="" /></a><!-- sponsors -->

## Features

Expand Down
19 changes: 10 additions & 9 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
// if there are no devices/emulators, error
if (!Object.keys(opts).length) {
if (cli.argv.target === 'device') {
logger.warn(__('Unable to find any devices, possibily due to missing dependencies.') + '\n');
logger.warn(__('Unable to find any devices, possibly due to missing dependencies.') + '\n');
logger.log(__('Continuing with build... (will attempt to install missing dependencies)') + '\n');
} else {
logger.warn(__('Unable to find any emulators, possibily due to missing dependencies.') + '\n');
Expand Down Expand Up @@ -756,7 +756,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
return callback(new Error(msg));
}

// empty the alias array. it is important that we don't destory the original
// empty the alias array. it is important that we don't destroy the original
// instance since it was passed by reference to the alias select list
while (_t.keystoreAliases.length) {
_t.keystoreAliases.pop();
Expand Down Expand Up @@ -1101,7 +1101,7 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {
}

// we need to translate the sdk to a real api level (i.e. L => 20, MNC => 22) so that
// we can valiate them
// we can validate them
function getRealAPILevel(ver) {
return (ver && targetSDKMap[ver] && targetSDKMap[ver].sdk) || ver;
}
Expand Down Expand Up @@ -1462,7 +1462,7 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {
process.exit(1);
}

// For CommonJS modules, verfiy we can find the main script to be loaded by require() method.
// For CommonJS modules, verify we can find the main script to be loaded by require() method.
if (!module.native) {
// Look for legacy "<module.id>.js" script file first.
let jsFilePath = path.join(module.modulePath, module.id + '.js');
Expand Down Expand Up @@ -1541,7 +1541,7 @@ AndroidBuilder.prototype.run = async function run(logger, config, cli, finished)
// Notify plugins that we're about to begin.
await new Promise(resolve => cli.emit('build.pre.construct', this, resolve));

// Post build anlytics.
// Post build analytics.
await this.doAnalytics();

// Initialize build system. Checks if we need to do a clean or incremental build.
Expand Down Expand Up @@ -1956,7 +1956,7 @@ AndroidBuilder.prototype.checkIfShouldForceRebuild = function checkIfShouldForce
}

if (this.activitiesHash !== manifest.activitiesHash) {
this.logger.info(__('Forcing rebuild: Android activites in tiapp.xml changed since last build'));
this.logger.info(__('Forcing rebuild: Android activities in tiapp.xml changed since last build'));
this.logger.info(' ' + __('Was: %s', manifest.activitiesHash));
this.logger.info(' ' + __('Now: %s', this.activitiesHash));
return true;
Expand Down Expand Up @@ -2143,7 +2143,7 @@ AndroidBuilder.prototype.processLibraries = async function processLibraries() {
}

// Check if the module has a maven repository directory.
// If it does, then we can leverage gradle/maven's depency management system.
// If it does, then we can leverage gradle/maven's dependency management system.
let dependencyString = null;
const repositoryDirPath = path.join(nextModule.modulePath, 'm2repository');
if (await fs.exists(repositoryDirPath)) {
Expand Down Expand Up @@ -2198,7 +2198,7 @@ AndroidBuilder.prototype.generateRootProjectFiles = async function generateRootP
gradleProperties.push({ key: 'org.gradle.jvmargs', value: `-Xmx${this.javacMaxMemory}` });
await gradlew.writeGradlePropertiesFile(gradleProperties);

// Copy optional "gradle.properties" file contents from Titainum project to the above generated file.
// Copy optional "gradle.properties" file contents from Titanium project to the above generated file.
// These properties must be copied to the end of the file so that they can override Titanium's default properties.
const customGradlePropertiesFilePath = path.join(this.projectDir, 'platform', 'android', 'gradle.properties');
if (await fs.exists(customGradlePropertiesFilePath)) {
Expand Down Expand Up @@ -3206,7 +3206,8 @@ AndroidBuilder.prototype.generateI18N = async function generateI18N() {
root.appendChild(dom.createTextNode('\n'));

// Create the XML file under the Android "res/values-<locale>" folder.
const localeSuffixName = (locale === 'en' ? '' : '-' + resolveRegionName(locale));
const defaultLang = this.tiapp.defaultLang || 'en';
const localeSuffixName = (locale === defaultLang ? '' : '-' + resolveRegionName(locale));
const dirPath = path.join(this.buildAppMainResDir, `values${localeSuffixName}`);
const filePath = path.join(dirPath, 'ti_i18n_strings.xml');
this.logger.debug(__('Writing %s strings => %s', locale.cyan, filePath.cyan));
Expand Down
4 changes: 2 additions & 2 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AndroidModuleBuilder.prototype.migrate = async function migrate() {
isApiVersionUpdateRequired = (this.manifest.apiversion !== cliModuleAPIVersion);
}

// Determin if the "manifest" file's "minsdk" needs updating.
// Determine if the "manifest" file's "minsdk" needs updating.
// As of Titanium 9.0.0, modules are built as AARs to an "m2repository". Not supported on older Titanium versions.
let isMinSdkUpdateRequired = false;
const minSupportedSdkVersionMajorNumber = 9;
Expand Down Expand Up @@ -860,7 +860,7 @@ AndroidModuleBuilder.prototype.runModule = async function (cli) {
await fs.mkdirs(tmpDir);

// Generate a new Titanium app in the temp directory which we'll later copy the "example" files to.
// Note: App must have a diffentent id/package-name. Avoids class name collision with module generating Java code.
// Note: App must have a different id/package-name. Avoids class name collision with module generating Java code.
this.logger.debug(__('Staging module project at %s', tmpDir.cyan));
await runTiCommand(
process.execPath,
Expand Down
6 changes: 3 additions & 3 deletions android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ exports.init = function (logger, config, cli) {

// start of a new log message
if (device.appPidRegExp.test(line)) {
line = line.trim().replace(device.appPidRegExp, ':');
line = line.replace(/^ {1,2}/, '').replace(device.appPidRegExp, ':');
logLevel = line.charAt(0).toLowerCase();
if (tiapiRegExp.test(line)) {
line = line.replace(tiapiRegExp, '').trim();
line = line.replace(tiapiRegExp, '').replace(/^ {1,2}/, '');
} else {
line = line.replace(/^\w\/(\w+)\s*:/g, '$1:').grey;
}
line = deviceName + line;
// if it begins with something like "E/SQLiteLog( 1659):" it's not a contination, don't log it.
// if it begins with something like "E/SQLiteLog( 1659):" it's not a continuation, don't log it.
} else if (nonTiLogRegexp.test(line)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion android/cli/lib/android-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function isElementNode(node) {
* @param {Object} node The XML node object to check. Can be null/undefined.
* @returns {Boolean}
* Returns true if given node is text between XLM elements or attributes.
* Returns false if not or given an invalild argument.
* Returns false if not or given an invalid argument.
* @private
*/
function isTextNode(node) {
Expand Down
3 changes: 1 addition & 2 deletions android/cli/lib/gradle-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class GradleWrapper {
}

// Function which returns a stdout/stderr "data" reading function object and outputs it to given "logFunction".
// The "logFunction" argument is expected to be a "logger" object that conatins "logger.info" or "logger.error".
// The "logFunction" argument is expected to be a "logger" object that contains "logger.info" or "logger.error".
// The "logType" is a string "error" or "info" to call the correct logger function
const createReadableDataHandlerUsing = (logFunction, logType) => {
let stringBuffer = '';
Expand Down Expand Up @@ -297,7 +297,6 @@ class GradleWrapper {
appc.subprocess.run('appc', [ '-q', 'config', 'get', 'proxyServer' ], runOptions, (exitCode, out) => {
try {
if (!exitCode && out && (out.length > 0)) {
// eslint-disable-next-line node/no-deprecated-api
proxyUrl = url.parse(out.trim());

Check warning on line 300 in android/cli/lib/gradle-wrapper.js

View workflow job for this annotation

GitHub Actions / JavaScript

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead
}
} catch (ex) {
Expand Down
2 changes: 1 addition & 1 deletion android/cli/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
"Forcing rebuild: Android minimum SDK changed since last build": "Forcing rebuild: Android minimum SDK changed since last build",
"Forcing rebuild: Android target SDK changed since last build": "Forcing rebuild: Android target SDK changed since last build",
"Forcing rebuild: tiapp.xml properties changed since last build": "Forcing rebuild: tiapp.xml properties changed since last build",
"Forcing rebuild: Android activites in tiapp.xml changed since last build": "Forcing rebuild: Android activites in tiapp.xml changed since last build",
"Forcing rebuild: Android activities in tiapp.xml changed since last build": "Forcing rebuild: Android activites in tiapp.xml changed since last build",
"Forcing rebuild: Android services in tiapp.xml SDK changed since last build": "Forcing rebuild: Android services in tiapp.xml SDK changed since last build",
"Forcing rebuild: One or more JSS files changed since last build": "Forcing rebuild: One or more JSS files changed since last build",
"Forcing rebuild: mergeCustomAndroidManifest config has changed since last build": "Forcing rebuild: mergeCustomAndroidManifest config has changed since last build",
Expand Down
2 changes: 1 addition & 1 deletion android/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ That simply places the message in a queue. One of the two threads spun up after

### Handling messages coming from the Debugger

The second thread spun up after a connection is made simply reads lines from the debugger's stream and does very basic parsing of the message. Once the headers are stripped, we grab the JSON body and call down into C++ to do a V8::Debug::SendCommand to give the command to V8.
The second thread spun up after a connection is made simply reads lines from the debuggers stream and does very basic parsing of the message. Once the headers are stripped, we grab the JSON body and call down into C++ to do a V8::Debug::SendCommand to give the command to V8.

The next step is to call V8::Debug::ProcessDebugMessages(). We do so indirectly by using a Handler.post(Runnable) to ensure this gets called on the main thread.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected void initialize()
}

properties = (Map<Object, Object>) JSONValue.parseWithException(new FileReader(jsonPath));
debug("Succesfully loaded existing binding data: " + jsonPath);
debug("Successfully loaded existing binding data: " + jsonPath);
} catch (Exception e) {
// file doesn't exist, we'll just create it later
debug("No binding data found, creating new data file: %s/%s", this.jarJsonPackageName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public void onDisposing(KrollRuntime runtime)
// Remove this listener from the runtime's static collection.
KrollRuntime.removeOnDisposingListener(this);

// Unregister all currently registerd broadcast receviers.
// Unregister all currently registered broadcast receivers.
// They can no longer be handled by the terminating JavaScript runtime.
while (registeredBroadcastReceiverProxyList.isEmpty() == false) {
unregisterBroadcastReceiver(registeredBroadcastReceiverProxyList.pollFirst());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public TiDatabaseProxy open(Object file)
throw new IllegalArgumentException("Ti.Database.open() was given invalid URL: " + fileString);
}
} else {
// Assume we were given a databas file name only. (This is the most common case.)
// Assume we were given a database file name only. (This is the most common case.)
dbName = fileString;
}
} else if (file != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ protected void eventListenerAdded(String event, int count, KrollProxy proxy)
// FIXME: Why can't we just track some boolean flag for this?
if (currentPositionCallback.size() == 0) {
HashMap<String, LocationProviderProxy> locationProviders = simpleLocationProviders;
// FIXME: why does this differ from how we enable in getCurrentPostion()?
// FIXME: why does this differ from how we enable in getCurrentPosition()?
if (getManualMode()) {
locationProviders = androidModule.manualLocationProviders;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public String getName()
if (property == null) {
Log.e(TAG, "No name found for location provider");

return ""; // this shouldnt be possible
return ""; // this shouldn't be possible
}

return (String) property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public TiDeviceOrientationMonitor(Handler handler)
if (value instanceof SensorManager) {
this.sensorManager = (SensorManager) value;
} else {
Log.w(TAG, "Unable to aquire SensorManager.");
Log.w(TAG, "Unable to acquire SensorManager.");
}

// Create an event handler for the Android "OrientationEventListener".
Expand Down Expand Up @@ -370,7 +370,7 @@ public void onSensorChanged(SensorEvent event)
break;
}

// Do not continue if the device rotation matrix has not been udpated above.
// Do not continue if the device rotation matrix has not been updated above.
if (!wasRotationMatrixUpdated) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void handleCreationDict(KrollDict properties)
options = new KrollDict();
}

// Determine the collatior setting we need to use.
// Determine the collator setting we need to use.
int strengthId;
int decompositionId = Collator.CANONICAL_DECOMPOSITION;
this.isStrippingAccents = false;
Expand Down
Loading

0 comments on commit b4b2c97

Please sign in to comment.