Skip to content

Commit

Permalink
chore(android): Merge remote-tracking branch 'origin/master' into fix…
Browse files Browse the repository at this point in the history
…/android/external-keyboard

# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
#     Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
#     Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
  • Loading branch information
darcywong00 committed Oct 21, 2024
2 parents 6d86c25 + a79511a commit 70772ef
Show file tree
Hide file tree
Showing 29 changed files with 399 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

- name: "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})"
run: |
echo "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})" >> $GITHUB_STEP_SUMMARY
echo "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }}):" >> $GITHUB_STEP_SUMMARY
BIN_PACKAGE=$(ls "${GITHUB_WORKSPACE}/artifacts/" | grep "${PKG_NAME}[0-9]*_${{ steps.environment_step.outputs.VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb")
cd ${{ github.workspace }}/keyman/linux
Expand Down
13 changes: 13 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Keyman Version History

## 18.0.128 alpha 2024-10-14

* docs(developer): add refs to Keyman MIME types (#12540)

## 18.0.127 alpha 2024-10-12

* fix(developer): use TextDecoder to convert Uint8Array to string (#12537)

## 18.0.126 alpha 2024-10-11

* test(common): add markdown link check test for product documentation (#12472)
* chore(linux): improve output if `dpkg-gensymbols` fails and run other tests (#12527)

## 18.0.125 alpha 2024-10-10

* chore(common): allow to run `build.sh` scripts in `bashdb` debugger (#12518)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.0.126
18.0.129
7 changes: 6 additions & 1 deletion android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"

builder_describe \
"Build Keyman Engine for Android, Keyman for Android, and FirstVoices Android app." \
"@/resources/tools/check-markdown test:help" \
clean \
configure \
build \
Expand All @@ -23,6 +24,7 @@ builder_describe \
--upload-sentry+ \
":engine=KMEA Keyman Engine for Android" \
":app=KMAPro Keyman for Android" \
":help Online documentation" \
":sample1=Samples/KMSample1 Sample app: KMSample1" \
":sample2=Samples/KMSample2 Sample app: KMSample2" \
":keyboardharness=Tests/KeyboardHarness Test app: KeyboardHarness" \
Expand All @@ -42,4 +44,7 @@ if builder_start_action clean; then
builder_finish_action success clean
fi

builder_run_child_actions configure build test publish
builder_run_child_actions configure build test
builder_run_action test:help check-markdown "$KEYMAN_ROOT/android/docs/help"

builder_run_child_actions publish
2 changes: 2 additions & 0 deletions developer/docs/help/reference/file-types/kmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Details:
Developer will also include a [metadata](metadata) file in the
package. Lexical model packages contain one lexical model instead of
keyboards.
: .kmp file format has registered MIME type
[`application/vnd.keyman.kmp+zip`](https://www.iana.org/assignments/media-types/application/vnd.keyman.kmp+zip).

Distributed with keyboard:
: A Keyman keyboard Package file (.KMP) can include keyboard files
Expand Down
4 changes: 3 additions & 1 deletion developer/docs/help/reference/file-types/kmx.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: KMX files
---

Used by:
: <span class="application">Keyman Desktop</span>,
: Keyman Core in <span class="application">Keyman for Windows</span>,
<span class="application">Keyman for macOS</span>, and
<span class="application">Keyman for Linux</span>.

Expand All @@ -16,6 +16,8 @@ Details:
for the keyboard (.ICO/.BMP). Note that .KMX files are not used for
<span class="application">Keyman for Android</span> and
<span class="application">Keyman for iPhone and iPad</span>.
: .KMX file format has registered MIME type
[`application/vnd.keyman.kmx`](https://www.iana.org/assignments/media-types/application/vnd.keyman.kmx).

Distributed with keyboard:
: This is the keyboard file. It must be distributed with your package
Expand Down
3 changes: 3 additions & 0 deletions developer/src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"

builder_describe \
"Keyman Developer" \
"@/resources/tools/check-markdown test:help" \
clean \
configure \
build \
Expand All @@ -20,6 +21,7 @@ builder_describe \
"install Install built programs locally" \
":common Developer common files" \
":ext Third party components" \
":help Online documentation" \
":kmcmplib Compiler - .kmn compiler" \
":kmc-analyze Compiler - Analysis Tools" \
":kmc-keyboard-info Compiler - .keyboard_info Module" \
Expand Down Expand Up @@ -125,6 +127,7 @@ fi
#-------------------------------------------------------------------------------------------------------------------

builder_run_child_actions clean configure build test
builder_run_action test:help check-markdown "$KEYMAN_ROOT/developer/docs/help"

#-------------------------------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class KPJFileReader {
let data: KPJFile;

data = new KeymanXMLReader('kpj')
.parse(file.toString());
.parse(new TextDecoder().decode(file));

data = this.boxArrays(data);
if(data.KeymanDeveloperProject?.Files?.File?.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class KVKSFileReader {

try {
source = new KeymanXMLReader('kvks')
.parse(file.toString()) as KVKSourceFile;
.parse(new TextDecoder().decode(file)) as KVKSourceFile;
} catch(e) {
if(file.byteLength > 4 && file.subarray(0,3).every((v,i) => v == KVK_HEADER_IDENTIFIER_BYTES[i])) {
throw new Error('File appears to be a binary .kvk file', {cause: e});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class LDMLKeyboardXMLSourceFileReader {

loadTestDataUnboxed(file: Uint8Array): any {
const source = new KeymanXMLReader('keyboardTest3')
.parse(file.toString()) as any;
.parse(new TextDecoder().decode(file)) as any;
return source;
}

Expand Down
2 changes: 1 addition & 1 deletion developer/src/kmc-package/src/compiler/kmp-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class KmpCompiler implements KeymanCompiler {

try {
a = new KeymanXMLReader('kps')
.parse(data.toString()) as KpsFile.KpsPackage;
.parse(data) as KpsFile.KpsPackage;
} catch(e) {
this.callbacks.reportMessage(PackageCompilerMessages.Error_InvalidPackageFile({e}));
}
Expand Down
11 changes: 5 additions & 6 deletions ios/build.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
#!/usr/bin/env bash

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

# Include our resource functions; they're pretty useful!
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

# Please note that this build script (understandably) assumes that it is running on Mac OS X.
verify_on_mac

builder_describe "Builds Keyman Engine and the Keyman app for use on iOS devices - iPhone and iPad." \
"@/resources/tools/check-markdown test:help" \
"clean" \
"configure" \
"build" \
"test" \
":engine Builds KeymanEngine.xcframework, usable by our main app and by third-party apps" \
":app=keyman Builds the Keyman app for iOS platforms" \
":help Online documentation" \
":sample1=Samples/KMSample1 Builds the first KeymanEngine sample app" \
":sample2=Samples/KMSample2 Builds the second KeymanEngine sample app" \
":fv=../oem/firstvoices/ios Builds OEM FirstVoices for iOS platforms" \
"--sim-artifact+ Also outputs a simulator-friendly test artifact corresponding to the build"

builder_parse "$@"

builder_run_child_actions clean configure build
builder_run_child_actions clean configure build test
builder_run_action test:help check-markdown "$KEYMAN_ROOT/ios/docs/help"
5 changes: 5 additions & 0 deletions linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"

################################ Main script ################################

builder_describe \
"Build Keyman for Linux." \
"@/resources/tools/check-markdown test:help" \
":config=keyman-config keyman-config" \
":engine=ibus-keyman ibus-keyman" \
":help Online documentation" \
":service=keyman-system-service keyman-system-service" \
"clean" \
"configure" \
Expand All @@ -36,3 +40,4 @@ test_action() {
}

builder_run_action test test_action
builder_run_action test:help check-markdown "$KEYMAN_ROOT/linux/docs/help"
8 changes: 6 additions & 2 deletions linux/scripts/verify_api.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ check_api_not_changed() {
trap "rm -rf \"${tmpDir}\"" ERR
dpkg -x "${BIN_PKG}" "${tmpDir}"
mkdir -p debian/tmp/DEBIAN
dpkg-gensymbols -v"${VERSION}" -p"${PKG_NAME}" -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/"${LIB_NAME}".so* -c4
output_ok "${LIB_NAME} API didn't change"
if dpkg-gensymbols -v"${VERSION}" -p"${PKG_NAME}" -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/"${LIB_NAME}".so* -c4; then
output_ok "${LIB_NAME} API didn't change"
else
output_error "${LIB_NAME} API changed"
EXIT_CODE=4
fi
cd "${REPO_ROOT}/linux"
rm -rf "${tmpDir}"
trap ERR
Expand Down
11 changes: 5 additions & 6 deletions mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

# Include our resource functions; they're pretty useful!
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
. "$KEYMAN_ROOT/resources/build/build-help.inc.sh"
. "$KEYMAN_ROOT/mac/mac-utils.inc.sh"

builder_describe "Builds Keyman for macOS." \
"@/core:mac" \
"@/resources/tools/check-markdown test:help" \
"clean" \
"configure" \
"build" \
Expand All @@ -20,12 +20,10 @@ builder_describe "Builds Keyman for macOS." \
"install Installs result of Keyman4MacIM locally." \
":engine KeymanEngine4Mac" \
":app Keyman4MacIM" \
":help Online documentation" \
":testapp Keyman4Mac (test harness)" \
"--quick,-q Bypasses notarization for $(builder_term install)"

# Please note that this build script (understandably) assumes that it is running on Mac OS X.
verify_on_mac

builder_parse "$@"

# Default is release build of Engine and (code-signed) Input Method
Expand Down Expand Up @@ -89,8 +87,8 @@ UPLOAD_SENTRY=false

# Import local environment variables for build
#
# /mac/localenv.sh can be used to define CERTIFICATE_ID,
# APPSTORECONNECT_PROVIDER, APPSTORECONNECT_USERNAME,
# /mac/localenv.sh can be used to define CERTIFICATE_ID,
# APPSTORECONNECT_PROVIDER, APPSTORECONNECT_USERNAME,
# APPSTORECONNECT_PASSWORD, DEVELOPMENT_TEAM variables;
# see /mac/README.md for details.
#
Expand Down Expand Up @@ -304,6 +302,7 @@ builder_run_action build:testapp do_build_testapp

builder_run_action test:engine execBuildCommand $ENGINE_NAME "xcodebuild -project \"$KME4M_PROJECT_PATH\" $BUILD_OPTIONS test -scheme $ENGINE_NAME"
builder_run_action test:app execBuildCommand "$IM_NAME-tests" "xcodebuild test -workspace \"$KMIM_WORKSPACE_PATH\" $CODESIGNING_SUPPRESSION $BUILD_OPTIONS -scheme Keyman SYMROOT=\"$KM4MIM_BASE_PATH/build\""
builder_run_action test:help check-markdown "$KEYMAN_ROOT/mac/docs/help"

builder_run_action install do_install

Expand Down
94 changes: 94 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"scripts": {},
"workspaces": [
"resources/gosh",
"resources/tools/check-markdown",
"resources/tools/strip-emoji",
"resources/build/version",
"core/include/ldml",
Expand Down
4 changes: 4 additions & 0 deletions resources/shellHelperFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,7 @@ _select_node_version_with_nvm() {
builder_die "Attempted to select node.js version $REQUIRED_NODE_VERSION but found $CURRENT_NODE_VERSION instead"
fi
}

check-markdown() {
node "$KEYMAN_ROOT/resources/tools/check-markdown" --root "$1"
}
Loading

0 comments on commit 70772ef

Please sign in to comment.