Skip to content

Commit

Permalink
Merge branch 'master' into 230121_keyboard_hide_event
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Jun 10, 2024
2 parents a816eed + 2f1212f commit 3a344c3
Show file tree
Hide file tree
Showing 319 changed files with 8,578 additions and 17,644 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
12 changes: 2 additions & 10 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,10 @@ runs:
run: npm run lint:android
shell: bash

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install ccache
run: brew install ccache
shell: bash

- name: Retrieve ccache
uses: actions/cache@v3
uses: hendrikmuhs/ccache-action@v1.2
with:
path: ${{ env.CCACHE_DIR }}
create-symlink: true
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
name: Verify contributor

steps:
- uses: tidev/tidev-cla-action@v1
- uses: tidev/tidev-cla-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/regen-builds.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Regen Builds
on:
release:
types: [published, released]
workflow_run:
workflows: [Build]
types: [completed]
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ on:
options:
- GA
- RC
- RC2
- RC3
- RC4
- Beta
- Beta2
- Beta3
- Beta4

jobs:
validate:
Expand Down Expand Up @@ -171,4 +177,9 @@ jobs:
git add package-lock.json
git commit -m "chore(release): bump version"
git push
- name: Regen Builds
uses: peter-evans/repository-dispatch@v2
with:
event-type: regen-builds
repository: tidev/downloads-www
token: ${{ secrets.REGEN_BUILDS_DOCS_GITHUB_TOKEN }}
290 changes: 290 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 20 additions & 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/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/SynaxonAG"><img src="https://github.com/SynaxonAG.png" width="60px" alt="Synaxon AG" /></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 Expand Up @@ -269,6 +269,25 @@ After you've made the changes and compiled the SDK make sure to run the test sui

Some modules like ti.map or ti.facebook are included with the SDK. To update to the latest versions you have to edit the links in `support/module/packaged/modules.json` and run `node build/scons-modules-integrity.js`. This will download the files and update the integrity values.

### Update Android libraries
The `/android/titanium/build.gradle` file contains various Android libraries that are used in the SDK. If you want to update them check the corresponding release pages:
* https://developer.android.com/jetpack/androidx/releases/recyclerview
* https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
* https://developer.android.com/jetpack/androidx/releases/camera
* https://developer.android.com/jetpack/androidx/releases/transition
* https://developer.android.com/jetpack/androidx/releases/vectordrawable
* https://developer.android.com/jetpack/androidx/releases/viewpager
* https://developer.android.com/jetpack/androidx/releases/cardview
* https://developer.android.com/jetpack/androidx/releases/drawerlayout
* https://developer.android.com/jetpack/androidx/releases/exifinterface
* https://developer.android.com/jetpack/androidx/releases/media
for a new version and change the number in the build.gradle file. Some version numbers are managed inside `/android/templates/build/ti.constants.gradle`. After that build the SDK and run `npm run test` to see if everything is still running. Building Kitchensink, Hyperloop-examples and a custom app is also helpful.

### Documentation

If you want to help updating and improving the documentation you can checkout the repository and edit the files in `/apidoc/`. Those files are shown in the API documentation at https://titaniumsdk.com/api/ and include all methods, properties, examples and so on. After you made changes run `npm run lint:docs` to see if your changes produce a valid documentation. The PR commit title you create should start with `docs: ` and a proper title like: `docs: updated textfield examples`.
All other documentation files (e.g. the guides) are located in the https://github.com/tidev/titanium-docs repository. In case you want to update guides, tutorials or spelling mistakes you clone that repo and follow the README file inside the main folder.

## Contributing

Interested in contributing? There are several ways you can help contribute to this project.
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
5 changes: 3 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 @@ -495,6 +495,7 @@ AndroidModuleBuilder.prototype.generateRootProjectFiles = async function generat
// Create a "gradle.properties" file. Will add network proxy settings if needed.
const gradleProperties = await gradlew.fetchDefaultGradleProperties();
gradleProperties.push({ key: 'android.useAndroidX', value: 'true' });
gradleProperties.push({ key: 'android.suppressUnsupportedCompileSdk', value: '33' });
gradleProperties.push({
key: 'org.gradle.jvmargs',
value: `-Xmx${this.javacMaxMemory} -Dkotlin.daemon.jvm.options="-Xmx${this.javacMaxMemory}"`
Expand Down Expand Up @@ -859,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
12 changes: 5 additions & 7 deletions android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,22 @@ 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;
}

// ignore some Android logs in info log level
for (let i = 0, len = ignoreLog.length; i < len; ++i) {
if (line.includes(ignoreLog[i])) {
return;
}
if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
return;
}

switch (logLevel) {
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
Loading

0 comments on commit 3a344c3

Please sign in to comment.