mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-13 17:37:31 +00:00
chore(common): Merge remote-tracking branch 'origin/master' into maint/common/7z-inc-sh
# 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
This commit is contained in:
commit
63465ca2f5
138 changed files with 1393 additions and 841 deletions
4
.github/workflows/api-verification.yml
vendored
4
.github/workflows/api-verification.yml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
name: Verify API for libkeymancore*.so
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
VERSION: ${{ steps.environment_step.outputs.VERSION }}
|
||||
KEYMAN_VERSION: ${{ steps.environment_step.outputs.KEYMAN_VERSION }}
|
||||
PRERELEASE_TAG: ${{ steps.environment_step.outputs.PRERELEASE_TAG }}
|
||||
GIT_SHA: ${{ steps.environment_step.outputs.GIT_SHA }}
|
||||
GIT_BASE: ${{ steps.environment_step.outputs.GIT_BASE }}
|
||||
|
|
@ -69,7 +69,7 @@ jobs:
|
|||
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
|
||||
|
||||
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")
|
||||
BIN_PACKAGE=$(ls "${GITHUB_WORKSPACE}/artifacts/" | grep "${PKG_NAME}[0-9]*_${{ steps.environment_step.outputs.KEYMAN_VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb")
|
||||
cd ${{ github.workspace }}/keyman/linux
|
||||
./scripts/deb-packaging.sh \
|
||||
--gha \
|
||||
|
|
|
|||
24
.github/workflows/deb-packaging.yml
vendored
24
.github/workflows/deb-packaging.yml
vendored
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
if: github.repository == 'keymanapp/keyman'
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
VERSION: ${{ steps.version_step.outputs.VERSION }}
|
||||
KEYMAN_VERSION: ${{ steps.version_step.outputs.KEYMAN_VERSION }}
|
||||
PRERELEASE_TAG: ${{ steps.prerelease_tag.outputs.PRERELEASE_TAG }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -72,10 +72,10 @@ jobs:
|
|||
- name: Build source package
|
||||
id: build_source_package
|
||||
run: |
|
||||
export TIER=$(cat TIER.md)
|
||||
export KEYMAN_TIER=$(cat TIER.md)
|
||||
export GHA_TEST_BUILD="${{ github.event.client_payload.isTestBuild }}"
|
||||
export GHA_BRANCH="${{ github.event.client_payload.branch }}"
|
||||
echo "TIER=$TIER" >> $GITHUB_ENV
|
||||
echo "KEYMAN_TIER=$KEYMAN_TIER" >> $GITHUB_ENV
|
||||
echo "GHA_TEST_BUILD=${GHA_TEST_BUILD}" >> $GITHUB_ENV
|
||||
echo "GHA_BRANCH=${GHA_BRANCH}" >> $GITHUB_ENV
|
||||
cd linux
|
||||
|
|
@ -87,7 +87,7 @@ jobs:
|
|||
run: |
|
||||
THIS_SCRIPT="$GITHUB_WORKSPACE/.github/workflows/deb-packaging.yml"
|
||||
. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "KEYMAN_VERSION=$KEYMAN_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set prerelease tag as output parameter
|
||||
id: prerelease_tag
|
||||
|
|
@ -103,9 +103,9 @@ jobs:
|
|||
- name: Output which branch or PR we're building plus name of .dsc file
|
||||
run: |
|
||||
if [ "${{ github.event.client_payload.isTestBuild }}" == "true" ]; then
|
||||
echo ":checkered_flag: **Test build of version ${{ steps.version_step.outputs.VERSION }} for ${{ github.event.client_payload.branch }}**" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":checkered_flag: **Test build of version ${{ steps.version_step.outputs.KEYMAN_VERSION }} for ${{ github.event.client_payload.branch }}**" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo ":ship: **Release build of ${{ github.event.client_payload.branch }} branch (${{ github.event.client_payload.branch}}), version ${{ steps.version_step.outputs.VERSION }}**" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":ship: **Release build of ${{ github.event.client_payload.branch }} branch (${{ github.event.client_payload.branch}}), version ${{ steps.version_step.outputs.KEYMAN_VERSION }}**" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":gift: Generated source package:" >> $GITHUB_STEP_SUMMARY
|
||||
|
|
@ -140,7 +140,7 @@ jobs:
|
|||
uses: ./.github/actions/build-binary-packages
|
||||
with:
|
||||
dist: ${{ matrix.dist }}
|
||||
version: ${{ needs.sourcepackage.outputs.VERSION }}
|
||||
version: ${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}
|
||||
prerelease_tag: ${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}
|
||||
deb_fullname: ${{env.DEBFULLNAME}}
|
||||
deb_email: ${{env.DEBEMAIL}}
|
||||
|
|
@ -166,7 +166,7 @@ jobs:
|
|||
uses: ./.github/actions/build-binary-packages
|
||||
with:
|
||||
dist: ${{ matrix.dist }}
|
||||
version: ${{ needs.sourcepackage.outputs.VERSION }}
|
||||
version: ${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}
|
||||
prerelease_tag: ${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}
|
||||
deb_fullname: ${{env.DEBFULLNAME}}
|
||||
deb_email: ${{env.DEBEMAIL}}
|
||||
|
|
@ -211,8 +211,8 @@ jobs:
|
|||
- name: Sign packages
|
||||
uses: sillsdev/gha-deb-signing@a38dbde6bc9afabede5e07609105acc83c760ad4 # v0.6
|
||||
with:
|
||||
src-pkg-name: "keyman_${{ needs.sourcepackage.outputs.VERSION }}-1_source.changes"
|
||||
bin-pkg-name: "keyman_${{ needs.sourcepackage.outputs.VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+"
|
||||
src-pkg-name: "keyman_${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}-1_source.changes"
|
||||
bin-pkg-name: "keyman_${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+"
|
||||
artifacts-prefix: "keyman-"
|
||||
artifacts-result-name: "keyman-signedpkgs"
|
||||
gpg-signing-key: "${{ secrets.GPG_SIGNING_KEY }}"
|
||||
|
|
@ -293,7 +293,7 @@ jobs:
|
|||
echo "::endgroup::"
|
||||
|
||||
echo -e "::group::${COLOR_GREEN}Uploading binary packages"
|
||||
pattern="keyman_${{ needs.sourcepackage.outputs.VERSION }}.+\+(.*)[0-9]_[^.]+.changes"
|
||||
pattern="keyman_${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}.+\+(.*)[0-9]_[^.]+.changes"
|
||||
for f in *_amd64.changes; do
|
||||
if [[ $f =~ $pattern ]]; then
|
||||
dist=${BASH_REMATCH[1]}
|
||||
|
|
@ -316,7 +316,7 @@ jobs:
|
|||
|
||||
- name: Save environment
|
||||
run: |
|
||||
echo "VERSION=${{ needs.sourcepackage.outputs.VERSION }}" > artifacts/env
|
||||
echo "KEYMAN_VERSION=${{ needs.sourcepackage.outputs.KEYMAN_VERSION }}" > artifacts/env
|
||||
echo "PRERELEASE_TAG=${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}" >> artifacts/env
|
||||
echo "GIT_SHA=${{ github.event.client_payload.buildSha }}" >> artifacts/env
|
||||
echo "GIT_BASE=${{ github.event.client_payload.baseRef }}" >> artifacts/env
|
||||
|
|
|
|||
46
HISTORY.md
46
HISTORY.md
|
|
@ -1,5 +1,34 @@
|
|||
# Keyman Version History
|
||||
|
||||
## 19.0.34 alpha 2025-05-08
|
||||
|
||||
* docs(common): update `builder_echo` documentation for TC blocks (#13855)
|
||||
* fix(windows): add breadcrumb to download failures (#13826)
|
||||
* fix(web): sustain active batched-layout mode when keyboard is switched (#13860)
|
||||
* maint(common): remove obsolete code from docker-images `build.sh` (#13861)
|
||||
* maint(common): output start/end messages if not running on TC (#13868)
|
||||
|
||||
## 19.0.33 alpha 2025-05-07
|
||||
|
||||
* maint(common): automatically set --debug option for local-environment builder-script uses (#13827)
|
||||
* docs(web): add a Web engine keystroke lifecycle internal doc (#13759)
|
||||
* maint(common): use function to detect if running on TC (#13844)
|
||||
* docs(common): document new `builder_is_running_on_teamcity` function (#13852)
|
||||
|
||||
## 19.0.32 alpha 2025-05-06
|
||||
|
||||
* change(web): replace USVString with string in predictive-text engine (#13785)
|
||||
* chore(web): replace --ci flag with builder_is_ci_build (#13819)
|
||||
* maint(web): simplify worker-main test.sh (#13820)
|
||||
* change(web): lint kmwstring web-utility (#13800)
|
||||
* fix(web): fix extraction of gesture-engine fixture used in DOM-based unit tests (#13805)
|
||||
* fix(web): add robustness for bad touch-layout fontsize specs (#13774)
|
||||
* fix(web): fix var declaration affected by linter strictness + length-style fix (#13839)
|
||||
* chore(ios): Update inuktitut_pirurvik to 1.4.1 (#13840)
|
||||
* chore(common): override check when running on TC (#13779)
|
||||
* change(linux): add ICU dependency needed to build on Arch Linux (#13842)
|
||||
* maint(common): add support for TC blocks (#13810)
|
||||
|
||||
## 19.0.31 alpha 2025-05-05
|
||||
|
||||
* fix(mac): add version metadata after building tests (#13818)
|
||||
|
|
@ -162,6 +191,23 @@
|
|||
* refactor(windows): rename `TKeymanMutex.MutexOwned` to `TakeOwnership` and add `ReleaseOwnership` (#13168)
|
||||
* chore: increment to alpha 19.0 (#13187)
|
||||
|
||||
## 18.0.236 stable 2025-05-12
|
||||
|
||||
* chore(linux): Update debian changelog (#13737)
|
||||
* chore(linux): add a stub unit test to allow successful coverage reporting (#13741)
|
||||
* fix(android): Use Alert Dialog if keyboard pkg missing languages (#13802)
|
||||
* maint(web): merge LMLayer CI build config with standard Web CI build config (#13808)
|
||||
* fix(ios): restore keyboard-scale settings for older, still-supported iOS devices (#13817)
|
||||
* change(ios): limit reports about devices without predefined scaling entries (#13828)
|
||||
* chore(ios): Update inuktitut_pirurvik to 1.4.1 (#13841)
|
||||
* fix(web): add robustness for bad touch-layout fontsize specs (#13838)
|
||||
* change(linux): add ICU dependency needed to build on Arch Linux (#13843)
|
||||
* fix(mac): add version metadata after building tests (#13853)
|
||||
* fix(web): sustain active batched-layout mode when keyboard is switched (#13863)
|
||||
* fix(developer): remove ngrok binary at build time (#13873)
|
||||
* maint(common): apply new codeowners from master (#13874)
|
||||
* chore(mac,windows): Update Crowdin strings for Italian (#13872)
|
||||
|
||||
## 18.0.234 beta 2025-04-22
|
||||
|
||||
* fix(android): Require RELEASE_OEM env vars to build FirstVoices Android (#13725)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
19.0.32
|
||||
19.0.35
|
||||
|
|
@ -12,7 +12,7 @@ function generateReleaseNotes() {
|
|||
# Reference: https://github.com/Triple-T/gradle-play-publisher#uploading-release-notes
|
||||
#
|
||||
local PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/$TIER.txt"
|
||||
if [ $TIER = "stable" ]; then
|
||||
if [ $KEYMAN_TIER = "stable" ]; then
|
||||
PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/default.txt"
|
||||
fi
|
||||
builder_heading "Generating Play Store release notes to $PLAY_RELEASE_NOTES"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ fi
|
|||
|
||||
builder_describe_outputs \
|
||||
configure /android/KMAPro/kMAPro/libs/keyman-engine.aar \
|
||||
build /android/KMAPro/kMAPro/build/outputs/apk/$CONFIG/keyman-${VERSION}.apk
|
||||
build /android/KMAPro/kMAPro/build/outputs/apk/$CONFIG/keyman-${KEYMAN_VERSION}.apk
|
||||
|
||||
#### Build
|
||||
|
||||
|
|
@ -57,12 +57,12 @@ fi
|
|||
#### Build action definitions ####
|
||||
|
||||
function makeLocalSentryRelease() {
|
||||
echo "Making a Sentry release for tag $VERSION_GIT_TAG"
|
||||
echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG"
|
||||
sentry-cli upload-dif -p keyman-android --include-sources
|
||||
sentry-cli releases -p keyman-android files $VERSION_GIT_TAG upload-sourcemaps ./
|
||||
sentry-cli releases -p keyman-android files $KEYMAN_VERSION_GIT_TAG upload-sourcemaps ./
|
||||
|
||||
echo "Finalizing release tag $VERSION_GIT_TAG"
|
||||
sentry-cli releases finalize "$VERSION_GIT_TAG"
|
||||
echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG"
|
||||
sentry-cli releases finalize "$KEYMAN_VERSION_GIT_TAG"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ android {
|
|||
//dumpProperties(project) // Use this to dump all external properties for debugging TeamCity integration
|
||||
//println "===END DUMP==="
|
||||
|
||||
// VERSION strings from version.gradle
|
||||
versionCode VERSION_CODE as Integer
|
||||
versionName VERSION_NAME
|
||||
buildConfigField 'String', 'VERSION_ENVIRONMENT', '"'+VERSION_ENVIRONMENT+'"'
|
||||
buildConfigField 'String', 'VERSION_GIT_TAG', '"'+VERSION_GIT_TAG+'"'
|
||||
// KEYMAN_VERSION strings from version.gradle
|
||||
versionCode KEYMAN_VERSION_CODE as Integer
|
||||
versionName KEYMAN_VERSION_NAME
|
||||
buildConfigField 'String', 'KEYMAN_VERSION_ENVIRONMENT', '"'+KEYMAN_VERSION_ENVIRONMENT+'"'
|
||||
buildConfigField 'String', 'KEYMAN_VERSION_GIT_TAG', '"'+KEYMAN_VERSION_GIT_TAG+'"'
|
||||
}
|
||||
|
||||
String env_release_store_file = System.getenv("release_store_file")
|
||||
|
|
@ -77,7 +77,7 @@ android {
|
|||
// - PR builds also have "-test-1234" suffix (where 1234 is PR#)
|
||||
// Gradle sync will nullify these values, so have a fallback
|
||||
String appSuffix = ''
|
||||
String tag = VERSION_TAG ? VERSION_TAG : '-' + tier;
|
||||
String tag = KEYMAN_VERSION_TAG ? KEYMAN_VERSION_TAG : '-' + tier;
|
||||
if (tag.startsWithAny("-beta", "beta")) {
|
||||
appSuffix = ' Beta';
|
||||
} else if (tag.startsWithAny("-alpha", "alpha")) {
|
||||
|
|
@ -88,16 +88,16 @@ android {
|
|||
// -test-PR_NUMBER
|
||||
appSuffix = appSuffix + match.group(1)
|
||||
} else {
|
||||
String environment = VERSION_ENVIRONMENT ? VERSION_ENVIRONMENT : 'local';
|
||||
String environment = KEYMAN_VERSION_ENVIRONMENT ? KEYMAN_VERSION_ENVIRONMENT : 'local';
|
||||
if (environment.matches("local")) {
|
||||
appSuffix = appSuffix + '-' + environment;
|
||||
}
|
||||
}
|
||||
variant.resValue "string", "app_name", 'Keyman' + appSuffix;
|
||||
|
||||
// Adjust output name to "keyman-${VERSION_MD}.apk"
|
||||
// Adjust output name to "keyman-${KEYMAN_VERSION_MD}.apk"
|
||||
variant.outputs.all {
|
||||
outputFileName = "keyman-" + VERSION_MD + ".apk"
|
||||
outputFileName = "keyman-" + KEYMAN_VERSION_MD + ".apk"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
Log.d(TAG, "Initializing Sentry");
|
||||
SentryAndroid.init(getApplicationContext(), options -> {
|
||||
options.setEnableAutoSessionTracking(false);
|
||||
options.setRelease(com.tavultesoft.kmapro.BuildConfig.VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.VERSION_ENVIRONMENT);
|
||||
options.setRelease(com.tavultesoft.kmapro.BuildConfig.KEYMAN_VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.KEYMAN_VERSION_ENVIRONMENT);
|
||||
});
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene
|
|||
if (KMManager.getMaySendCrashReport()) {
|
||||
SentryAndroid.init(context, options -> {
|
||||
options.setEnableAutoSessionTracking(false);
|
||||
options.setRelease(com.tavultesoft.kmapro.BuildConfig.VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.VERSION_ENVIRONMENT);
|
||||
options.setRelease(com.tavultesoft.kmapro.BuildConfig.KEYMAN_VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.KEYMAN_VERSION_ENVIRONMENT);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
|
||||
// VERSION_CODE and VERSION_NAME from version.gradle but Gradle removes them for libraries
|
||||
buildConfigField "String", "KEYMAN_ENGINE_VERSION_NAME", "\""+VERSION_NAME+"\""
|
||||
buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\""
|
||||
// KEYMAN_VERSION_CODE and KEYMAN_VERSION_NAME from version.gradle but Gradle removes them for libraries
|
||||
buildConfigField "String", "KEYMAN_ENGINE_VERSION_NAME", "\""+KEYMAN_VERSION_NAME+"\""
|
||||
buildConfigField "String", "KEYMAN_VERSION_ENVIRONMENT", "\""+KEYMAN_VERSION_ENVIRONMENT+"\""
|
||||
|
||||
// Sepcify library filename keyman-engine-$CONFIG.aar
|
||||
setProperty("archivesBaseName", "keyman-engine")
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ public final class VersionUtils {
|
|||
public static final String TAG = "VersionUtils";
|
||||
|
||||
public static boolean isLocalBuild() {
|
||||
return BuildConfig.VERSION_ENVIRONMENT.equalsIgnoreCase("local");
|
||||
return BuildConfig.KEYMAN_VERSION_ENVIRONMENT.equalsIgnoreCase("local");
|
||||
}
|
||||
|
||||
public static boolean isTestBuild() {
|
||||
return BuildConfig.VERSION_ENVIRONMENT.equalsIgnoreCase("test");
|
||||
return BuildConfig.KEYMAN_VERSION_ENVIRONMENT.equalsIgnoreCase("test");
|
||||
}
|
||||
|
||||
// Utility for local and PR test builds - e.g. force check of keyboard updates
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
|
||||
// VERSION_CODE and VERSION_NAME from version.gradle
|
||||
versionCode VERSION_CODE as Integer
|
||||
versionName VERSION_NAME
|
||||
buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\""
|
||||
// KEYMAN_VERSION_CODE and KEYMAN_VERSION_NAME from version.gradle
|
||||
versionCode KEYMAN_VERSION_CODE as Integer
|
||||
versionName KEYMAN_VERSION_NAME
|
||||
buildConfigField "String", "KEYMAN_VERSION_ENVIRONMENT", "\""+KEYMAN_VERSION_ENVIRONMENT+"\""
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
|
||||
// VERSION_CODE and VERSION_NAME from version.gradle
|
||||
versionCode VERSION_CODE as Integer
|
||||
versionName VERSION_NAME
|
||||
buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\""
|
||||
// KEYMAN_VERSION_CODE and KEYMAN_VERSION_NAME from version.gradle
|
||||
versionCode KEYMAN_VERSION_CODE as Integer
|
||||
versionName KEYMAN_VERSION_NAME
|
||||
buildConfigField "String", "KEYMAN_VERSION_ENVIRONMENT", "\""+KEYMAN_VERSION_ENVIRONMENT+"\""
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
//
|
||||
|
||||
def getVersionCode = { ->
|
||||
String env_version_major = System.getenv("VERSION_MAJOR")
|
||||
String env_version_minor = System.getenv("VERSION_MINOR")
|
||||
String env_version_patch = System.getenv("VERSION_PATCH")
|
||||
String env_version_major = System.getenv("KEYMAN_VERSION_MAJOR")
|
||||
String env_version_minor = System.getenv("KEYMAN_VERSION_MINOR")
|
||||
String env_version_patch = System.getenv("KEYMAN_VERSION_PATCH")
|
||||
if(env_version_patch != null && env_version_minor != null && env_version_patch != null) {
|
||||
// Version code is, for 17.1.33: 1810033. This supports up to 9999
|
||||
// builds for a given major.minor version. We only support up to 9 minor
|
||||
|
|
@ -36,10 +36,10 @@ def getVersionCode = { ->
|
|||
}
|
||||
|
||||
def getVersionMD = { ->
|
||||
String env_version = System.getenv("VERSION")
|
||||
String env_version = System.getenv("KEYMAN_VERSION")
|
||||
if (env_version != null) {
|
||||
// If building from script, we have build number in VERSION
|
||||
println "Using build $env_version from VERSION"
|
||||
// If building from script, we have build number in KEYMAN_VERSION
|
||||
println "Using build $env_version from KEYMAN_VERSION"
|
||||
return "$env_version"
|
||||
} else {
|
||||
String version_md = file("$rootPath/../VERSION.md").text.trim()
|
||||
|
|
@ -48,15 +48,15 @@ def getVersionMD = { ->
|
|||
}
|
||||
|
||||
def getVersionName = { ->
|
||||
String env_version = System.getenv("VERSION_WITH_TAG")
|
||||
String env_version = System.getenv("KEYMAN_VERSION_WITH_TAG")
|
||||
if (env_version != null) {
|
||||
// If building from script, we have build number in VERSION_WITH_TAG
|
||||
println "Using build $env_version from VERSION_WITH_TAG"
|
||||
// If building from script, we have build number in KEYMAN_VERSION_WITH_TAG
|
||||
println "Using build $env_version from KEYMAN_VERSION_WITH_TAG"
|
||||
return "$env_version"
|
||||
} else {
|
||||
// Building probably from IDE, so let's use VERSION.md and TIER.md directly
|
||||
// This is a close match with VERSION_WITH_TAG, except that 'stable' tier
|
||||
// is not normally included with VERSION_WITH_TAG
|
||||
// This is a close match with KEYMAN_VERSION_WITH_TAG, except that 'stable' tier
|
||||
// is not normally included with KEYMAN_VERSION_WITH_TAG
|
||||
String version_md = file("$rootPath/../VERSION.md").text.trim()
|
||||
String tier_md = file("$rootPath/../TIER.md").text.trim()
|
||||
println "Using build $version_md-$tier_md-local from project VERSION.md/TIER.md"
|
||||
|
|
@ -65,10 +65,10 @@ def getVersionName = { ->
|
|||
}
|
||||
|
||||
def getVersionEnvironment = { ->
|
||||
String env_environment = System.getenv("VERSION_ENVIRONMENT")
|
||||
String env_environment = System.getenv("KEYMAN_VERSION_ENVIRONMENT")
|
||||
if (env_environment != null) {
|
||||
// If building from script, we have build number in VERSION_ENVIRONMENT
|
||||
println "Using $env_environment from VERSION_ENVIRONMENT"
|
||||
// If building from script, we have build number in KEYMAN_VERSION_ENVIRONMENT
|
||||
println "Using $env_environment from KEYMAN_VERSION_ENVIRONMENT"
|
||||
return "$env_environment"
|
||||
} else {
|
||||
// Building probably from IDE, so use "local"
|
||||
|
|
@ -78,23 +78,23 @@ def getVersionEnvironment = { ->
|
|||
}
|
||||
|
||||
def getVersionGitTag = { ->
|
||||
String env_git_tag = System.getenv("VERSION_GIT_TAG")
|
||||
String env_git_tag = System.getenv("KEYMAN_VERSION_GIT_TAG")
|
||||
if (env_git_tag != null) {
|
||||
println "Using $env_git_tag from VERSION_GIT_TAG"
|
||||
println "Using $env_git_tag from KEYMAN_VERSION_GIT_TAG"
|
||||
return "$env_git_tag"
|
||||
} else {
|
||||
// Building probably from IDE
|
||||
println "Using release@$VERSION_NAME"
|
||||
return "release@$VERSION_NAME"
|
||||
println "Using release@$KEYMAN_VERSION_NAME"
|
||||
return "release@$KEYMAN_VERSION_NAME"
|
||||
}
|
||||
}
|
||||
ext {
|
||||
VERSION_CODE=getVersionCode()
|
||||
VERSION_MD=getVersionMD()
|
||||
VERSION_NAME=getVersionName()
|
||||
VERSION_ENVIRONMENT=getVersionEnvironment()
|
||||
VERSION_TAG=System.getenv("VERSION_TAG")
|
||||
VERSION_GIT_TAG=getVersionGitTag()
|
||||
KEYMAN_VERSION_CODE=getVersionCode()
|
||||
KEYMAN_VERSION_MD=getVersionMD()
|
||||
KEYMAN_VERSION_NAME=getVersionName()
|
||||
KEYMAN_VERSION_ENVIRONMENT=getVersionEnvironment()
|
||||
KEYMAN_VERSION_TAG=System.getenv("KEYMAN_VERSION_TAG")
|
||||
KEYMAN_VERSION_GIT_TAG=getVersionGitTag()
|
||||
}
|
||||
|
||||
//println "version.gradle: VERSION_TAG: " + VERSION_TAG
|
||||
//println "version.gradle: KEYMAN_VERSION_TAG: " + KEYMAN_VERSION_TAG
|
||||
|
|
@ -40,10 +40,10 @@ function build_index() {
|
|||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>Test Keyboards - $VERSION_WITH_TAG</title>
|
||||
<title>Test Keyboards - $KEYMAN_VERSION_WITH_TAG</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test Keyboards - $VERSION_WITH_TAG</h1>
|
||||
<h1>Test Keyboards - $KEYMAN_VERSION_WITH_TAG</h1>
|
||||
<ul>
|
||||
EOF
|
||||
|
||||
|
|
@ -90,4 +90,4 @@ function build() {
|
|||
fi
|
||||
}
|
||||
|
||||
builder_run_action build build
|
||||
builder_run_action build build
|
||||
|
|
|
|||
|
|
@ -33,16 +33,16 @@ function do_build() {
|
|||
// Note: does not use the 'default' keyword so that the export name is
|
||||
// correct when converted to a CommonJS module with \`esbuild\`.
|
||||
export class KEYMAN_VERSION {
|
||||
static readonly VERSION = \"$VERSION\";
|
||||
static readonly VERSION_RELEASE =\"$VERSION_RELEASE\";
|
||||
static readonly VERSION_MAJOR = \"$VERSION_MAJOR\";
|
||||
static readonly VERSION_MINOR = \"$VERSION_MINOR\";
|
||||
static readonly VERSION_PATCH = \"$VERSION_PATCH\";
|
||||
static readonly TIER =\"$TIER\";
|
||||
static readonly VERSION_TAG = \"$VERSION_TAG\";
|
||||
static readonly VERSION_WITH_TAG = \"$VERSION_WITH_TAG\";
|
||||
static readonly VERSION_ENVIRONMENT = \"$VERSION_ENVIRONMENT\";
|
||||
static readonly VERSION_GIT_TAG = \"$VERSION_GIT_TAG\";
|
||||
static readonly VERSION = \"$KEYMAN_VERSION\";
|
||||
static readonly VERSION_RELEASE =\"$KEYMAN_VERSION_RELEASE\";
|
||||
static readonly VERSION_MAJOR = \"$KEYMAN_VERSION_MAJOR\";
|
||||
static readonly VERSION_MINOR = \"$KEYMAN_VERSION_MINOR\";
|
||||
static readonly VERSION_PATCH = \"$KEYMAN_VERSION_PATCH\";
|
||||
static readonly TIER =\"$KEYMAN_TIER\";
|
||||
static readonly VERSION_TAG = \"$KEYMAN_VERSION_TAG\";
|
||||
static readonly VERSION_WITH_TAG = \"$KEYMAN_VERSION_WITH_TAG\";
|
||||
static readonly VERSION_ENVIRONMENT = \"$KEYMAN_VERSION_ENVIRONMENT\";
|
||||
static readonly VERSION_GIT_TAG = \"$KEYMAN_VERSION_GIT_TAG\";
|
||||
}
|
||||
|
||||
// Also provides it as a 'default' export.
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ function do_configure() {
|
|||
function do_test() {
|
||||
local MOCHA_FLAGS=
|
||||
|
||||
if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then
|
||||
if builder_is_running_on_teamcity; then
|
||||
# we're running in TeamCity
|
||||
MOCHA_FLAGS="-reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -5,18 +5,6 @@
|
|||
|
||||
/****************************** Lexical Models ******************************/
|
||||
|
||||
/**
|
||||
* A JavaScript string with the restriction that it must only
|
||||
* contain Unicode scalar values.
|
||||
*
|
||||
* This means that any lone high surrogate must be paired with
|
||||
* a low surrogate, if it exists. Lone surrogate code units are
|
||||
* forbidden.
|
||||
*
|
||||
* See also: https://developer.mozilla.org/en-US/docs/Web/API/USVString
|
||||
*/
|
||||
export type USVString = string;
|
||||
|
||||
export type CasingForm = 'lower' | 'initial' | 'upper';
|
||||
|
||||
/**
|
||||
|
|
@ -67,7 +55,7 @@ export interface LexiconTraversal {
|
|||
* - If `char` = 'e', the child represents a prefix of 'the'.
|
||||
* - Then `traversal` allows traversing the part of the lexicon prefixed by 'the'.
|
||||
*/
|
||||
children(): Generator<{char: USVString, traversal: () => LexiconTraversal}>;
|
||||
children(): Generator<{char: string, traversal: () => LexiconTraversal}>;
|
||||
|
||||
/**
|
||||
* Allows direct access to the traversal state that results when appending one
|
||||
|
|
@ -81,7 +69,7 @@ export interface LexiconTraversal {
|
|||
* That is, if a model "keys" `è` to `e`, there will be no `è` child.
|
||||
* @param char
|
||||
*/
|
||||
child(char: USVString): LexiconTraversal | undefined;
|
||||
child(char: string): LexiconTraversal | undefined;
|
||||
|
||||
/**
|
||||
* Any entries directly keyed by the currently-represented lookup prefix. Entries and
|
||||
|
|
@ -178,7 +166,7 @@ export interface LexicalModel {
|
|||
* @param text The original input text.
|
||||
* @returns The 'keyed' form of that text.
|
||||
*/
|
||||
toKey?(text: USVString): USVString;
|
||||
toKey?(text: string): string;
|
||||
|
||||
/**
|
||||
* Generates predictive suggestions corresponding to the state of context after the proposed
|
||||
|
|
@ -248,7 +236,7 @@ export interface LexicalModel {
|
|||
* @param context
|
||||
* @deprecated
|
||||
*/
|
||||
wordbreak?(context: Context): USVString;
|
||||
wordbreak?(context: Context): string;
|
||||
|
||||
/**
|
||||
* Lexical models _may_ provide a LexiconTraversal object usable to enhance
|
||||
|
|
@ -279,7 +267,7 @@ export interface Transform {
|
|||
*
|
||||
* Corresponds to `s` in com.keyman.KeyboardInterface.output.
|
||||
*/
|
||||
insert: USVString;
|
||||
insert: string;
|
||||
|
||||
/**
|
||||
* The number of code units to delete to the left of the cursor.
|
||||
|
|
@ -380,7 +368,7 @@ export interface Context {
|
|||
* buffer. If there is nothing to the left of the buffer, this is
|
||||
* an empty string.
|
||||
*/
|
||||
readonly left: USVString;
|
||||
readonly left: string;
|
||||
|
||||
/**
|
||||
* Up to maxRightContextCodeUnits code units of Unicode scalar value
|
||||
|
|
@ -390,7 +378,7 @@ export interface Context {
|
|||
*
|
||||
* This property may be missing entirely.
|
||||
*/
|
||||
readonly right?: USVString;
|
||||
readonly right?: string;
|
||||
|
||||
/**
|
||||
* Whether the insertion point is at the start of the buffer.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { KMXPlus, LdmlKeyboardTypes, LexicalModelTypes } from "@keymanapp/common-types";
|
||||
|
||||
export let u: LexicalModelTypes.USVString;
|
||||
export let u: string;
|
||||
export let l: LexicalModelTypes.Transform;
|
||||
export let s: LexicalModelTypes.Suggestion;
|
||||
export let st: LexicalModelTypes.SuggestionTag;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ var
|
|||
KeymanRoot: string;
|
||||
ReportPath: string;
|
||||
begin
|
||||
if GetEnvironmentVariable('TEAMCITY_VERSION') <> '' then
|
||||
if GetEnvironmentVariable('TEAMCITY_GIT_PATH') <> '' then
|
||||
begin
|
||||
KeymanRoot := ExcludeTrailingPathDelimiter(GetEnvironmentVariable('KEYMAN_ROOT'));
|
||||
ReportPath := ExtractRelativePath(KeymanRoot, ExtractFilePath(ParamStr(0)) + 'dunitx-results.xml');
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ builder_describe "Installation files for Keyman Developer" \
|
|||
# after all other builds complete
|
||||
|
||||
builder_describe_outputs \
|
||||
publish /developer/src/inst/keymandeveloper-${VERSION}.exe
|
||||
publish /developer/src/inst/keymandeveloper-${KEYMAN_VERSION}.exe
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -25,8 +25,8 @@ builder_parse "$@"
|
|||
. "$KEYMAN_ROOT/resources/build/win/zip.inc.sh"
|
||||
|
||||
# In dev environments, we'll hack the tier to alpha; CI sets this for us in real builds.
|
||||
if [[ -z ${TIER+x} ]]; then
|
||||
TIER=alpha
|
||||
if [[ -z ${KEYMAN_TIER+x} ]]; then
|
||||
KEYMAN_TIER=alpha
|
||||
fi
|
||||
|
||||
# We use different directories so that heat generates
|
||||
|
|
@ -90,13 +90,13 @@ function do_test() {
|
|||
function copy-kmdev() {
|
||||
builder_heading copy-kmdev
|
||||
|
||||
mkdir -p "$DEVELOPER_ROOT/release/${VERSION}"
|
||||
mkdir -p "$DEVELOPER_ROOT/release/${KEYMAN_VERSION}"
|
||||
|
||||
make-installer
|
||||
make-kmc-install-zip
|
||||
|
||||
cp -f "$DEVELOPER_ROOT/src/inst/keymandeveloper.msi" "$DEVELOPER_ROOT/release/${VERSION}/keymandeveloper.msi"
|
||||
cp -f "$DEVELOPER_ROOT/src/inst/keymandeveloper-${VERSION}.exe" "$DEVELOPER_ROOT/release/${VERSION}/keymandeveloper-${VERSION}.exe"
|
||||
cp -f "$DEVELOPER_ROOT/src/inst/keymandeveloper.msi" "$DEVELOPER_ROOT/release/${KEYMAN_VERSION}/keymandeveloper.msi"
|
||||
cp -f "$DEVELOPER_ROOT/src/inst/keymandeveloper-${KEYMAN_VERSION}.exe" "$DEVELOPER_ROOT/release/${KEYMAN_VERSION}/keymandeveloper-${KEYMAN_VERSION}.exe"
|
||||
}
|
||||
|
||||
function verify-program-signatures() {
|
||||
|
|
@ -108,7 +108,7 @@ function verify-program-signatures() {
|
|||
function verify-installer-signatures() {
|
||||
builder_heading verify-installer-signatures
|
||||
|
||||
verify-all-executable-signatures-in-folder "$DEVELOPER_ROOT/release/${VERSION}"
|
||||
verify-all-executable-signatures-in-folder "$DEVELOPER_ROOT/release/${KEYMAN_VERSION}"
|
||||
}
|
||||
|
||||
function verify-node-installer-version() {
|
||||
|
|
@ -126,8 +126,8 @@ function verify-node-installer-version() {
|
|||
}
|
||||
|
||||
function test-releaseexists() {
|
||||
if [[ -d "$DEVELOPER_ROOT/release/${VERSION}" ]]; then
|
||||
builder_die "Release ${VERSION} already exists. Delete it or update VERSION.md and try again"
|
||||
if [[ -d "$DEVELOPER_ROOT/release/${KEYMAN_VERSION}" ]]; then
|
||||
builder_die "Release ${KEYMAN_VERSION} already exists. Delete it or update VERSION.md and try again"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -141,12 +141,12 @@ function candle() {
|
|||
heat-kmc
|
||||
|
||||
builder_heading "candle: calling WIX:candle"
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" kmdev.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" "-dXmlSourceDir=${DEVELOPER_ROOT}/src/tike/xml" xml.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" "-dCefSourceDir=${KEYMAN_CEF4DELPHI_ROOT}" cef.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" "-dTemplatesSourceDir=${KEYMAN_DEVELOPER_TEMPLATES_ROOT}" templates.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" "-dkmcSourceDir=${KEYMAN_WIX_TEMP_KMC}" kmc.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dVERSION=${VERSION_WIN}" "-dRELEASE=${VERSION_RELEASE}" "-dServerSourceDir=${KEYMAN_WIX_KMDEV_SERVER}" server.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" kmdev.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" "-dXmlSourceDir=${DEVELOPER_ROOT}/src/tike/xml" xml.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" "-dCefSourceDir=${KEYMAN_CEF4DELPHI_ROOT}" cef.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" "-dTemplatesSourceDir=${KEYMAN_DEVELOPER_TEMPLATES_ROOT}" templates.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" "-dkmcSourceDir=${KEYMAN_WIX_TEMP_KMC}" kmc.wxs
|
||||
"$WIXCANDLE" -wx -nologo "-dKEYMAN_VERSION=${KEYMAN_VERSION_WIN}" "-dRELEASE=${KEYMAN_VERSION_RELEASE}" "-dServerSourceDir=${KEYMAN_WIX_KMDEV_SERVER}" server.wxs
|
||||
}
|
||||
|
||||
function heat-xml() {
|
||||
|
|
@ -230,12 +230,12 @@ function make-installer() {
|
|||
builder_heading make-installer
|
||||
|
||||
echo [Setup] > setup.inf
|
||||
echo "Version=$VERSION" >> setup.inf
|
||||
echo "Version=$KEYMAN_VERSION" >> setup.inf
|
||||
echo "MSIFileName=keymandeveloper.msi" >> setup.inf
|
||||
echo "Title=Keyman Developer ${VERSION_WITH_TAG}" >>setup.inf
|
||||
echo "Title=Keyman Developer ${KEYMAN_VERSION_WITH_TAG}" >>setup.inf
|
||||
wzzip setup.zip keymandeveloper.msi setup.inf
|
||||
cat "$DEVELOPER_PROGRAM/setup.exe" setup.zip > "keymandeveloper-$VERSION.exe"
|
||||
wrap-signcode //d "Keyman Developer" "keymandeveloper-$VERSION.exe"
|
||||
cat "$DEVELOPER_PROGRAM/setup.exe" setup.zip > "keymandeveloper-$KEYMAN_VERSION.exe"
|
||||
wrap-signcode //d "Keyman Developer" "keymandeveloper-$KEYMAN_VERSION.exe"
|
||||
|
||||
#
|
||||
# Zip the files we distribute as part of the standalone kmc distro into release\$Version\kmcomp-$Version.zip
|
||||
|
|
@ -243,7 +243,7 @@ function make-installer() {
|
|||
}
|
||||
|
||||
# TODO: rename this to keyman-developer-cli-$Version.zip
|
||||
KMC_ZIP="$DEVELOPER_ROOT/release/$VERSION/kmcomp-$VERSION.zip"
|
||||
KMC_ZIP="$DEVELOPER_ROOT/release/$KEYMAN_VERSION/kmcomp-$KEYMAN_VERSION.zip"
|
||||
|
||||
function make-kmc-install-zip() {
|
||||
builder_heading make-kmc-install-zip
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*"
|
||||
UpgradeCode="{E99A1F1E-7046-44F9-89EF-D3A59F84B209}" Manufacturer="SIL International"
|
||||
Name="Keyman Developer $(var.RELEASE)" Version="$(var.VERSION)" Language="1033">
|
||||
Name="Keyman Developer $(var.RELEASE)" Version="$(var.KEYMAN_VERSION)" Language="1033">
|
||||
<Package Keywords="Keyman,Keyboard,Engine" Compressed="yes"
|
||||
Description="Keyman Developer $(var.RELEASE)" Comments="Contact: Your local administrator"
|
||||
Manufacturer="SIL International" InstallerVersion="200" Platform="x86" Languages="1033" SummaryCodepage="1252" />
|
||||
|
|
@ -40,10 +40,10 @@
|
|||
|
||||
<Upgrade Id="{E99A1F1E-7046-44F9-89EF-D3A59F84B209}">
|
||||
<UpgradeVersion OnlyDetect="no" Minimum="11.0.0.0" IncludeMinimum="yes"
|
||||
Maximum="$(var.VERSION)" IncludeMaximum="no" MigrateFeatures="yes" Property="VERSION11FOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VERSION)" IncludeMinimum="yes"
|
||||
Maximum="$(var.VERSION)" IncludeMaximum="yes" Property="CURRENTVERSIONFOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VERSION)" IncludeMinimum="no" Property="NEWERFOUND" />
|
||||
Maximum="$(var.KEYMAN_VERSION)" IncludeMaximum="no" MigrateFeatures="yes" Property="VERSION11FOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.KEYMAN_VERSION)" IncludeMinimum="yes"
|
||||
Maximum="$(var.KEYMAN_VERSION)" IncludeMaximum="yes" Property="CURRENTVERSIONFOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.KEYMAN_VERSION)" IncludeMinimum="no" Property="NEWERFOUND" />
|
||||
</Upgrade>
|
||||
|
||||
<Property Id="ALLUSERS"><![CDATA[1]]></Property>
|
||||
|
|
@ -309,7 +309,7 @@
|
|||
|
||||
<Icon Id="TIKE.ico" SourceFile="..\images\KeymanDeveloper90.ico" />
|
||||
|
||||
<CustomAction Id='AlreadyUpdated' Error='[ProductName] has already been updated to $(var.VERSION) or newer.' />
|
||||
<CustomAction Id='AlreadyUpdated' Error='[ProductName] has already been updated to $(var.KEYMAN_VERSION) or newer.' />
|
||||
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
|
||||
|
||||
<Property Id='OLDINSTALLDIR'>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ function do_bundle() {
|
|||
sentry-cli sourcemaps inject \
|
||||
--org keyman \
|
||||
--project keyman-developer \
|
||||
--release "$VERSION_GIT_TAG" \
|
||||
--release "$KEYMAN_VERSION_GIT_TAG" \
|
||||
build/dist/ "${SOURCEMAP_PATHS[@]}"
|
||||
|
||||
# Manually copy over kmcmplib module
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
Sentry.init({
|
||||
dsn: 'https://39b25a09410349a58fe12aaf721565af@o1005580.ingest.sentry.io/5983519', // Keyman Developer
|
||||
environment: '$VERSION_ENVIRONMENT',
|
||||
release: '$VERSION_GIT_TAG'
|
||||
environment: '$KEYMAN_VERSION_ENVIRONMENT',
|
||||
release: '$KEYMAN_VERSION_GIT_TAG'
|
||||
});
|
||||
|
||||
function keymanEnableDiagnostics() {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
/*
|
||||
Version information from build-utils.sh:
|
||||
|
||||
# VERSION: Full current build version, e.g. "14.0.1"
|
||||
# [VERSION_WIN: Full current build version for Windows, e.g. "14.0.1.0"]
|
||||
# VERSION_RELEASE: Current release version, e.g. "14.0"
|
||||
# VERSION_MAJOR: Major version, e.g. "14"
|
||||
# VERSION_MINOR: Minor version, e.g. "0"
|
||||
# VERSION_PATCH: Patch version, e.g. "1"
|
||||
# TIER: Current tier, one of "alpha", "beta" or "stable"
|
||||
# VERSION_TAG: Tier + Pull Request + Location of build [-alpha|-beta][-test[-1234]][-local]
|
||||
# VERSION_WITH_TAG: e.g. "14.0.1-alpha-test-1234" or "14.0.5-beta-local" or "14.0.1-alpha-test"
|
||||
# [KEYMAN_ROOT: fully resolved root path of Keyman repository]
|
||||
# VERSION_ENVIRONMENT: One of: local, test, alpha, beta, stable
|
||||
# VERSION_GIT_TAG: Git tag for the release, "release@$VERSION_WITH_TAG", e.g. "release@14.0.1-alpha-test-1234"
|
||||
# KEYMAN_VERSION: Full current build version, e.g. "14.0.1"
|
||||
# [KEYMAN_VERSION_WIN: Full current build version for Windows, e.g. "14.0.1.0"]
|
||||
# KEYMAN_VERSION_RELEASE: Current release version, e.g. "14.0"
|
||||
# KEYMAN_VERSION_MAJOR: Major version, e.g. "14"
|
||||
# KEYMAN_VERSION_MINOR: Minor version, e.g. "0"
|
||||
# KEYMAN_VERSION_PATCH: Patch version, e.g. "1"
|
||||
# KEYMAN_TIER: Current tier, one of "alpha", "beta" or "stable"
|
||||
# KEYMAN_VERSION_TAG: Tier + Pull Request + Location of build [-alpha|-beta][-test[-1234]][-local]
|
||||
# KEYMAN_VERSION_WITH_TAG: e.g. "14.0.1-alpha-test-1234" or "14.0.5-beta-local" or "14.0.1-alpha-test"
|
||||
# [KEYMAN_ROOT: fully resolved root path of Keyman repository]
|
||||
# KEYMAN_VERSION_ENVIRONMENT: One of: local, test, alpha, beta, stable
|
||||
# KEYMAN_VERSION_GIT_TAG: Git tag for the release, "release@$KEYMAN_VERSION_WITH_TAG", e.g. "release@14.0.1-alpha-test-1234"
|
||||
*/
|
||||
|
||||
export interface Environment {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
Sentry.init({
|
||||
dsn: 'https://39b25a09410349a58fe12aaf721565af@o1005580.ingest.sentry.io/5983519', // Keyman Developer
|
||||
environment: '$VERSION_ENVIRONMENT',
|
||||
release: '$VERSION_GIT_TAG'
|
||||
environment: '$KEYMAN_VERSION_ENVIRONMENT',
|
||||
release: '$KEYMAN_VERSION_GIT_TAG'
|
||||
});
|
||||
|
||||
function keymanEnableDiagnostics() {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ upload_sourcemap() {
|
|||
--no-dedupe \
|
||||
--org keyman \
|
||||
--project keyman-developer \
|
||||
--release "$VERSION_GIT_TAG" \
|
||||
--release "$KEYMAN_VERSION_GIT_TAG" \
|
||||
--ext js --ext mjs --ext ts --ext map \
|
||||
"$smpath"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -634,6 +634,10 @@ Wraps the `echo` command with color and a script identifier prefix.
|
|||
|
||||
```bash
|
||||
builder_echo [mode] message
|
||||
or
|
||||
builder_echo start blockname message
|
||||
or
|
||||
builder_echo end blockname status message
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
|
@ -647,6 +651,12 @@ mode will be `white`.
|
|||
* `warning`: A warning message, represented with yellow text
|
||||
* `error`: An error message, represented with red text (consider [`builder_die`])
|
||||
* `debug`: A debug string, represented with teal text (consider [`builder_echo_debug`])
|
||||
* `start`: The beginning of a foldable block when running on TeamCity. The
|
||||
blockname will show up as the title of the collapsable block,
|
||||
the message as heading inside of the block. If not running on TeamCity
|
||||
the message is output as heading.
|
||||
* `end`: The end of the foldable block `blockname` when running on TeamCity.
|
||||
Ignored if not running on TeamCity identical to `builder_echo status message`.
|
||||
|
||||
Or color identifiers:
|
||||
* `white`: Normal white text, the default if **mode** is omitted
|
||||
|
|
@ -666,6 +676,9 @@ mode will be `white`.
|
|||
* `setmark`: A marker for a section heading, represented with purple text
|
||||
|
||||
* **message**: a string (surround with quote marks)
|
||||
* **blockname**: a string with the name of the collapsable block (surround with quote marks)
|
||||
* **status**: one of the `mode` values representing the result of an action
|
||||
(`success`, `warning`, or `error`)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
@ -867,6 +880,54 @@ fi
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_is_running_on_docker` function
|
||||
|
||||
Returns `true` (aka 0) if the script runs in a Docker container (i.e. if
|
||||
the `DOCKER_RUNNING` environment variable is set).
|
||||
|
||||
**Note** that this environment variable is not set automatically, so you'll have
|
||||
to set it before starting a build, or set it in the docker image.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
if builder_is_running_on_docker; then
|
||||
...
|
||||
fi
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_is_running_on_gha` function
|
||||
|
||||
Returns `true` (aka 0) if the script runs as a GitHub action (i.e. if the
|
||||
`GITHUB_ACTIONS` environment variable is set).
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
if builder_is_running_on_gha; then
|
||||
...
|
||||
fi
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_is_running_on_teamcity` function
|
||||
|
||||
Returns `true` (aka 0) if the script runs on TeamCity (i.e. if the
|
||||
`TEAMCITY_GIT_PATH` environment variable is set).
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
if builder_is_running_on_teamcity; then
|
||||
...
|
||||
fi
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
## `builder_parse` function
|
||||
|
||||
Initializes a build.sh script, parses command line. Will abort the script if
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ You'll have to create the docker image.
|
|||
|
||||
```bash
|
||||
cd $KEYMAN_ROOT
|
||||
TIER=$(cat TIER.md)
|
||||
export TIER
|
||||
KEYMAN_TIER=$(cat TIER.md)
|
||||
export KEYMAN_TIER
|
||||
cd linux
|
||||
./scripts/deb-packaging.sh source
|
||||
```
|
||||
|
|
@ -149,13 +149,13 @@ for the different distros and architectures.
|
|||
To upload the packages to launchpad, run the following script from the `linux/` directory:
|
||||
|
||||
```bash
|
||||
./scripts/launchpad.sh [UPLOAD="yes"] [TIER="<tier>"] [PROJECT="<project>"] [DIST="<dist>"] [PACKAGEVERSION="<version>"]
|
||||
./scripts/launchpad.sh [UPLOAD="yes"] [KEYMAN_TIER="<tier>"] [PROJECT="<project>"] [DIST="<dist>"] [PACKAGEVERSION="<version>"]
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- `UPLOAD="yes"` - do the dput for real
|
||||
- `TIER="<tier>"` - alpha, beta, or stable, default from `../TIER.md`
|
||||
- `KEYMAN_TIER="<tier>"` - alpha, beta, or stable, default from `../TIER.md`
|
||||
- `PROJECT="<project>"` - only upload this package
|
||||
- `DIST="<dist>"` - only upload for this distribution
|
||||
- `PACKAGEVERSION="<version>"` - normally use the default so don't specify
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ function build_engine() {
|
|||
|
||||
echo
|
||||
echo "Build products will be set with the following version metadata:"
|
||||
echo " * VERSION=$VERSION"
|
||||
echo " * VERSION_WITH_TAG=$VERSION_WITH_TAG"
|
||||
echo " * VERSION_ENVIRONMENT=$VERSION_ENVIRONMENT"
|
||||
echo " * KEYMAN_VERSION=$KEYMAN_VERSION"
|
||||
echo " * KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG"
|
||||
echo " * KEYMAN_VERSION_ENVIRONMENT=$KEYMAN_VERSION_ENVIRONMENT"
|
||||
echo " * UPLOAD_SENTRY=$UPLOAD_SENTRY"
|
||||
echo
|
||||
echo "Building KMEI..."
|
||||
|
|
@ -130,9 +130,9 @@ function build_engine() {
|
|||
run_xcodebuild $XCODEFLAGS_EXT \
|
||||
$CODE_SIGN \
|
||||
-scheme KME-universal \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG \
|
||||
VERSION_ENVIRONMENT=$VERSION_ENVIRONMENT \
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG \
|
||||
KEYMAN_VERSION_ENVIRONMENT=$KEYMAN_VERSION_ENVIRONMENT \
|
||||
UPLOAD_SENTRY=$UPLOAD_SENTRY
|
||||
|
||||
assertDirExists "$KEYMAN_XCFRAMEWORK"
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ function build_app() {
|
|||
-archivePath "$ARCHIVE_PATH" \
|
||||
archive \
|
||||
-allowProvisioningUpdates \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG \
|
||||
VERSION_ENVIRONMENT=$VERSION_ENVIRONMENT \
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG \
|
||||
KEYMAN_VERSION_ENVIRONMENT=$KEYMAN_VERSION_ENVIRONMENT \
|
||||
UPLOAD_SENTRY=$UPLOAD_SENTRY
|
||||
|
||||
assertDirExists "$ARCHIVE_PATH"
|
||||
|
|
@ -112,13 +112,13 @@ function build_app() {
|
|||
$CODE_SIGN \
|
||||
-scheme Keyman \
|
||||
-sdk iphonesimulator \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG \
|
||||
VERSION_ENVIRONMENT=$VERSION_ENVIRONMENT \
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG \
|
||||
KEYMAN_VERSION_ENVIRONMENT=$KEYMAN_VERSION_ENVIRONMENT \
|
||||
UPLOAD_SENTRY=$UPLOAD_SENTRY
|
||||
fi
|
||||
}
|
||||
|
||||
builder_run_action clean do_clean
|
||||
builder_run_action configure do_configure
|
||||
builder_run_action build build_app
|
||||
builder_run_action build build_app
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ build_archive ( ) {
|
|||
-quiet \
|
||||
BUILD_DIR="${BUILD_DIR}" \
|
||||
BUILD_ROOT="${BUILD_ROOT}" \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG \
|
||||
VERSION_ENVIRONMENT=$VERSION_ENVIRONMENT \
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG \
|
||||
KEYMAN_VERSION_ENVIRONMENT=$KEYMAN_VERSION_ENVIRONMENT \
|
||||
UPLOAD_SENTRY=$UPLOAD_SENTRY
|
||||
}
|
||||
|
||||
|
|
@ -72,4 +72,4 @@ run_xcodebuild -create-xcframework \
|
|||
-allow-internal-distribution \
|
||||
-framework ${IPHONE_FRAMEWORK} \
|
||||
-framework ${SIMULATOR_FRAMEWORK} \
|
||||
-output ${XCFRAMEWORK}
|
||||
-output ${XCFRAMEWORK}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ fi
|
|||
#. ../resources/shellHelperFunctions.sh
|
||||
|
||||
BUILD_NUMBER=`cat ../VERSION.md`
|
||||
TIER=`cat ../TIER.md`
|
||||
KEYMAN_TIER=`cat ../TIER.md`
|
||||
|
||||
KEYMAN_CHANGELOG="changelog-${BUILD_NUMBER}-${TIER}.txt"
|
||||
KEYMAN_CHANGELOG="changelog-${BUILD_NUMBER}-${KEYMAN_TIER}.txt"
|
||||
CHANGELOG_PATH="upload/$BUILD_NUMBER/$KEYMAN_CHANGELOG"
|
||||
|
||||
WORK_DIR=`pwd`
|
||||
|
|
@ -46,7 +46,7 @@ mkdir -p "${UPLOAD_DIR}"
|
|||
# First, we prep the files for publication: write changelog
|
||||
|
||||
echo "Writing changelog to $CHANGELOG_PATH"
|
||||
get_version_notes "ios" "${BUILD_NUMBER}" "$TIER" > $CHANGELOG_PATH
|
||||
get_version_notes "ios" "${BUILD_NUMBER}" "$KEYMAN_TIER" > $CHANGELOG_PATH
|
||||
echo "* Minor fixes and performance improvements" >> $CHANGELOG_PATH
|
||||
assertFileExists "${CHANGELOG_PATH}"
|
||||
|
||||
|
|
@ -128,9 +128,9 @@ fi
|
|||
|
||||
cd "${UPLOAD_DIR}"
|
||||
|
||||
write_download_info "Keyman Engine for iOS" "${KMEI_DST_NAME}" "${BUILD_NUMBER}" "${TIER}" "ios"
|
||||
write_download_info "Keyman for iPhone and iPad" "${KEYMANAPP_IPA_DST}" "${BUILD_NUMBER}" "${TIER}" "ios"
|
||||
write_download_info "Keyman Engine for iOS" "${KMEI_DST_NAME}" "${BUILD_NUMBER}" "${KEYMAN_TIER}" "ios"
|
||||
write_download_info "Keyman for iPhone and iPad" "${KEYMANAPP_IPA_DST}" "${BUILD_NUMBER}" "${KEYMAN_TIER}" "ios"
|
||||
|
||||
if [ ${RELEASE_OEM_FIRSTVOICES} = true ]; then
|
||||
write_download_info "FirstVoices Keyboards" "${FIRSTVOICESAPP_IPA_DST}" "${BUILD_NUMBER}" "${TIER}" "ios"
|
||||
write_download_info "FirstVoices Keyboards" "${FIRSTVOICESAPP_IPA_DST}" "${BUILD_NUMBER}" "${KEYMAN_TIER}" "ios"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ conf = configuration_data()
|
|||
ibus = dependency('ibus-1.0', version: '>= 1.2.0')
|
||||
gtk = dependency('gtk+-3.0', version: '>= 2.4')
|
||||
json_glib = dependency('json-glib-1.0', version: '>= 1.0')
|
||||
icu = dependency('icu-i18n')
|
||||
icu = [dependency('icu-i18n'), dependency('icu-uc')]
|
||||
|
||||
systemd = dependency('libsystemd', 'libelogind', required: false)
|
||||
if systemd.found()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __KEYMAN_VERSION_H__
|
||||
#define __KEYMAN_VERSION_H__
|
||||
|
||||
#define KEYMAN_VERSION "@VERSION@"
|
||||
#define KEYMAN_VERSION "@KEYMAN_VERSION@"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<name>org.freedesktop.IBus.Keyman</name>
|
||||
<description>Keyman Component</description>
|
||||
<exec>@LIBEXECDIR@/ibus-engine-keyman --ibus</exec>
|
||||
<version>@VERSION@</version>
|
||||
<version>@KEYMAN_VERSION@</version>
|
||||
<author>Keyman Team <support@keyman.com></author>
|
||||
<license>GPL</license>
|
||||
<homepage>https://keyman.com</homepage>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ deps = [gtk, ibus, icu, json_glib, keymancore_lib, systemd]
|
|||
|
||||
prefix = get_option('prefix')
|
||||
cfg = configuration_data()
|
||||
cfg.set('VERSION', meson.project_version())
|
||||
cfg.set('KEYMAN_VERSION', meson.project_version())
|
||||
cfg.set('LIBEXECDIR', get_option('prefix') / get_option('libexecdir'))
|
||||
|
||||
configure_file(
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ dist: clean version
|
|||
fi
|
||||
|
||||
deb: dist
|
||||
@VERSION=$(shell echo `basename dist/*.gz .tar.gz|cut -d "-" -f2` > /tmp/keyman_version)
|
||||
@echo VERSION is $(shell cat /tmp/keyman_version)
|
||||
@KEYMAN_VERSION=$(shell echo `basename dist/*.gz .tar.gz|cut -d "-" -f2` > /tmp/keyman_version)
|
||||
@echo KEYMAN_VERSION is $(shell cat /tmp/keyman_version)
|
||||
@mkdir -p make_deb
|
||||
cd make_deb && tar xf ../dist/keyman_config-$(shell cat /tmp/keyman_version).tar.gz && \
|
||||
mv keyman_config-$(shell cat /tmp/keyman_version) keyman-config-$(shell cat /tmp/keyman_version) && \
|
||||
|
|
@ -41,7 +41,7 @@ version_reconf:
|
|||
cd .. && ./scripts/reconf.sh
|
||||
|
||||
version: version_reconf
|
||||
$(eval VERSION := $(shell python3 -c "from keyman_config import __releaseversion__; print(__releaseversion__)"))
|
||||
$(eval KEYMAN_VERSION := $(shell python3 -c "from keyman_config import __releaseversion__; print(__releaseversion__)"))
|
||||
|
||||
# i18n
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ POFILES := $(shell find locale -name \*.po)
|
|||
MOFILES := $(POFILES:.po=/LC_MESSAGES/keyman-config.mo)
|
||||
|
||||
update-template: version
|
||||
xgettext --package-name "keyman" --package-version "$(VERSION)" \
|
||||
xgettext --package-name "keyman" --package-version "$(KEYMAN_VERSION)" \
|
||||
--msgid-bugs-address "<support@keyman.com>" --copyright-holder "SIL Global" \
|
||||
--language=Python --directory=. --output-dir=locale --output=keyman-config.pot \
|
||||
--add-comments=i18n: --sort-by-file --width=98 \
|
||||
|
|
|
|||
|
|
@ -62,14 +62,14 @@ build_action() {
|
|||
builder_echo "Create version.py"
|
||||
pushd keyman_config
|
||||
sed \
|
||||
-e "s/_VERSION_/${VERSION}/g" \
|
||||
-e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \
|
||||
-e "s/_VERSIONGITTAG_/${VERSION_GIT_TAG}/g" \
|
||||
-e "s/_MAJORVERSION_/${VERSION_MAJOR}/g" \
|
||||
-e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \
|
||||
-e "s/_TIER_/${TIER}/g" \
|
||||
-e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \
|
||||
-e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \
|
||||
-e "s/_KEYMAN_VERSION_/${KEYMAN_VERSION}/g" \
|
||||
-e "s/_KEYMAN_VERSION_WITH_TAG_/${KEYMAN_VERSION_WITH_TAG}/g" \
|
||||
-e "s/_KEYMAN_VERSION_GIT_TAG_/${KEYMAN_VERSION_GIT_TAG}/g" \
|
||||
-e "s/_KEYMAN_VERSION_MAJOR_/${KEYMAN_VERSION_MAJOR}/g" \
|
||||
-e "s/_KEYMAN_VERSION_RELEASE_/${KEYMAN_VERSION_RELEASE}/g" \
|
||||
-e "s/_KEYMAN_TIER_/${KEYMAN_TIER}/g" \
|
||||
-e "s/_KEYMAN_VERSION_ENVIRONMENT_/${KEYMAN_VERSION_ENVIRONMENT}/g" \
|
||||
-e "s/_UPLOAD_SENTRY_/${UPLOAD_SENTRY}/g" \
|
||||
version.py.in > version.py
|
||||
popd
|
||||
pushd buildtools
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
# 1) we don't load dependencies by storing it in __init__.py
|
||||
# 2) we can import it in setup.py for the same reason
|
||||
# 3) we can import it into your module module
|
||||
__version__ = "_VERSION_"
|
||||
__versionwithtag__ = "_VERSIONWITHTAG_"
|
||||
__majorversion__ = "_MAJORVERSION_"
|
||||
__releaseversion__ = "_RELEASEVERSION_"
|
||||
__tier__ = "_TIER_"
|
||||
__version__ = "_KEYMAN_VERSION_"
|
||||
__versionwithtag__ = "_KEYMAN_VERSION_WITH_TAG_"
|
||||
__majorversion__ = "_KEYMAN_VERSION_MAJOR_"
|
||||
__releaseversion__ = "_KEYMAN_VERSION_RELEASE_"
|
||||
__tier__ = "_KEYMAN_TIER_"
|
||||
__pkgversion__ = "(local)"
|
||||
__environment__ = "_ENVIRONMENT_"
|
||||
__uploadsentry__ = "_UPLOADSENTRY_"
|
||||
__versiongittag__ = "_VERSIONGITTAG_"
|
||||
__environment__ = "_KEYMAN_VERSION_ENVIRONMENT_"
|
||||
__uploadsentry__ = "_UPLOAD_SENTRY_"
|
||||
__versiongittag__ = "_KEYMAN_VERSION_GIT_TAG_"
|
||||
|
|
|
|||
|
|
@ -12,9 +12,22 @@ if [[ "$1" == "--coverage" ]]; then
|
|||
coverage="-m coverage run --source=. --data-file=build/.coverage"
|
||||
fi
|
||||
|
||||
if [[ -n "${TEAMCITY_VERSION}" ]]; then
|
||||
if [[ -n "${TEAMCITY_GIT_PATH}" ]]; then
|
||||
if ! pip3 list --format=columns | grep -q teamcity-messages; then
|
||||
pip3 install teamcity-messages
|
||||
if [[ -n "${TEAMCITY_PLATFORM}" ]] || [[ -n "${DOCKER_RUNNING}" ]]; then
|
||||
# Ubuntu 24.04+ prevents mixing pip and system packages and wants us
|
||||
# to use a virtualenv. However, that causes other problems, so we
|
||||
# override this check only if we're running in a TC agent or docker
|
||||
# so that we don't accidentally break the local system.
|
||||
# Note: it is intentional that we use TEAMCITY_GIT_PATH as well
|
||||
# as TEAMCITY_PLATFORM here so that it is possible to simulate
|
||||
# running in a TC agent and still not break your local system
|
||||
# (run in a docker container or explicitly set TEAMCITY_PLATFORM
|
||||
# to cause the script to install the package).
|
||||
PIP_ARGS="--break-system-packages"
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
pip3 install --user ${PIP_ARGS:-} teamcity-messages
|
||||
fi
|
||||
test_module=teamcity.unittestpy
|
||||
else
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
19.0.32-alpha-local
|
||||
|
|
@ -29,7 +29,7 @@ mkdir -p dist
|
|||
cp -a debian ../
|
||||
cd ..
|
||||
echo "3.0 (native)" > debian/source/format
|
||||
dch keyman --newversion "${VERSION}" --force-bad-version --nomultimaint
|
||||
dch keyman --newversion "${KEYMAN_VERSION}" --force-bad-version --nomultimaint
|
||||
|
||||
# Create the tarball
|
||||
# Note: the files end up in subdirectories under `keyman`, so we can
|
||||
|
|
@ -87,17 +87,17 @@ dpkg-source \
|
|||
--tar-ignore=keyman/windows \
|
||||
\
|
||||
-Zgzip -b .
|
||||
mv ../keyman_"${VERSION}".tar.gz linux/dist/keyman-"${VERSION}".tar.gz
|
||||
mv ../keyman_"${KEYMAN_VERSION}".tar.gz linux/dist/keyman-"${KEYMAN_VERSION}".tar.gz
|
||||
echo "3.0 (quilt)" > debian/source/format
|
||||
cd "${BASEDIR}"
|
||||
|
||||
# create orig.tar.gz
|
||||
if [[ ! -z "${create_origdist+x}" ]]; then
|
||||
cd dist
|
||||
pkgvers="keyman-$VERSION"
|
||||
tar xfz keyman-"${VERSION}".tar.gz
|
||||
pkgvers="keyman-$KEYMAN_VERSION"
|
||||
tar xfz keyman-"${KEYMAN_VERSION}".tar.gz
|
||||
mv -v keyman "${pkgvers}" 2>/dev/null || mv -v "$(find . -mindepth 1 -maxdepth 1 -type d)" "${pkgvers}"
|
||||
tar cfz "keyman_${VERSION}.orig.tar.gz" "${pkgvers}"
|
||||
rm "keyman-${VERSION}.tar.gz"
|
||||
tar cfz "keyman_${KEYMAN_VERSION}.orig.tar.gz" "${pkgvers}"
|
||||
rm "keyman-${KEYMAN_VERSION}.tar.gz"
|
||||
rm -rf "${pkgvers}"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
|
||||
checkPrerequisites
|
||||
|
||||
if [ "${TIER}" == "stable" ]; then
|
||||
if [ "${KEYMAN_TIER}" == "stable" ]; then
|
||||
ppa="ppa:keymanapp/keyman"
|
||||
elif [ "${TIER}" == "beta" ]; then
|
||||
elif [ "${KEYMAN_TIER}" == "beta" ]; then
|
||||
ppa="ppa:keymanapp/keyman-beta"
|
||||
else
|
||||
ppa="ppa:keymanapp/keyman-alpha"
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ function checkPrerequisites() {
|
|||
fi
|
||||
|
||||
# Check the tier
|
||||
if [[ -z "${TIER:=}" ]]; then
|
||||
echo "TIER.md or \${TIER} must be set to (alpha, beta, stable) to use this script"
|
||||
if [[ -z "${KEYMAN_TIER:=}" ]]; then
|
||||
echo "TIER.md or \${KEYMAN_TIER} must be set to (alpha, beta, stable) to use this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ function downloadSource() {
|
|||
fi
|
||||
|
||||
# Update tier in Debian watch files (replacing any previously set tier) and remove comment
|
||||
sed -e "s/\$tier\|alpha\|beta\|stable/${TIER}/g" -e "s/^# .*$//" "$BASEDIR"/scripts/watch.in > debian/watch
|
||||
sed -e "s/\$tier\|alpha\|beta\|stable/${KEYMAN_TIER}/g" -e "s/^# .*$//" "$BASEDIR"/scripts/watch.in > debian/watch
|
||||
|
||||
version=$(uscan --report --dehs|xmllint --xpath "//dehs/upstream-version/text()" -)
|
||||
dirversion=$(uscan --report --dehs|xmllint --xpath "//dehs/upstream-url/text()" - | cut -d/ -f6)
|
||||
|
|
@ -45,7 +45,7 @@ function downloadSource() {
|
|||
mv "${proj}"*.asc "${BASEDIR}/${packageDir}"
|
||||
rm "${proj}"*.debian.tar.xz
|
||||
cd "${BASEDIR}/${packageDir}" || exit
|
||||
wget -N "https://downloads.keyman.com/linux/${TIER}/${dirversion}/SHA256SUMS"
|
||||
wget -N "https://downloads.keyman.com/linux/${KEYMAN_TIER}/${dirversion}/SHA256SUMS"
|
||||
sha256sum -c --ignore-missing SHA256SUMS |grep "${proj}"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
BASEDIR="$KEYMAN_ROOT/linux"
|
||||
echo "basedir is $BASEDIR"
|
||||
|
||||
echo "Found tier ${TIER}, version ${VERSION}"
|
||||
echo "Found tier ${KEYMAN_TIER}, version ${KEYMAN_VERSION}"
|
||||
|
||||
# We need to configure+build core before we can configure ibus-keyman
|
||||
cd ../core
|
||||
|
|
@ -32,14 +32,14 @@ quilt new version_py.diff
|
|||
quilt add "version.py"
|
||||
|
||||
sed \
|
||||
-e "s/_VERSION_/${VERSION}/g" \
|
||||
-e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \
|
||||
-e "s/_VERSIONGITTAG_/${VERSION_GIT_TAG}/g" \
|
||||
-e "s/_MAJORVERSION_/${VERSION_MAJOR}/g" \
|
||||
-e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \
|
||||
-e "s/_TIER_/${TIER}/g" \
|
||||
-e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \
|
||||
-e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \
|
||||
-e "s/_KEYMAN_VERSION_/${KEYMAN_VERSION}/g" \
|
||||
-e "s/_KEYMAN_VERSION_WITH_TAG_/${KEYMAN_VERSION_WITH_TAG}/g" \
|
||||
-e "s/_KEYMAN_VERSION_GIT_TAG_/${KEYMAN_VERSION_GIT_TAG}/g" \
|
||||
-e "s/_KEYMAN_VERSION_MAJOR_/${KEYMAN_VERSION_MAJOR}/g" \
|
||||
-e "s/_KEYMAN_VERSION_RELEASE_/${KEYMAN_VERSION_RELEASE}/g" \
|
||||
-e "s/_KEYMAN_TIER_/${KEYMAN_TIER}/g" \
|
||||
-e "s/_KEYMAN_VERSION_ENVIRONMENT_/${KEYMAN_VERSION_ENVIRONMENT}/g" \
|
||||
-e "s/_UPLOAD_SENTRY_/${UPLOAD_SENTRY}/g" \
|
||||
version.py.in > version.py
|
||||
quilt refresh
|
||||
quilt pop -a
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ mockDebPkgTools() {
|
|||
}
|
||||
|
||||
createBase() {
|
||||
TIER=$1
|
||||
KEYMAN_TIER=$1
|
||||
remoteDir=$(mktemp -d)
|
||||
cd "${remoteDir}"
|
||||
git init --bare --initial-branch=master .
|
||||
|
|
@ -68,7 +68,7 @@ createBase() {
|
|||
git tag -m "16.0.145" release-16.0.145
|
||||
git push origin release-16.0.145
|
||||
|
||||
echo "${TIER}" > TIER.md
|
||||
echo "${KEYMAN_TIER}" > TIER.md
|
||||
git add TIER.md
|
||||
|
||||
echo "17.0.255" > VERSION.md
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ check_api_not_changed() {
|
|||
trap "rm -rf \"${tmpDir}\"" ERR
|
||||
dpkg -x "${BIN_PKG}" "${tmpDir}"
|
||||
mkdir -p debian/tmp/DEBIAN
|
||||
if dpkg-gensymbols -v"${VERSION}" -p"${PKG_NAME}" -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/"${LIB_NAME}".so* -c4; then
|
||||
if dpkg-gensymbols -v"${KEYMAN_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"
|
||||
|
|
@ -205,7 +205,7 @@ get_api_version_from_core() {
|
|||
# NOTE: it is up to the caller to check if this is a major version
|
||||
# change that requires an API version update.
|
||||
is_api_version_updated() {
|
||||
local OLD_API_VERSION NEW_API_VERSION TIER
|
||||
local OLD_API_VERSION NEW_API_VERSION KEYMAN_TIER
|
||||
OLD_API_VERSION=$(get_api_version_in_symbols_file "${GIT_BASE}")
|
||||
NEW_API_VERSION=$(get_api_version_in_symbols_file "${GIT_SHA}")
|
||||
if (( NEW_API_VERSION > OLD_API_VERSION )); then
|
||||
|
|
@ -215,11 +215,11 @@ is_api_version_updated() {
|
|||
|
||||
# API version didn't change. However, that might be ok if we're in alpha
|
||||
# and a major change happened previously.
|
||||
TIER=$(cat "${REPO_ROOT}/TIER.md")
|
||||
case ${TIER} in
|
||||
KEYMAN_TIER=$(cat "${REPO_ROOT}/TIER.md")
|
||||
case ${KEYMAN_TIER} in
|
||||
alpha)
|
||||
local STABLE_VERSION STABLE_API_VERSION STABLE_BRANCH
|
||||
STABLE_VERSION=$((${VERSION%%.*} - 1))
|
||||
STABLE_VERSION=$((${KEYMAN_VERSION%%.*} - 1))
|
||||
STABLE_BRANCH="origin/stable-${STABLE_VERSION}.0"
|
||||
STABLE_API_VERSION=$(get_api_version_in_symbols_file "${STABLE_BRANCH}")
|
||||
if (( STABLE_API_VERSION == -1 )); then
|
||||
|
|
|
|||
|
|
@ -954,7 +954,7 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# check that our PRODUCT_VERSION matches this git branch's VERSION from ../../VERSION.md\n(cd .. ; ./is_same_version.sh Keyman4MacIM || exit 1 ; cd -)\n";
|
||||
shellScript = "# check that our PRODUCT_VERSION matches this git branch's KEYMAN_VERSION from ../../VERSION.md\n(cd .. ; ./is_same_version.sh Keyman4MacIM || exit 1 ; cd -)\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D2FF67BB6C749BA6861F5E25 /* [CP] Check Pods Manifest.lock */ = {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ while [[ $# -gt 0 ]] ; do
|
|||
done
|
||||
|
||||
# Step 0 - check parameter and initial file state
|
||||
if [ "$VERSION" = "" ]; then
|
||||
if [ "$KEYMAN_VERSION" = "" ]; then
|
||||
builder_die "Required -version parameter not specified!"
|
||||
fi
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ elif [[ ! -d "$OUTPUT_DIR" ]]; then
|
|||
fi
|
||||
|
||||
if $ADD_VERSION_TO_DEST_DIR ; then
|
||||
DEST_DIR="$DEST_DIR/$VERSION"
|
||||
DEST_DIR="$DEST_DIR/$KEYMAN_VERSION"
|
||||
fi
|
||||
if [[ ! -e "$DEST_DIR" ]]; then
|
||||
mkdir -p "$DEST_DIR"
|
||||
|
|
@ -140,7 +140,7 @@ fi
|
|||
# TODO: Check that no Keyman volume is already mounted.
|
||||
|
||||
# Step 1 - Copy template to working copy to prevent unintended changes
|
||||
WORKING_COPY_OF_IMAGE="$OUTPUT_DIR/Keyman-temp-$VERSION.dmg"
|
||||
WORKING_COPY_OF_IMAGE="$OUTPUT_DIR/Keyman-temp-$KEYMAN_VERSION.dmg"
|
||||
displayInfo "Copying \"$TEMPLATE_IMAGE\" to \"$WORKING_COPY_OF_IMAGE\"..."
|
||||
if [[ -e "$WORKING_COPY_OF_IMAGE" && "$VERBOSITY" != "-quiet" ]] ; then
|
||||
builder_warn "Overwriting: $WORKING_COPY_OF_IMAGE"
|
||||
|
|
@ -212,7 +212,7 @@ if (( DETACH_SUCCESS < 999 )); then
|
|||
fi
|
||||
|
||||
# Step 5 - Convert image to a compressed readonly DMG image
|
||||
DMG_FILE_PATH="$DEST_DIR/keyman-$VERSION.dmg"
|
||||
DMG_FILE_PATH="$DEST_DIR/keyman-$KEYMAN_VERSION.dmg"
|
||||
displayInfo "Converting/compressing image to create \"$DMG_FILE_PATH\""
|
||||
if [[ -e "$DMG_FILE_PATH" ]] ; then
|
||||
if [[ "$VERBOSITY" != "-quiet" ]] ; then
|
||||
|
|
@ -230,4 +230,4 @@ displayInfo "Cleaning up..."
|
|||
rm "$WORKING_COPY_OF_IMAGE"
|
||||
|
||||
displayInfo "Make DMG completed successfully."
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ popd > /dev/null
|
|||
DEST_DIR="$KEYMAN_MACIM_BASE_PATH/output/upload"
|
||||
ADD_VERSION_TO_DEST_DIR=true
|
||||
|
||||
KM_BLD_COUNTER="$((${VERSION##*.}))"
|
||||
KM_BLD_COUNTER="$((${KEYMAN_VERSION##*.}))"
|
||||
|
||||
# Parse args
|
||||
shopt -s nocasematch
|
||||
|
|
@ -67,7 +67,7 @@ while [[ $# -gt 0 ]] ; do
|
|||
done
|
||||
|
||||
if $ADD_VERSION_TO_DEST_DIR ; then
|
||||
DEST_DIR="$DEST_DIR/$VERSION"
|
||||
DEST_DIR="$DEST_DIR/$KEYMAN_VERSION"
|
||||
fi
|
||||
if [[ ! -e $DEST_DIR ]]; then
|
||||
mkdir -p $DEST_DIR
|
||||
|
|
@ -75,7 +75,7 @@ elif [[ ! -d $DEST_DIR ]]; then
|
|||
builder_die "Destination dir exists but is not a directory: $2"
|
||||
fi
|
||||
|
||||
DMG_FILENAME="keyman-$VERSION.dmg"
|
||||
DMG_FILENAME="keyman-$KEYMAN_VERSION.dmg"
|
||||
DMG_FILEPATH="$DEST_DIR/$DMG_FILENAME"
|
||||
DOWNLOAD_INFO_FILEPATH="${DMG_FILEPATH}.download_info"
|
||||
if [[ ! -f "$DMG_FILEPATH" ]]; then
|
||||
|
|
@ -90,10 +90,10 @@ fi
|
|||
|
||||
echo { > "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"name\": \"Keyman4MacIM\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"version\": \"${VERSION}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"version\": \"${KEYMAN_VERSION}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"date\": \"$(date "+%Y-%m-%d")\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"platform\": \"mac\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"stability\": \"${TIER}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"stability\": \"${KEYMAN_TIER}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"file\": \"${DMG_FILENAME}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"md5\": \"${DMG_MD5}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo " \"type\": \"dmg\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
|
|
@ -101,4 +101,4 @@ echo " \"build\": \"${KM_BLD_COUNTER}\"," >> "$DOWNLOAD_INFO_FILEPATH"
|
|||
echo " \"size\": \"${DMG_FILE_SIZE}\"" >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
echo } >> "$DOWNLOAD_INFO_FILEPATH"
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# check that our PRODUCT_VERSION matches this git branch's VERSION from ../../VERSION.md\n(cd .. ; ./is_same_version.sh KeymanEngine4Mac || exit 1 ; cd -)\n";
|
||||
shellScript = "# check that our PRODUCT_VERSION matches this git branch's KEYMAN_VERSION from ../../VERSION.md\n(cd .. ; ./is_same_version.sh KeymanEngine4Mac || exit 1 ; cd -)\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E2588F2F1F2647A50061C9C4 /* ShellScript */ = {
|
||||
|
|
|
|||
24
mac/build.sh
24
mac/build.sh
|
|
@ -97,7 +97,7 @@ if [[ -f "$THIS_SCRIPT_PATH/localenv.sh" ]]; then
|
|||
. "$THIS_SCRIPT_PATH/localenv.sh"
|
||||
fi
|
||||
|
||||
BUILD_OPTIONS="-configuration $CONFIG $BUILD_OPTIONS PRODUCT_VERSION=$VERSION"
|
||||
BUILD_OPTIONS="-configuration $CONFIG $BUILD_OPTIONS PRODUCT_VERSION=$KEYMAN_VERSION"
|
||||
|
||||
### START OF THE BUILD ###
|
||||
|
||||
|
|
@ -151,16 +151,16 @@ updatePlist() {
|
|||
builder_die "File not found: $KM_PLIST"
|
||||
fi
|
||||
local YEAR=`date "+%Y"`
|
||||
echo "Setting version and related fields to $VERSION_WITH_TAG in $KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $VERSION" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $VERSION" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:SentryEnvironment $VERSION_ENVIRONMENT" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:Tier $TIER" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionTag $VERSION_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionWithTag $VERSION_WITH_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionGitTag $VERSION_GIT_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionRelease $VERSION_RELEASE" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleGetInfoString $APPNAME $VERSION_WITH_TAG for macOS, Copyright © 2017-$YEAR SIL International." "$KM_PLIST"
|
||||
echo "Setting version and related fields to $KEYMAN_VERSION_WITH_TAG in $KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $KEYMAN_VERSION" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $KEYMAN_VERSION" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:SentryEnvironment $KEYMAN_VERSION_ENVIRONMENT" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:Tier $KEYMAN_TIER" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionTag $KEYMAN_VERSION_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionWithTag $KEYMAN_VERSION_WITH_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionGitTag $KEYMAN_VERSION_GIT_TAG" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :Keyman:VersionRelease $KEYMAN_VERSION_RELEASE" "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleGetInfoString $APPNAME $KEYMAN_VERSION_WITH_TAG for macOS, Copyright © 2017-$YEAR SIL International." "$KM_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set NSHumanReadableCopyright Copyright © 2017-$YEAR SIL International." "$KM_PLIST"
|
||||
fi
|
||||
}
|
||||
|
|
@ -321,4 +321,4 @@ builder_run_action build:testapp do_build_testapp
|
|||
|
||||
builder_run_action install do_install
|
||||
|
||||
builder_run_action publish do_publish
|
||||
builder_run_action publish do_publish
|
||||
|
|
|
|||
|
|
@ -41,15 +41,15 @@ echo $PROJ_PROD_VERSION_LINE | sed /\ /s///g > ./PROJ_VERSION.md
|
|||
. ./PROJ_VERSION.md
|
||||
echo Product version in the project file PRODUCT_VERSION is $PRODUCT_VERSION
|
||||
|
||||
echo Keyman version VERSION is $VERSION
|
||||
echo Keyman version VERSION is $KEYMAN_VERSION
|
||||
|
||||
if [ x$VERSION = x$PRODUCT_VERSION ]
|
||||
if [ x$KEYMAN_VERSION = x$PRODUCT_VERSION ]
|
||||
then
|
||||
echo the versions are the same, all is well.
|
||||
# clean up
|
||||
rm ./PROJ_VERSION.md
|
||||
exit 0
|
||||
else
|
||||
echo the version $VERSION and $PRODUCT_VERSION are NOT the same!
|
||||
echo the version $KEYMAN_VERSION and $PRODUCT_VERSION are NOT the same!
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
|
||||
// VERSION_CODE and VERSION_NAME from version.gradle
|
||||
versionCode VERSION_CODE as Integer
|
||||
versionName VERSION_NAME
|
||||
buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\""
|
||||
buildConfigField "String", "VERSION_GIT_TAG", "\""+VERSION_GIT_TAG+"\""
|
||||
// KEYMAN_VERSION_CODE and KEYMAN_VERSION_NAME from version.gradle
|
||||
versionCode KEYMAN_VERSION_CODE as Integer
|
||||
versionName KEYMAN_VERSION_NAME
|
||||
buildConfigField "String", "KEYMAN_VERSION_ENVIRONMENT", "\""+KEYMAN_VERSION_ENVIRONMENT+"\""
|
||||
buildConfigField "String", "KEYMAN_VERSION_GIT_TAG", "\""+KEYMAN_VERSION_GIT_TAG+"\""
|
||||
}
|
||||
|
||||
String env_release_store_file = System.getenv("oem_firstvoices_release_store_file")
|
||||
|
|
@ -55,9 +55,9 @@ android {
|
|||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
// Adjust output name to "firstvoices-${VERSION_MD}.apk"
|
||||
// Adjust output name to "firstvoices-${KEYMAN_VERSION_MD}.apk"
|
||||
variant.outputs.all {
|
||||
outputFileName = "firstvoices-" + VERSION_MD + ".apk"
|
||||
outputFileName = "firstvoices-" + KEYMAN_VERSION_MD + ".apk"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ public class MainActivity extends AppCompatActivity implements OnKeyboardDownloa
|
|||
|
||||
SentryAndroid.init(context, options -> {
|
||||
options.setEnableAutoSessionTracking(false);
|
||||
options.setRelease(com.firstvoices.keyboards.BuildConfig.VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.firstvoices.keyboards.BuildConfig.VERSION_ENVIRONMENT);
|
||||
options.setRelease(com.firstvoices.keyboards.BuildConfig.KEYMAN_VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.firstvoices.keyboards.BuildConfig.KEYMAN_VERSION_ENVIRONMENT);
|
||||
});
|
||||
|
||||
resultReceiver = new FVDownloadResultReceiver(new Handler(), context);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
Log.d(TAG, "Initializing Sentry");
|
||||
SentryAndroid.init(getApplicationContext(), options -> {
|
||||
options.setEnableAutoSessionTracking(false);
|
||||
options.setRelease(com.firstvoices.keyboards.BuildConfig.VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.firstvoices.keyboards.BuildConfig.VERSION_ENVIRONMENT);
|
||||
options.setRelease(com.firstvoices.keyboards.BuildConfig.KEYMAN_VERSION_GIT_TAG);
|
||||
options.setEnvironment(com.firstvoices.keyboards.BuildConfig.KEYMAN_VERSION_ENVIRONMENT);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ builder_describe "Builds FirstVoices for Android app." \
|
|||
"configure" \
|
||||
"build" \
|
||||
"test Runs lint and tests." \
|
||||
"publish Publishes symbols to Sentry and the APK to the Play Store."
|
||||
"publish Publishes symbols to Sentry and the APK to the Play Store."
|
||||
|
||||
# parse before describe_outputs to check debug flags
|
||||
builder_parse "$@"
|
||||
|
|
@ -38,7 +38,7 @@ if builder_is_debug_build; then
|
|||
TEST_FLAGS="-x assembleDebug lintDebug testDebug"
|
||||
fi
|
||||
|
||||
ARTIFACT="firstvoices-$VERSION.apk"
|
||||
ARTIFACT="firstvoices-$KEYMAN_VERSION.apk"
|
||||
|
||||
builder_describe_outputs \
|
||||
configure /oem/firstvoices/android/app/libs/keyman-engine.aar \
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ function do_build() {
|
|||
-archivePath "$ARCHIVE_PATH" \
|
||||
archive \
|
||||
-allowProvisioningUpdates \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG
|
||||
|
||||
assertDirExists "$ARCHIVE_PATH"
|
||||
|
||||
|
|
@ -120,14 +120,14 @@ function do_build() {
|
|||
-exportOptionsPlist exportAppStore.plist \
|
||||
-exportPath "$BUILD_PATH/${CONFIG}-iphoneos" \
|
||||
-allowProvisioningUpdates \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG
|
||||
else
|
||||
run_xcodebuild $CODE_SIGN \
|
||||
$XCODEFLAGS_EXT \
|
||||
-scheme "$TARGET" \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG
|
||||
fi
|
||||
|
||||
if builder_has_option --sim-artifact; then
|
||||
|
|
@ -136,8 +136,8 @@ function do_build() {
|
|||
$XCODEFLAGS_EXT \
|
||||
-scheme "$TARGET" \
|
||||
-sdk iphonesimulator \
|
||||
VERSION=$VERSION \
|
||||
VERSION_WITH_TAG=$VERSION_WITH_TAG
|
||||
KEYMAN_VERSION=$KEYMAN_VERSION \
|
||||
KEYMAN_VERSION_WITH_TAG=$KEYMAN_VERSION_WITH_TAG
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Shortname,ID,Name,Region,9.0 Web Keyboard,Version,Language ID,Language Name
|
||||
fv,fv_inuvialuktun,Inuvialuktun,Arctic,fv_inuvialuktun_kmw-9.0.js,9.1.1,ikt-Latn,Inuinnaqtun (Latin)
|
||||
i,inuktitut_pirurvik,Kiputtijjut | ᑭᐳᑦᑎᔾᔪᑦ,Arctic,inuktitut_pirurvik-1.1.js,1.4,ike-Cans,Eastern Canadian Inuktitut (Unified Canadian Aboriginal Syllabics)
|
||||
i,inuktitut_pirurvik,Kiputtijjut | ᑭᐳᑦᑎᔾᔪᑦ,Arctic,inuktitut_pirurvik-1.1.js,1.4.1,ike-Cans,Eastern Canadian Inuktitut (Unified Canadian Aboriginal Syllabics)
|
||||
i,inuktitut_latin,Qaliujaaqpait | ᖃᓕᐅᔮᖅᐸᐃᑦ,Arctic,inuktitut_latin-1.1.js,1.4,ike-Latn,Eastern Canadian Inuktitut (Latin)
|
||||
i,inuktitut_naqittaut,Qaniujaaqpait | ᖃᓂᐅᔮᖅᐸᐃᑦ,Arctic,inuktitut_naqittaut-1.3.js,1.6,ike-Cans,Eastern Canadian Inuktitut (Unified Canadian Aboriginal Syllabics)
|
||||
fv,fv_uummarmiutun,Uummarmiutun,Arctic,fv_uummarmiutun_kmw-9.0.js,9.1.1,ikt-Latn,Inuinnaqtun (Latin)
|
||||
|
|
|
|||
|
|
|
@ -16,7 +16,7 @@ builder_describe "Installation files for FirstVoices Keyboards" \
|
|||
# after all other builds complete
|
||||
|
||||
builder_describe_outputs \
|
||||
publish /windows/release/${VERSION}/firstvoices-${VERSION}.exe
|
||||
publish /windows/release/${KEYMAN_VERSION}/firstvoices-${KEYMAN_VERSION}.exe
|
||||
|
||||
builder_parse "$@"
|
||||
|
||||
|
|
@ -25,8 +25,8 @@ builder_parse "$@"
|
|||
. "$KEYMAN_ROOT/resources/build/win/zip.inc.sh"
|
||||
|
||||
# In dev environments, we'll hack the tier to alpha; CI sets this for us in real builds.
|
||||
if [[ -z ${TIER+x} ]]; then
|
||||
TIER=alpha
|
||||
if [[ -z ${KEYMAN_TIER+x} ]]; then
|
||||
KEYMAN_TIER=alpha
|
||||
fi
|
||||
|
||||
# TODO: why are we not bundling CEF?
|
||||
|
|
@ -61,7 +61,7 @@ function do_publish() {
|
|||
|
||||
"$WIXHEAT" dir ../xml -o desktopui.wxs -ag -cg DesktopUI -dr INSTALLDIR -suid -var var.DESKTOPUISOURCE -wx -nologo
|
||||
"$WIXCANDLE" -dOEMNAME="FirstVoices" -dPRODUCTNAME="FirstVoices Keyboards" -dROOT="$KEYMAN_ROOT/windows" \
|
||||
-dVERSION=$VERSION_WIN -dRELEASE=$VERSION_RELEASE \
|
||||
-dKEYMAN_VERSION=$KEYMAN_VERSION_WIN -dRELEASE=$KEYMAN_VERSION_RELEASE \
|
||||
-dPRODUCTID=$GUID1 -dDESKTOPUISOURCE=../xml \
|
||||
firstvoices.wxs desktopui.wxs
|
||||
|
||||
|
|
@ -101,9 +101,9 @@ function do_publish() {
|
|||
function copy-installer() {
|
||||
builder_heading copy-installer
|
||||
|
||||
mkdir -p "$KEYMAN_ROOT/windows/release/${VERSION}"
|
||||
cp firstvoices.msi "$KEYMAN_ROOT/windows/release/${VERSION}/firstvoices.msi"
|
||||
cp firstvoices.exe "$KEYMAN_ROOT/windows/release/${VERSION}/firstvoices-${VERSION}.exe"
|
||||
mkdir -p "$KEYMAN_ROOT/windows/release/${KEYMAN_VERSION}"
|
||||
cp firstvoices.msi "$KEYMAN_ROOT/windows/release/${KEYMAN_VERSION}/firstvoices.msi"
|
||||
cp firstvoices.exe "$KEYMAN_ROOT/windows/release/${KEYMAN_VERSION}/firstvoices-${KEYMAN_VERSION}.exe"
|
||||
|
||||
verify-installer-signatures
|
||||
}
|
||||
|
|
@ -111,14 +111,14 @@ function copy-installer() {
|
|||
function verify-installer-signatures() {
|
||||
builder_heading verify-installer-signatures
|
||||
|
||||
verify-all-executable-signatures-in-folder "$KEYMAN_ROOT/windows/release/${VERSION}"
|
||||
verify-all-executable-signatures-in-folder "$KEYMAN_ROOT/windows/release/${KEYMAN_VERSION}"
|
||||
}
|
||||
|
||||
function create-setup-inf() {
|
||||
builder_heading create-setup-inf
|
||||
|
||||
echo "[Setup]" > setup.inf
|
||||
echo "Version=$VERSION_WIN" >> setup.inf
|
||||
echo "Version=$KEYMAN_VERSION_WIN" >> setup.inf
|
||||
echo "MSIFileName=firstvoices.msi" >> setup.inf
|
||||
echo "MSIOptions=" >> setup.inf
|
||||
echo "AppName=FirstVoices Keyboards" >> setup.inf
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product UpgradeCode="f212edf7-0bef-43bb-8fc2-2625ae7bbfca" Manufacturer="SIL International"
|
||||
Id="*" Name="$(var.PRODUCTNAME) $(var.RELEASE)" Version="$(var.VERSION)" Language="1033">
|
||||
Id="*" Name="$(var.PRODUCTNAME) $(var.RELEASE)" Version="$(var.KEYMAN_VERSION)" Language="1033">
|
||||
<Package Keywords="Keyman,$(var.PRODUCTNAME),Keyboard,Engine"
|
||||
Description="$(var.PRODUCTNAME) $(var.RELEASE)" Comments="Contact: Your local administrator" Compressed="yes"
|
||||
Manufacturer="SIL International" InstallerVersion="400" Platform="x86" Languages="1033" SummaryCodepage="1252" />
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
<!-- PREVENT or ALLOW Upgrade from 11.0 or later versions -->
|
||||
<Upgrade Id="f212edf7-0bef-43bb-8fc2-2625ae7bbfca">
|
||||
<UpgradeVersion OnlyDetect="no" Minimum="11.0.0.0" IncludeMinimum="yes"
|
||||
Maximum="$(var.VERSION)" IncludeMaximum="no" MigrateFeatures="yes" Property="VERSION11FOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VERSION)" IncludeMinimum="yes"
|
||||
Maximum="$(var.VERSION)" IncludeMaximum="yes" Property="CURRENTVERSIONFOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VERSION)" IncludeMinimum="no" Property="NEWERFOUND" />
|
||||
Maximum="$(var.KEYMAN_VERSION)" IncludeMaximum="no" MigrateFeatures="yes" Property="VERSION11FOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.KEYMAN_VERSION)" IncludeMinimum="yes"
|
||||
Maximum="$(var.KEYMAN_VERSION)" IncludeMaximum="yes" Property="CURRENTVERSIONFOUND" />
|
||||
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.KEYMAN_VERSION)" IncludeMinimum="no" Property="NEWERFOUND" />
|
||||
</Upgrade>
|
||||
|
||||
<Property Id='OLDINSTALLDIR'>
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
<Component Id="Reg_RootPath" Guid="*">
|
||||
<RegistryValue KeyPath="yes" Root="HKLM" Key="SOFTWARE\$(var.OEMNAME)\$(var.PRODUCTNAME)" Name="root path" Type="string" Value="[INSTALLDIR]" />
|
||||
<RegistryValue Root="HKLM" Key="SOFTWARE\$(var.OEMNAME)\$(var.PRODUCTNAME)" Name="version" Type="string" Value="$(var.VERSION)" />
|
||||
<RegistryValue Root="HKLM" Key="SOFTWARE\$(var.OEMNAME)\$(var.PRODUCTNAME)" Name="version" Type="string" Value="$(var.KEYMAN_VERSION)" />
|
||||
<RegistryValue Root="HKLM" Key="SOFTWARE\$(var.OEMNAME)\$(var.PRODUCTNAME)" Name="release" Type="string" Value="$(var.RELEASE)" />
|
||||
<RegistryKey ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes" Root="HKLM" Key="Software\$(var.OEMNAME)\$(var.PRODUCTNAME)" />
|
||||
</Component>
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ including this file...
|
|||
|
||||
## Various tools
|
||||
|
||||
### build-utils.sh
|
||||
### build-utils.sh, builder.inc.sh
|
||||
|
||||
See [build-utils.md](build-utils.md)
|
||||
See [builder.md](../../docs/builder.md)
|
||||
|
||||
### jq-win64
|
||||
### jq/jq-win64
|
||||
|
||||
jq-win64.exe is used by various builds for json query.
|
||||
jq resp. jq-win64.exe is used by various builds for json query.
|
||||
|
||||
Official source: <https://stedolan.github.io/jq/>.
|
||||
[License](jq-license.txt)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ builder_is_ci_build() {
|
|||
# Returns 0 if current build is running as a release build in CI
|
||||
#
|
||||
builder_is_ci_release_build() {
|
||||
if [[ "$VERSION_ENVIRONMENT" =~ ^alpha|beta|stable$ ]]; then
|
||||
if [[ "$KEYMAN_VERSION_ENVIRONMENT" =~ ^alpha|beta|stable$ ]]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
|
|
@ -33,7 +33,7 @@ builder_is_ci_release_build() {
|
|||
# mainline branch test
|
||||
#
|
||||
builder_is_ci_test_build() {
|
||||
if [[ "$VERSION_ENVIRONMENT" == test ]]; then
|
||||
if [[ "$KEYMAN_VERSION_ENVIRONMENT" == test ]]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
|
|
@ -115,7 +115,7 @@ function builder_pull_has_label() {
|
|||
function builder_publish_npm() {
|
||||
if builder_has_option --npm-publish; then
|
||||
# Require --dry-run if local or test to avoid accidentally clobbering npm packages
|
||||
if [[ $VERSION_ENVIRONMENT =~ local|test ]] && ! builder_has_option --dry-run; then
|
||||
if [[ $KEYMAN_VERSION_ENVIRONMENT =~ local|test ]] && ! builder_has_option --dry-run; then
|
||||
builder_die "publish --npm-publish must use --dry-run flag for local or test builds"
|
||||
fi
|
||||
_builder_publish_npm_package publish
|
||||
|
|
@ -126,9 +126,9 @@ function builder_publish_npm() {
|
|||
|
||||
function _builder_publish_npm_package() {
|
||||
local action=$1
|
||||
local dist_tag=$TIER dry_run=
|
||||
local dist_tag=$KEYMAN_TIER dry_run=
|
||||
|
||||
if [[ $TIER == stable ]]; then
|
||||
if [[ $KEYMAN_TIER == stable ]]; then
|
||||
dist_tag=latest
|
||||
fi
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ function _builder_write_npm_version() {
|
|||
# git tagging. :)
|
||||
if ! "$JQ" -e '.version' package.json > /dev/null; then
|
||||
pushd "$KEYMAN_ROOT" > /dev/null
|
||||
npm version --allow-same-version --no-git-tag-version --no-commit-hooks --workspaces "$VERSION_WITH_TAG"
|
||||
npm version --allow-same-version --no-git-tag-version --no-commit-hooks --workspaces "$KEYMAN_VERSION_WITH_TAG"
|
||||
popd > /dev/null
|
||||
fi
|
||||
|
||||
|
|
@ -174,12 +174,12 @@ function _builder_write_npm_version() {
|
|||
# the local package.json files, so they do need to be restored afterwards
|
||||
find "$KEYMAN_ROOT" -name "package.json" -not -path '*/node_modules/*' -print0 | \
|
||||
while IFS= read -r -d '' line; do
|
||||
cat "$line" | "$JQ" --arg VERSION_WITH_TAG "$VERSION_WITH_TAG" \
|
||||
cat "$line" | "$JQ" --arg KEYMAN_VERSION_WITH_TAG "$KEYMAN_VERSION_WITH_TAG" \
|
||||
'
|
||||
. +
|
||||
(try { dependencies: (.dependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) +
|
||||
(try { devDependencies: (.devDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) +
|
||||
(try { optionalDependencies: (.optionalDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {})
|
||||
(try { dependencies: (.dependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $KEYMAN_VERSION_WITH_TAG) | from_entries) } catch {}) +
|
||||
(try { devDependencies: (.devDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $KEYMAN_VERSION_WITH_TAG) | from_entries) } catch {}) +
|
||||
(try { optionalDependencies: (.optionalDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $KEYMAN_VERSION_WITH_TAG) | from_entries) } catch {})
|
||||
' > "${line}_"
|
||||
mv -f "${line}_" "$line"
|
||||
done
|
||||
|
|
@ -243,4 +243,4 @@ function _builder_publish_cache_package_json() {
|
|||
|
||||
function builder_publish_cleanup() {
|
||||
rm -f "$KEYMAN_ROOT/builder_package_publish.json"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# This script sets build environment variables. VERSION vars are also exported:
|
||||
# VERSION: Full current build version, e.g. "14.0.1"
|
||||
# VERSION_WIN: Full current build version for Windows, e.g. "14.0.1.0"
|
||||
# VERSION_RELEASE: Current release version, e.g. "14.0"
|
||||
# VERSION_MAJOR: Major version, e.g. "14"
|
||||
# VERSION_MINOR: Minor version, e.g. "0"
|
||||
# VERSION_PATCH: Patch version, e.g. "1"
|
||||
# TIER: Current tier, one of "alpha", "beta" or "stable"
|
||||
# VERSION_TAG: Tier + Pull Request + Location of build [-alpha|-beta][-test[-1234]][-local]
|
||||
# VERSION_WITH_TAG: e.g. "14.0.1-alpha-test-1234" or "14.0.5-beta-local" or "14.0.1-alpha-test"
|
||||
# VERSION_GIT_TAG: Git tag for the release, "release@$VERSION_WITH_TAG", e.g. "release@14.0.1-alpha-test-1234"
|
||||
# This script sets build environment variables. KEYMAN_VERSION vars are also exported:
|
||||
# KEYMAN_VERSION: Full current build version, e.g. "14.0.1"
|
||||
# KEYMAN_VERSION_WIN: Full current build version for Windows, e.g. "14.0.1.0"
|
||||
# KEYMAN_VERSION_RELEASE: Current release version, e.g. "14.0"
|
||||
# KEYMAN_VERSION_MAJOR: Major version, e.g. "14"
|
||||
# KEYMAN_VERSION_MINOR: Minor version, e.g. "0"
|
||||
# KEYMAN_VERSION_PATCH: Patch version, e.g. "1"
|
||||
# KEYMAN_TIER: Current tier, one of "alpha", "beta" or "stable"
|
||||
# KEYMAN_VERSION_TAG: Tier + Pull Request + Location of build [-alpha|-beta][-test[-1234]][-local]
|
||||
# KEYMAN_VERSION_WITH_TAG: e.g. "14.0.1-alpha-test-1234" or "14.0.5-beta-local" or "14.0.1-alpha-test"
|
||||
# KEYMAN_VERSION_GIT_TAG: Git tag for the release, "release@$KEYMAN_VERSION_WITH_TAG", e.g. "release@14.0.1-alpha-test-1234"
|
||||
# KEYMAN_ROOT: fully resolved root path of Keyman repository
|
||||
# VERSION_ENVIRONMENT: One of: local, test, alpha, beta, stable
|
||||
# UPLOAD_SENTRY: true - if VERSION_ENVIRONMENT is one of alpha, beta, stable
|
||||
# KEYMAN_VERSION_ENVIRONMENT: One of: local, test, alpha, beta, stable
|
||||
# UPLOAD_SENTRY: true - if KEYMAN_VERSION_ENVIRONMENT is one of alpha, beta, stable
|
||||
# false - if local, test. Indicates if debug artifacts should be uploaded to Sentry
|
||||
# BUILDER_OS: win|mac|linux -- current build environment
|
||||
#
|
||||
|
|
@ -57,20 +57,20 @@ function findKeymanRoot() {
|
|||
}
|
||||
|
||||
function findVersion() {
|
||||
local VERSION_MD="$KEYMAN_ROOT/VERSION.md"
|
||||
VERSION=$(builder_trim $(<"$VERSION_MD"))
|
||||
[[ "$VERSION" =~ ^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$ ]] && {
|
||||
VERSION_MAJOR="${BASH_REMATCH[1]}"
|
||||
VERSION_MINOR="${BASH_REMATCH[2]}"
|
||||
VERSION_PATCH="${BASH_REMATCH[3]}"
|
||||
VERSION_RELEASE="$VERSION_MAJOR.$VERSION_MINOR"
|
||||
local KEYMAN_VERSION_MD="$KEYMAN_ROOT/VERSION.md"
|
||||
KEYMAN_VERSION=$(builder_trim $(<"$KEYMAN_VERSION_MD"))
|
||||
[[ "$KEYMAN_VERSION" =~ ^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$ ]] && {
|
||||
KEYMAN_VERSION_MAJOR="${BASH_REMATCH[1]}"
|
||||
KEYMAN_VERSION_MINOR="${BASH_REMATCH[2]}"
|
||||
KEYMAN_VERSION_PATCH="${BASH_REMATCH[3]}"
|
||||
KEYMAN_VERSION_RELEASE="$KEYMAN_VERSION_MAJOR.$KEYMAN_VERSION_MINOR"
|
||||
} || {
|
||||
echo "Invalid VERSION.md file: expected major.minor.patch";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Used for Windows, which requires a four part version string
|
||||
VERSION_WIN="$VERSION.0"
|
||||
KEYMAN_VERSION_WIN="$KEYMAN_VERSION.0"
|
||||
|
||||
#
|
||||
# Build a tag to append to the version string. This is not assigned
|
||||
|
|
@ -78,70 +78,71 @@ function findVersion() {
|
|||
# display string and in TeamCity configuration
|
||||
#
|
||||
|
||||
if [ "$TIER" == "alpha" ] || [ "$TIER" == "beta" ]; then
|
||||
VERSION_TAG="-$TIER"
|
||||
if [ "$KEYMAN_TIER" == "alpha" ] || [ "$KEYMAN_TIER" == "beta" ]; then
|
||||
KEYMAN_VERSION_TAG="-$KEYMAN_TIER"
|
||||
else
|
||||
VERSION_TAG=
|
||||
KEYMAN_VERSION_TAG=
|
||||
fi
|
||||
|
||||
if [[ -z "${TEAMCITY_VERSION-}" && -z "${GITHUB_ACTIONS-}" && -z "${KEYMAN_PKG_BUILD-}" ]]; then
|
||||
if ! builder_is_running_on_teamcity && ! builder_is_running_on_gha \
|
||||
&& [[ -z "${KEYMAN_PKG_BUILD-}" ]]; then
|
||||
# Local dev machine, not TeamCity or GitHub Action and not .deb package build
|
||||
VERSION_TAG="$VERSION_TAG-local"
|
||||
VERSION_ENVIRONMENT=local
|
||||
KEYMAN_VERSION_TAG="$KEYMAN_VERSION_TAG-local"
|
||||
KEYMAN_VERSION_ENVIRONMENT=local
|
||||
elif [ -n "${TEAMCITY_PR_NUMBER-}" ]; then
|
||||
# On TeamCity: are we running a pull request build or a master/beta/stable build?
|
||||
VERSION_ENVIRONMENT="test"
|
||||
KEYMAN_VERSION_ENVIRONMENT="test"
|
||||
# Note TEAMCITY_PR_NUMBER can also be 'master', 'beta', or 'stable-x.y'
|
||||
# This indicates we are running a Test build.
|
||||
if [[ $TEAMCITY_PR_NUMBER =~ ^(master|beta|stable(-[0-9]+\.[0-9]+)?)$ ]]; then
|
||||
VERSION_TAG="$VERSION_TAG-test"
|
||||
KEYMAN_VERSION_TAG="$KEYMAN_VERSION_TAG-test"
|
||||
else
|
||||
VERSION_TAG="$VERSION_TAG-test-$TEAMCITY_PR_NUMBER"
|
||||
KEYMAN_VERSION_TAG="$KEYMAN_VERSION_TAG-test-$TEAMCITY_PR_NUMBER"
|
||||
fi
|
||||
elif [ -n "${GITHUB_ACTIONS-}" ] && ${GHA_TEST_BUILD-}; then
|
||||
VERSION_ENVIRONMENT="test"
|
||||
elif builder_is_running_on_gha && ${GHA_TEST_BUILD-}; then
|
||||
KEYMAN_VERSION_ENVIRONMENT="test"
|
||||
# Note GHA_BRANCH can be 'master', 'beta', or 'stable-x.y'
|
||||
# This indicates we are running a Test build.
|
||||
if [[ ${GHA_BRANCH-} =~ ^(master|beta|stable(-[0-9]+\.[0-9]+)?)$ ]]; then
|
||||
VERSION_TAG="${VERSION_TAG}-test"
|
||||
KEYMAN_VERSION_TAG="${KEYMAN_VERSION_TAG}-test"
|
||||
else
|
||||
VERSION_TAG="${VERSION_TAG}-test-${GHA_BRANCH-unset}"
|
||||
KEYMAN_VERSION_TAG="${KEYMAN_VERSION_TAG}-test-${GHA_BRANCH-unset}"
|
||||
fi
|
||||
else
|
||||
VERSION_ENVIRONMENT="$TIER"
|
||||
KEYMAN_VERSION_ENVIRONMENT="$KEYMAN_TIER"
|
||||
fi
|
||||
|
||||
VERSION_WITH_TAG="$VERSION$VERSION_TAG"
|
||||
VERSION_GIT_TAG="release@$VERSION_WITH_TAG"
|
||||
KEYMAN_VERSION_WITH_TAG="$KEYMAN_VERSION$KEYMAN_VERSION_TAG"
|
||||
KEYMAN_VERSION_GIT_TAG="release@$KEYMAN_VERSION_WITH_TAG"
|
||||
|
||||
readonly VERSION
|
||||
readonly VERSION_MAJOR
|
||||
readonly VERSION_MINOR
|
||||
readonly VERSION_PATCH
|
||||
readonly VERSION_RELEASE
|
||||
readonly VERSION_WIN
|
||||
readonly VERSION_TAG
|
||||
readonly VERSION_WITH_TAG
|
||||
readonly VERSION_ENVIRONMENT
|
||||
readonly VERSION_GIT_TAG
|
||||
readonly KEYMAN_VERSION
|
||||
readonly KEYMAN_VERSION_MAJOR
|
||||
readonly KEYMAN_VERSION_MINOR
|
||||
readonly KEYMAN_VERSION_PATCH
|
||||
readonly KEYMAN_VERSION_RELEASE
|
||||
readonly KEYMAN_VERSION_WIN
|
||||
readonly KEYMAN_VERSION_TAG
|
||||
readonly KEYMAN_VERSION_WITH_TAG
|
||||
readonly KEYMAN_VERSION_ENVIRONMENT
|
||||
readonly KEYMAN_VERSION_GIT_TAG
|
||||
|
||||
# Export version strings so places like version.gradle can access them
|
||||
export VERSION
|
||||
export VERSION_MAJOR
|
||||
export VERSION_MINOR
|
||||
export VERSION_PATCH
|
||||
export VERSION_RELEASE
|
||||
export VERSION_WIN
|
||||
export VERSION_TAG
|
||||
export VERSION_WITH_TAG
|
||||
export VERSION_ENVIRONMENT
|
||||
export VERSION_GIT_TAG
|
||||
export KEYMAN_VERSION
|
||||
export KEYMAN_VERSION_MAJOR
|
||||
export KEYMAN_VERSION_MINOR
|
||||
export KEYMAN_VERSION_PATCH
|
||||
export KEYMAN_VERSION_RELEASE
|
||||
export KEYMAN_VERSION_WIN
|
||||
export KEYMAN_VERSION_TAG
|
||||
export KEYMAN_VERSION_WITH_TAG
|
||||
export KEYMAN_VERSION_ENVIRONMENT
|
||||
export KEYMAN_VERSION_GIT_TAG
|
||||
}
|
||||
|
||||
function findTier() {
|
||||
local TIER_MD="$KEYMAN_ROOT/TIER.md"
|
||||
TIER=$(builder_trim $(<"$TIER_MD"))
|
||||
[[ "$TIER" =~ ^(alpha|beta|stable)$ ]] || {
|
||||
local KEYMAN_TIER_MD="$KEYMAN_ROOT/TIER.md"
|
||||
KEYMAN_TIER=$(builder_trim $(<"$KEYMAN_TIER_MD"))
|
||||
[[ "$KEYMAN_TIER" =~ ^(alpha|beta|stable)$ ]] || {
|
||||
echo "Invalid TIER.md file: expected alpha, beta or stable."
|
||||
exit 1;
|
||||
}
|
||||
|
|
@ -150,39 +151,40 @@ function findTier() {
|
|||
function printBuildNumberForTeamCity() {
|
||||
if [ ! -z "${TEAMCITY_VERSION-}" ]; then
|
||||
if [ ! -z "${TEAMCITY_PR_NUMBER-}" ]; then
|
||||
echo "##teamcity[buildNumber '$VERSION_WITH_TAG']"
|
||||
echo "##teamcity[buildNumber '$KEYMAN_VERSION_WITH_TAG']"
|
||||
else
|
||||
# For alpha/beta builds, for now we don't append the
|
||||
# version tag as buildNumber is used in the delivery
|
||||
# of the build version. We may improve this in the
|
||||
# future.
|
||||
echo "##teamcity[buildNumber '$VERSION']"
|
||||
echo "##teamcity[buildNumber '$KEYMAN_VERSION']"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function printVersionUtilsDebug() {
|
||||
echo "KEYMAN_ROOT: $KEYMAN_ROOT"
|
||||
echo "VERSION: $VERSION"
|
||||
echo "VERSION_WIN: $VERSION_WIN"
|
||||
echo "VERSION_RELEASE: $VERSION_RELEASE"
|
||||
echo "VERSION_MAJOR: $VERSION_MAJOR"
|
||||
echo "VERSION_MINOR: $VERSION_MINOR"
|
||||
echo "VERSION_PATCH: $VERSION_PATCH"
|
||||
echo "TIER: $TIER"
|
||||
echo "VERSION_TAG: $VERSION_TAG"
|
||||
echo "VERSION_WITH_TAG: $VERSION_WITH_TAG"
|
||||
echo "VERSION_GIT_TAG: $VERSION_GIT_TAG"
|
||||
echo "VERSION_ENVIRONMENT: $VERSION_ENVIRONMENT"
|
||||
echo "KEYMAN_ROOT: $KEYMAN_ROOT"
|
||||
echo "KEYMAN_VERSION: $KEYMAN_VERSION"
|
||||
echo "KEYMAN_VERSION_WIN: $KEYMAN_VERSION_WIN"
|
||||
echo "KEYMAN_VERSION_RELEASE: $KEYMAN_VERSION_RELEASE"
|
||||
echo "KEYMAN_VERSION_MAJOR: $KEYMAN_VERSION_MAJOR"
|
||||
echo "KEYMAN_VERSION_MINOR: $KEYMAN_VERSION_MINOR"
|
||||
echo "KEYMAN_VERSION_PATCH: $KEYMAN_VERSION_PATCH"
|
||||
echo "KEYMAN_TIER: $KEYMAN_TIER"
|
||||
echo "KEYMAN_VERSION_TAG: $KEYMAN_VERSION_TAG"
|
||||
echo "KEYMAN_VERSION_WITH_TAG: $KEYMAN_VERSION_WITH_TAG"
|
||||
echo "KEYMAN_VERSION_GIT_TAG: $KEYMAN_VERSION_GIT_TAG"
|
||||
echo "KEYMAN_VERSION_ENVIRONMENT: $KEYMAN_VERSION_ENVIRONMENT"
|
||||
}
|
||||
|
||||
function findShouldSentryRelease() {
|
||||
# Default, for 'test' or 'local' environment, or in case $VERSION_ENVIRONMENT is improperly specified.
|
||||
# Default, for 'test' or 'local' environment, or in case
|
||||
# $KEYMAN_VERSION_ENVIRONMENT is improperly specified.
|
||||
# (May be overridden by -upload-sentry in supporting build scripts.)
|
||||
UPLOAD_SENTRY=false
|
||||
|
||||
# Default: override to `true` for release builds.
|
||||
case $VERSION_ENVIRONMENT in
|
||||
case $KEYMAN_VERSION_ENVIRONMENT in
|
||||
# Actual release tiers
|
||||
alpha | beta | stable)
|
||||
UPLOAD_SENTRY=true
|
||||
|
|
@ -236,12 +238,12 @@ function exportEnvironmentDefinitionScript() {
|
|||
echo "# This file redefines critical environment variables for import to Xcode build phases." >> "$ENVIRONMENT_SH"
|
||||
echo "" >> "$ENVIRONMENT_SH"
|
||||
|
||||
# Defining variables for VERSION here will leave static definitions that don't automatically update when a user
|
||||
# Defining variables for KEYMAN_VERSION here will leave static definitions that don't automatically update when a user
|
||||
# changes branches; some branches are 'similar enough' to not require full command-line based rebuilds.
|
||||
# We want that VERSION number to properly mirror the state of its branch during development so that it matches
|
||||
# We want that KEYMAN_VERSION number to properly mirror the state of its branch during development so that it matches
|
||||
# any error reports that get logged to Sentry.
|
||||
#
|
||||
# As a result, we explicitly do NOT define VERSION or VERSION_TAG as part of ENVIRONMENT_SH.
|
||||
# As a result, we explicitly do NOT define KEYMAN_VERSION or KEYMAN_VERSION_TAG as part of ENVIRONMENT_SH.
|
||||
|
||||
echo "# Required for successful dSYM upload for Sentry error reporting" >> "$ENVIRONMENT_SH"
|
||||
echo "export SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN:-}" >> "$ENVIRONMENT_SH"
|
||||
|
|
@ -267,17 +269,17 @@ replaceVersionStrings() {
|
|||
local outfile=$2
|
||||
|
||||
sed "
|
||||
s/\$VERSION_WIN/$VERSION_WIN/g;
|
||||
s/\$VERSION_RELEASE/$VERSION_RELEASE/g;
|
||||
s/\$VERSION_MAJOR/$VERSION_MAJOR/g;
|
||||
s/\$VERSION_MINOR/$VERSION_MINOR/g;
|
||||
s/\$VERSION_PATCH/$VERSION_PATCH/g;
|
||||
s/\$TIER/$TIER/g;
|
||||
s/\$VERSION_TAG/$VERSION_TAG/g;
|
||||
s/\$VERSION_WITH_TAG/$VERSION_WITH_TAG/g;
|
||||
s/\$VERSION_GIT_TAG/$VERSION_GIT_TAG/g;
|
||||
s/\$VERSION_ENVIRONMENT/$VERSION_ENVIRONMENT/g;
|
||||
s/\$VERSION/$VERSION/g;
|
||||
s/\$KEYMAN_VERSION_WIN/$KEYMAN_VERSION_WIN/g;
|
||||
s/\$KEYMAN_VERSION_RELEASE/$KEYMAN_VERSION_RELEASE/g;
|
||||
s/\$KEYMAN_VERSION_MAJOR/$KEYMAN_VERSION_MAJOR/g;
|
||||
s/\$KEYMAN_VERSION_MINOR/$KEYMAN_VERSION_MINOR/g;
|
||||
s/\$KEYMAN_VERSION_PATCH/$KEYMAN_VERSION_PATCH/g;
|
||||
s/\$KEYMAN_TIER/$KEYMAN_TIER/g;
|
||||
s/\$KEYMAN_VERSION_TAG/$KEYMAN_VERSION_TAG/g;
|
||||
s/\$KEYMAN_VERSION_WITH_TAG/$KEYMAN_VERSION_WITH_TAG/g;
|
||||
s/\$KEYMAN_VERSION_GIT_TAG/$KEYMAN_VERSION_GIT_TAG/g;
|
||||
s/\$KEYMAN_VERSION_ENVIRONMENT/$KEYMAN_VERSION_ENVIRONMENT/g;
|
||||
s/\$KEYMAN_VERSION/$KEYMAN_VERSION/g;
|
||||
" "$infile" > "$outfile"
|
||||
}
|
||||
|
||||
|
|
@ -287,39 +289,39 @@ replaceVersionStrings_Mkver() {
|
|||
local infile=$1
|
||||
local outfile=$2
|
||||
|
||||
# Note that $VERSION differs between the two functions!
|
||||
# Note that $KEYMAN_VERSION differs between the two functions!
|
||||
# We should be deprecating all the mkver strings
|
||||
|
||||
sed "
|
||||
s/\$VersionWin/$VERSION_WIN/g;
|
||||
s/\$VersionRelease/$VERSION_RELEASE/g;
|
||||
s/\$VersionMajor/$VERSION_MAJOR/g;
|
||||
s/\$VersionMinor/$VERSION_MINOR/g;
|
||||
s/\$VersionPatch/$VERSION_PATCH/g;
|
||||
s/\$Tier/$TIER/g;
|
||||
s/\$Tag/$VERSION_TAG/g;
|
||||
s/\$VersionWithTag/$VERSION_WITH_TAG/g;
|
||||
s/\$VersionGitTag/$VERSION_GIT_TAG/g;
|
||||
s/\$VersionRc/$VERSION_MAJOR,$VERSION_MINOR,$VERSION_PATCH,0/g;
|
||||
s/\$Environment/$VERSION_ENVIRONMENT/g;
|
||||
s/\$Version/$VERSION/g;
|
||||
s/\$VERSIONNUM/$VERSION_MAJOR,$VERSION_MINOR,$VERSION_PATCH,0/g;
|
||||
s/\$RELEASE_MAJOR/$VERSION_MAJOR/g;
|
||||
s/\$RELEASE_MINOR/$VERSION_MINOR/g;
|
||||
s/\$RELEASE/$VERSION_RELEASE/g;
|
||||
s/\$VersionWin/$KEYMAN_VERSION_WIN/g;
|
||||
s/\$VersionRelease/$KEYMAN_VERSION_RELEASE/g;
|
||||
s/\$VersionMajor/$KEYMAN_VERSION_MAJOR/g;
|
||||
s/\$VersionMinor/$KEYMAN_VERSION_MINOR/g;
|
||||
s/\$VersionPatch/$KEYMAN_VERSION_PATCH/g;
|
||||
s/\$Tier/$KEYMAN_TIER/g;
|
||||
s/\$Tag/$KEYMAN_VERSION_TAG/g;
|
||||
s/\$VersionWithTag/$KEYMAN_VERSION_WITH_TAG/g;
|
||||
s/\$VersionGitTag/$KEYMAN_VERSION_GIT_TAG/g;
|
||||
s/\$VersionRc/$KEYMAN_VERSION_MAJOR,$KEYMAN_VERSION_MINOR,$KEYMAN_VERSION_PATCH,0/g;
|
||||
s/\$Environment/$KEYMAN_VERSION_ENVIRONMENT/g;
|
||||
s/\$Version/$KEYMAN_VERSION/g;
|
||||
s/\$KEYMAN_VERSIONNUM/$KEYMAN_VERSION_MAJOR,$KEYMAN_VERSION_MINOR,$KEYMAN_VERSION_PATCH,0/g;
|
||||
s/\$RELEASE_MAJOR/$KEYMAN_VERSION_MAJOR/g;
|
||||
s/\$RELEASE_MINOR/$KEYMAN_VERSION_MINOR/g;
|
||||
s/\$RELEASE/$KEYMAN_VERSION_RELEASE/g;
|
||||
|
||||
s/\$VERSION_WIN/$VERSION_WIN/g;
|
||||
s/\$VERSION_RELEASE/$VERSION_RELEASE/g;
|
||||
s/\$VERSION_MAJOR/$VERSION_MAJOR/g;
|
||||
s/\$VERSION_MINOR/$VERSION_MINOR/g;
|
||||
s/\$VERSION_PATCH/$VERSION_PATCH/g;
|
||||
s/\$TIER/$TIER/g;
|
||||
s/\$VERSION_TAG/$VERSION_TAG/g;
|
||||
s/\$VERSION_WITH_TAG/$VERSION_WITH_TAG/g;
|
||||
s/\$VERSION_GIT_TAG/$VERSION_GIT_TAG/g;
|
||||
s/\$VERSION_ENVIRONMENT/$VERSION_ENVIRONMENT/g;
|
||||
s/\$KEYMAN_VERSION_WIN/$KEYMAN_VERSION_WIN/g;
|
||||
s/\$KEYMAN_VERSION_RELEASE/$KEYMAN_VERSION_RELEASE/g;
|
||||
s/\$KEYMAN_VERSION_MAJOR/$KEYMAN_VERSION_MAJOR/g;
|
||||
s/\$KEYMAN_VERSION_MINOR/$KEYMAN_VERSION_MINOR/g;
|
||||
s/\$KEYMAN_VERSION_PATCH/$KEYMAN_VERSION_PATCH/g;
|
||||
s/\$KEYMAN_TIER/$KEYMAN_TIER/g;
|
||||
s/\$KEYMAN_VERSION_TAG/$KEYMAN_VERSION_TAG/g;
|
||||
s/\$KEYMAN_VERSION_WITH_TAG/$KEYMAN_VERSION_WITH_TAG/g;
|
||||
s/\$KEYMAN_VERSION_GIT_TAG/$KEYMAN_VERSION_GIT_TAG/g;
|
||||
s/\$KEYMAN_VERSION_ENVIRONMENT/$KEYMAN_VERSION_ENVIRONMENT/g;
|
||||
|
||||
s/\$VERSION/$VERSION_WIN/g;
|
||||
s/\$KEYMAN_VERSION/$KEYMAN_VERSION_WIN/g;
|
||||
|
||||
" "$infile" > "$outfile"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ function ci_repo_has_cached_changes {
|
|||
# * hub
|
||||
# * uuidgen (or TeamCity `$BUILD_NUMBER` if `uuidgen` not present on system)
|
||||
# Example:
|
||||
# ci_open_pull_request "$S_KEYMAN_COM" auto/keymanweb/release "auto: KeymanWeb release $VERSION_RELEASE""
|
||||
# ci_open_pull_request "$S_KEYMAN_COM" auto/keymanweb/release "auto: KeymanWeb release $KEYMAN_VERSION_RELEASE""
|
||||
#
|
||||
function ci_open_pull_request {
|
||||
local repo="$1"
|
||||
|
|
@ -117,4 +117,4 @@ function ci_open_pull_request {
|
|||
|
||||
builder_echo "Pull request successfully created"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,38 +74,38 @@ function upload {
|
|||
function upload_keyman_help {
|
||||
case $platform in
|
||||
android)
|
||||
upload android/docs/help products/android/$VERSION_RELEASE
|
||||
upload android/docs/engine developer/engine/android/$VERSION_RELEASE
|
||||
upload android/docs/help products/android/$KEYMAN_VERSION_RELEASE
|
||||
upload android/docs/engine developer/engine/android/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
ios)
|
||||
upload ios/docs/help products/iphone-and-ipad/$VERSION_RELEASE
|
||||
upload ios/docs/engine developer/engine/iphone-and-ipad/$VERSION_RELEASE
|
||||
upload ios/docs/help products/iphone-and-ipad/$KEYMAN_VERSION_RELEASE
|
||||
upload ios/docs/engine developer/engine/iphone-and-ipad/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
linux)
|
||||
pushd "$KEYMAN_ROOT/linux/keyman-config" > /dev/null
|
||||
./build.sh build
|
||||
popd > /dev/null
|
||||
upload linux/docs/help products/linux/$VERSION_RELEASE
|
||||
upload linux/docs/help products/linux/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
mac)
|
||||
upload mac/docs/help products/mac/$VERSION_RELEASE
|
||||
upload mac/docs/help products/mac/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
web)
|
||||
upload web/docs/engine developer/engine/web/$VERSION_RELEASE
|
||||
upload web/docs/engine developer/engine/web/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
windows)
|
||||
# Note: `/windows/src/desktop/help/build.sh web` must be run first
|
||||
upload windows/bin/help/md/desktop products/windows/$VERSION_RELEASE
|
||||
upload windows/docs/engine developer/engine/windows/$VERSION_RELEASE
|
||||
upload windows/bin/help/md/desktop products/windows/$KEYMAN_VERSION_RELEASE
|
||||
upload windows/docs/engine developer/engine/windows/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
developer)
|
||||
# Note: `/developer/build.sh api` must be run first - covers both uploads
|
||||
upload developer/docs/help developer/$VERSION_RELEASE
|
||||
upload developer/build/docs developer/$VERSION_RELEASE/reference/api
|
||||
upload developer/src/kmc/build/messages developer/$VERSION_RELEASE/reference/messages
|
||||
upload developer/docs/help developer/$KEYMAN_VERSION_RELEASE
|
||||
upload developer/build/docs developer/$KEYMAN_VERSION_RELEASE/reference/api
|
||||
upload developer/src/kmc/build/messages developer/$KEYMAN_VERSION_RELEASE/reference/messages
|
||||
# Note: we publish the core help alongside developer because we don't have
|
||||
# a core CI release build
|
||||
upload core/docs/api developer/core/$VERSION_RELEASE
|
||||
upload core/docs/api developer/core/$KEYMAN_VERSION_RELEASE
|
||||
;;
|
||||
*)
|
||||
display_usage
|
||||
|
|
@ -152,6 +152,6 @@ if ! ci_repo_has_cached_changes "$HELP_KEYMAN_COM"; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
ci_open_pull_request "$HELP_KEYMAN_COM" "auto/$platform-help-$VERSION_WITH_TAG" "auto: Keyman for $platform help deployment"
|
||||
ci_open_pull_request "$HELP_KEYMAN_COM" "auto/$platform-help-$KEYMAN_VERSION_WITH_TAG" "auto: Keyman for $platform help deployment"
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -111,10 +111,10 @@ fi
|
|||
|
||||
if [[ $ABORT = 50 ]]; then
|
||||
if [[ $FORCE = 0 ]]; then
|
||||
echo "Skipping version increment from $VERSION: no recently merged pull requests were found"
|
||||
echo "Skipping version increment from $KEYMAN_VERSION: no recently merged pull requests were found"
|
||||
if [ ! -z "${TEAMCITY_VERSION-}" ]; then
|
||||
# Send TeamCity a build status
|
||||
echo "##teamcity[buildStatus status='SUCCESS' text='Skipping version increment from $VERSION: no recently merged pull requests were found']"
|
||||
echo "##teamcity[buildStatus status='SUCCESS' text='Skipping version increment from $KEYMAN_VERSION: no recently merged pull requests were found']"
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
|
|
@ -131,14 +131,14 @@ popd > /dev/null
|
|||
#
|
||||
|
||||
if [ "$action" == "commit" ]; then
|
||||
echo "increment-version.sh: committing to repository and tagging release version $VERSION_WITH_TAG"
|
||||
VERSION_MD="$KEYMAN_ROOT/VERSION.md"
|
||||
NEWVERSION=`cat $VERSION_MD | tr -d "[:space:]"`
|
||||
echo "increment-version.sh: committing to repository and tagging release version $KEYMAN_VERSION_WITH_TAG"
|
||||
KEYMAN_VERSION_MD="$KEYMAN_ROOT/VERSION.md"
|
||||
NEWVERSION=`cat $KEYMAN_VERSION_MD | tr -d "[:space:]"`
|
||||
|
||||
pushd "$KEYMAN_ROOT" > /dev/null
|
||||
message="auto: increment $base version to $NEWVERSION"
|
||||
branch="auto/version-$base-$NEWVERSION"
|
||||
git tag -a "$VERSION_GIT_TAG" -m "Keyman release $VERSION_WITH_TAG"
|
||||
git tag -a "$KEYMAN_VERSION_GIT_TAG" -m "Keyman release $KEYMAN_VERSION_WITH_TAG"
|
||||
git checkout -b "$branch"
|
||||
git add VERSION.md HISTORY.md
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ if [ "$action" == "commit" ]; then
|
|||
echo "Version was incremented and pull request was created, and builds were triggered"
|
||||
if [ ! -z "${TEAMCITY_VERSION-}" ]; then
|
||||
# Send TeamCity a build status
|
||||
echo "##teamcity[buildStatus status='SUCCESS' text='Version was incremented from $VERSION to $NEWVERSION and pull request was created']"
|
||||
echo "##teamcity[buildStatus status='SUCCESS' text='Version was incremented from $KEYMAN_VERSION to $NEWVERSION and pull request was created']"
|
||||
fi
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# resources/ folder (which should be git-ignored):
|
||||
#
|
||||
# * resources/meson.build - a copy of standard.meson.build from this folder
|
||||
# * resources/VERSION_WITH_TAG.md - the value of the env var $VERSION_WITH_TAG
|
||||
# * resources/KEYMAN_VERSION_WITH_TAG.md - the value of the env var $KEYMAN_VERSION_WITH_TAG
|
||||
#
|
||||
# We do this because meson doesn't allow us to:
|
||||
#
|
||||
|
|
@ -31,5 +31,5 @@
|
|||
standard_meson_build() {
|
||||
mkdir -p "$THIS_SCRIPT_PATH/resources"
|
||||
cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build"
|
||||
echo "$VERSION_WITH_TAG" > "$THIS_SCRIPT_PATH/resources/VERSION_WITH_TAG.md"
|
||||
echo "$KEYMAN_VERSION_WITH_TAG" > "$THIS_SCRIPT_PATH/resources/KEYMAN_VERSION_WITH_TAG.md"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,17 @@ generate_table() {
|
|||
# echo "${strarr[@]}"
|
||||
|
||||
for n in ${!strarr[@]}; do
|
||||
echo "| ${strarr[n]} | ${!strarr[n]} |"
|
||||
case "${strarr[n]}" in
|
||||
KEYMAN_VERSION | KEYMAN_VERSION_MAJOR | KEYMAN_VERSION_MINOR | \
|
||||
KEYMAN_VERSION_PATCH | KEYMAN_VERSION_RELEASE | KEYMAN_VERSION_WIN | \
|
||||
KEYMAN_VERSION_TAG | KEYMAN_VERSION_WITH_TAG | \
|
||||
KEYMAN_VERSION_ENVIRONMENT | KEYMAN_VERSION_GIT_TAG)
|
||||
# ignore the variables that contain the Keyman version
|
||||
;;
|
||||
*)
|
||||
echo "| ${strarr[n]} | ${!strarr[n]} |"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
|
@ -62,4 +72,4 @@ do_test() {
|
|||
|
||||
builder_run_action clean rm -f "$KEYMAN_ROOT/docs/minimum-versions.md"
|
||||
builder_run_action build do_build
|
||||
builder_run_action test do_test
|
||||
builder_run_action test do_test
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ function makeSentryRelease() {
|
|||
if isSentryConfigured; then
|
||||
if isSentryCliAvailable; then
|
||||
# This version tag matches the repository version tag release@x.y.z
|
||||
echo "Making a Sentry release for tag $VERSION_GIT_TAG"
|
||||
sentry-cli releases new -p keyman-android -p keyman-developer -p keyman-ios -p keyman-linux -p keyman-mac -p keyman-web -p keyman-windows $VERSION_GIT_TAG
|
||||
echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG"
|
||||
sentry-cli releases new -p keyman-android -p keyman-developer -p keyman-ios -p keyman-linux -p keyman-mac -p keyman-web -p keyman-windows $KEYMAN_VERSION_GIT_TAG
|
||||
|
||||
echo "Setting commits for release tag $VERSION_GIT_TAG"
|
||||
sentry-cli releases set-commits --auto $VERSION_GIT_TAG
|
||||
echo "Setting commits for release tag $KEYMAN_VERSION_GIT_TAG"
|
||||
sentry-cli releases set-commits --auto $KEYMAN_VERSION_GIT_TAG
|
||||
|
||||
echo "Finalizing release tag $VERSION_GIT_TAG"
|
||||
sentry-cli releases finalize "$VERSION_GIT_TAG"
|
||||
echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG"
|
||||
sentry-cli releases finalize "$KEYMAN_VERSION_GIT_TAG"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Calls script in xcode-utils to update the version
|
||||
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
# true: applies KEYMAN_VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
# updates the version string for Settings
|
||||
|
||||
source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"
|
||||
|
||||
phaseSetBundleVersions true
|
||||
|
||||
setSettingsBundleVersion
|
||||
setSettingsBundleVersion
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Calls script in xcode-utils to update the version
|
||||
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
# true: applies KEYMAN_VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
# updates the version string for Settings
|
||||
|
||||
source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"
|
||||
|
||||
phaseSetBundleVersions
|
||||
|
||||
setSettingsBundleVersion
|
||||
setSettingsBundleVersion
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Calls script in xcode-utils to update the version
|
||||
# true: applies VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
# true: applies KEYMAN_VERSION_WITH_TAG to custom KeymanVersionWithTag plist member used for in-app display
|
||||
|
||||
source "$KEYMAN_ROOT/resources/build/xcode-utils.sh"
|
||||
phaseSetBundleVersions true
|
||||
phaseSetBundleVersions true
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ function do_build() {
|
|||
echo "PASS: parent: builder_has_option --debug is true"
|
||||
}
|
||||
|
||||
builder_parse build:child -d
|
||||
builder_parse build:child --debug
|
||||
builder_run_action build do_build
|
||||
builder_run_child_actions build
|
||||
|
|
|
|||
|
|
@ -89,6 +89,12 @@ fi
|
|||
builder_parse_test() {
|
||||
local expected="$1"
|
||||
local expected_options="$2"
|
||||
|
||||
# When testing in a local environment, --debug will be added by default (see #11106)
|
||||
if [[ $KEYMAN_VERSION_ENVIRONMENT == "local" ]]; then
|
||||
expected_options="${expected_options} --debug"
|
||||
fi
|
||||
|
||||
shift
|
||||
shift
|
||||
local parameters="$@"
|
||||
|
|
@ -97,8 +103,8 @@ builder_parse_test() {
|
|||
if [[ "$expected" != "${_builder_chosen_action_targets[@]}" ]]; then
|
||||
builder_die " Test: builder_parse $parameters action:target != \"$expected\""
|
||||
fi
|
||||
if [[ "$expected_options" != "${_builder_chosen_options[@]}" ]]; then
|
||||
builder_die " Test: builder_parse $parameters, options != \"$expected\""
|
||||
if [[ "${expected_options}" != "${_builder_chosen_options[@]}" ]]; then
|
||||
builder_die " Test: builder_parse $parameters, options != \"${expected_options}\""
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -184,10 +190,173 @@ fi
|
|||
echo -e "${COLOR_BLUE}## Testing output of: builder_parse --feature xyzzy --bar abc --baz def test${COLOR_RESET}"
|
||||
parse_output=$(builder_parse --feature xyzzy --bar abc --baz def test)
|
||||
expected="$(builder_echo setmark "test.sh parameters: <--feature xyzzy --bar abc --baz def test>")"
|
||||
|
||||
if [[ $KEYMAN_VERSION_ENVIRONMENT == "local" ]]; then
|
||||
# When run in a local-dev environment, an extra line appears about the automatic --debug option.
|
||||
expected="$(builder_echo grey "Local build environment detected: setting --debug")"$'\n'"$(builder_echo setmark "test.sh parameters: <--feature xyzzy --bar abc --baz def test --debug>")"
|
||||
fi
|
||||
if [[ "${parse_output[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for '--feature xyzzy --bar abc --baz def test':\n Actual : ${parse_output[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
function builder_echo_tests() {
|
||||
echo -e "${COLOR_BLUE}## Testing builder_echo (heading)${COLOR_RESET}"
|
||||
local _old_builder_debug_internal=${_builder_debug_internal}
|
||||
|
||||
# regular build, no internal debug
|
||||
_builder_debug_internal=false
|
||||
expected="$(echo -e "${BUILDER_BOLD}${COLOR_BRIGHT_WHITE}[resources/build/test]${COLOR_RESET} ${COLOR_BLUE}description${COLOR_RESET}")"
|
||||
result=$(builder_echo heading "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo heading description' (no debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# regular build, with internal debug
|
||||
_builder_debug_internal=true
|
||||
expected="$(echo -e "${BUILDER_BOLD}${COLOR_BRIGHT_WHITE}[resources/build/test]${COLOR_RESET} ${COLOR_BLUE}description${COLOR_RESET}")"
|
||||
result=$(builder_echo heading "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' (debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
_builder_debug_internal=${_old_builder_debug_internal}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
function builder_echo_start_end_tests() {
|
||||
echo -e "${COLOR_BLUE}## Testing builder_echo (start/end)${COLOR_RESET}"
|
||||
local _old_builder_debug_internal=${_builder_debug_internal}
|
||||
local _OLD_TEAMICITY_GIT_PATH=${TEAMCITY_GIT_PATH:-}
|
||||
local _old_builder_is_child=${_builder_is_child}
|
||||
|
||||
# regular build, no internal debug, no child build
|
||||
TEAMCITY_GIT_PATH=""
|
||||
_builder_debug_internal=false
|
||||
_builder_is_child=1
|
||||
expected="$(builder_echo heading "description")"
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' (no debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo success "description")"
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' (no debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' (no debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# regular build, no internal debug, is child build
|
||||
TEAMCITY_GIT_PATH=""
|
||||
_builder_debug_internal=false
|
||||
_builder_is_child=0
|
||||
expected=""
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' (no debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected=""
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' (no debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' (no debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# regular build, with internal debug, no child build
|
||||
_builder_debug_internal=true
|
||||
_builder_is_child=1
|
||||
expected="$(builder_echo heading "description")"
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' (debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo success "description")"
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' (debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' (debug, no child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# regular build, with internal debug, is child build
|
||||
_builder_debug_internal=true
|
||||
_builder_is_child=0
|
||||
expected="$(builder_echo heading "description")"
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' (debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo success "description")"
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' (debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' (debug, is child):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# simulate running on TeamCity
|
||||
TEAMCITY_GIT_PATH="foo"
|
||||
# TC build, no internal debug
|
||||
_builder_debug_internal=false
|
||||
expected="##teamcity[blockOpened name='|[resources/build/test|] foo']
|
||||
$(builder_echo heading "description")"
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' on TC (no debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo success "description")
|
||||
##teamcity[blockClosed name='|[resources/build/test|] foo']"
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' on TC (no debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")
|
||||
##teamcity[blockClosed name='|[resources/build/test|] foo']"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' on TC (no debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
|
||||
# TC build, with internal debug
|
||||
_builder_debug_internal=true
|
||||
expected="##teamcity[blockOpened name='|[resources/build/test|] foo']
|
||||
$(builder_echo heading "description")"
|
||||
result=$(builder_echo start "foo" "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo start foo description' on TC (debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo success "description")
|
||||
##teamcity[blockClosed name='|[resources/build/test|] foo']"
|
||||
result=$(builder_echo end "foo" success "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo success description' on TC (debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
expected="$(builder_echo error "description")
|
||||
##teamcity[blockClosed name='|[resources/build/test|] foo']"
|
||||
result=$(builder_echo end "foo" error "description")
|
||||
if [[ "${result[*]}" != "${expected}" ]]; then
|
||||
builder_die "FAIL: Wrong output for 'builder_echo end foo error description' on TC (debug):\n Actual : ${result[*]}\n Expected: ${expected}"
|
||||
fi
|
||||
TEAMCITY_GIT_PATH="${_OLD_TEAMICITY_GIT_PATH}"
|
||||
_builder_debug_internal=${_old_builder_debug_internal}
|
||||
_builder_is_child=${_old_builder_is_child}
|
||||
}
|
||||
builder_echo_tests
|
||||
builder_echo_start_end_tests
|
||||
|
||||
# Run tests based in separate scripts to facilitate their operation
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ function triggerGitHubActionsBuild() {
|
|||
|
||||
if [ "${action:-""}" == "commit" ]; then
|
||||
# This will only be true if we created and pushed a tag
|
||||
GIT_BUILD_SHA="$(git rev-parse "refs/tags/release@$VERSION_WITH_TAG")"
|
||||
GIT_BUILD_SHA="$(git rev-parse "refs/tags/release@$KEYMAN_VERSION_WITH_TAG")"
|
||||
GIT_BASE_REF="$(git rev-parse "${GIT_BUILD_SHA}^")"
|
||||
GIT_EVENT_TYPE="${GITHUB_ACTION}: release@${VERSION_WITH_TAG}"
|
||||
GIT_EVENT_TYPE="${GITHUB_ACTION}: release@${KEYMAN_VERSION_WITH_TAG}"
|
||||
elif [[ $GIT_BRANCH != stable-* ]] && [[ $GIT_BRANCH =~ [0-9]+ ]]; then
|
||||
local JSON=$(call_curl "${GITHUB_SERVER}/pulls/${GIT_BRANCH}" --header "Authorization: token $GITHUB_TOKEN")
|
||||
GIT_BUILD_SHA="$(echo "$JSON" | $JQ -r '.head.sha')"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const splicePullsIntoHistory = async (pulls: PRInformation[], base?: string): Pr
|
|||
tier = (await spawnChild('git', ['show', base+':TIER.md'])).trim();
|
||||
}
|
||||
}
|
||||
//logInfo(`VERSION="${version}"`);
|
||||
//logInfo(`KEYMAN_VERSION="${version}"`);
|
||||
|
||||
//
|
||||
// Load and parse history file, looking for our version
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ COMMON_ROOT="$KEYMAN_ROOT/common/windows/delphi"
|
|||
OUTLIB="$WINDOWS_ROOT/lib"
|
||||
COMMON_OUTLIB="$KEYMAN_ROOT/common/windows/lib"
|
||||
|
||||
if builder_is_debug_build || [[ $VERSION_ENVIRONMENT == local ]] || [[ ! -z ${TEAMCITY_PR_NUMBER+x} ]]; then
|
||||
if builder_is_debug_build || [[ $KEYMAN_VERSION_ENVIRONMENT == local ]] || [[ ! -z ${TEAMCITY_PR_NUMBER+x} ]]; then
|
||||
# We do a fast build for debug builds, local builds, test PR builds but not for master/beta/stable release builds
|
||||
GO_FAST=1
|
||||
else
|
||||
|
|
@ -125,8 +125,8 @@ wrap-symstore() {
|
|||
"$ProgramFilesx86/Windows Kits/10/Debuggers/x64/symstore.exe" \
|
||||
add \
|
||||
//s "$KEYMAN_SYMSTOREPATH" \
|
||||
//v "$VERSION_WIN" \
|
||||
//c "Version: $VERSION_WITH_TAG" \
|
||||
//v "$KEYMAN_VERSION_WIN" \
|
||||
//c "Version: $KEYMAN_VERSION_WITH_TAG" \
|
||||
//compress //f "$@"
|
||||
}
|
||||
|
||||
|
|
@ -147,4 +147,4 @@ create-windows-output-folders() {
|
|||
mkdir -p "$WINDOWS_DEBUGPATH_APP"
|
||||
mkdir -p "$WINDOWS_DEBUGPATH_ENGINE"
|
||||
mkdir -p "$WINDOWS_DEBUGPATH_SUPPORT"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ function phaseSetBundleVersions() {
|
|||
TAGGED=false
|
||||
fi
|
||||
|
||||
# For command-line builds, VERSION and VERSION_WITH_TAG) are forwarded through xcodebuild.
|
||||
if [ -z "${VERSION:-}" ]; then
|
||||
# For command-line builds, KEYMAN_VERSION and KEYMAN_VERSION_WITH_TAG) are forwarded through xcodebuild.
|
||||
if [ -z "${KEYMAN_VERSION:-}" ]; then
|
||||
# This is likely not a command-line build at the top level; it's been triggered through Xcode.
|
||||
# The $VERSION-loading code is in build-utils.sh, but we need $THIS_SCRIPT to be set
|
||||
# The $KEYMAN_VERSION-loading code is in build-utils.sh, but we need $THIS_SCRIPT to be set
|
||||
# (in similar manner to the "standard build header") in order to avoid script errors therein.
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
|
||||
|
|
@ -53,9 +53,9 @@ function phaseSetBundleVersions() {
|
|||
# local builds triggered through Xcode's UI, which aren't part of our CI processes.
|
||||
. "$KEYMAN_ROOT/resources/build/build-utils.sh"
|
||||
echo "phaseSetBundleVersions: UI build - fetching version from repository:"
|
||||
echo " Plain: $VERSION"
|
||||
echo " Tagged: $VERSION_WITH_TAG"
|
||||
echo " Environment: $VERSION_ENVIRONMENT"
|
||||
echo " Plain: $KEYMAN_VERSION"
|
||||
echo " Tagged: $KEYMAN_VERSION_WITH_TAG"
|
||||
echo " Environment: $KEYMAN_VERSION_ENVIRONMENT"
|
||||
else
|
||||
echo "phaseSetBundleVersions: Command-line build - using provided version parameters"
|
||||
fi
|
||||
|
|
@ -76,48 +76,48 @@ function phaseSetBundleVersions() {
|
|||
APP_PLIST="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleVersion to $BUILD_NUMBER for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$APP_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleShortVersionString to $VERSION for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :CFBundleShortVersionString $VERSION" "$APP_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleShortVersionString to $KEYMAN_VERSION for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :CFBundleShortVersionString $KEYMAN_VERSION" "$APP_PLIST"
|
||||
|
||||
/usr/libexec/Plistbuddy -c "Print" "$APP_PLIST"
|
||||
|
||||
# Only attempt to write this when directly specified (otherwise, generates minor warning)
|
||||
if [ $TAGGED == true ]; then
|
||||
echo "phaseSetBundleVersions: Setting KeymanVersionWithTag to $VERSION_WITH_TAG for tagged version for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :KeymanVersionWithTag $VERSION_WITH_TAG" "$APP_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting KeymanVersionEnvironment to $VERSION_ENVIRONMENT for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :KeymanVersionEnvironment $VERSION_ENVIRONMENT" "$APP_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting KeymanVersionWithTag to $KEYMAN_VERSION_WITH_TAG for tagged version for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :KeymanVersionWithTag $KEYMAN_VERSION_WITH_TAG" "$APP_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting KeymanVersionEnvironment to $KEYMAN_VERSION_ENVIRONMENT for $APP_PLIST"
|
||||
/usr/libexec/Plistbuddy -c "Set :KeymanVersionEnvironment $KEYMAN_VERSION_ENVIRONMENT" "$APP_PLIST"
|
||||
fi
|
||||
|
||||
if [ -f "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}.dSYM/Contents/Info.plist" ]; then
|
||||
DSYM_PLIST="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}.dSYM/Contents/Info.plist"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleVersion to $BUILD_NUMBER for $DSYM_PLIST"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$DSYM_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleShortVersionString to $VERSION for $DSYM_PLIST"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" "$DSYM_PLIST"
|
||||
echo "phaseSetBundleVersions: Setting CFBundleShortVersionString to $KEYMAN_VERSION for $DSYM_PLIST"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $KEYMAN_VERSION" "$DSYM_PLIST"
|
||||
fi
|
||||
}
|
||||
|
||||
# Used by Keyman for iOS to update the human-readable string for its Settings screen.
|
||||
function setSettingsBundleVersion() {
|
||||
# For command-line builds, VERSION and VERSION_WITH_TAG) are forwarded through xcodebuild.
|
||||
if [ -z "${VERSION:-}" ]; then
|
||||
# For command-line builds, KEYMAN_VERSION and KEYMAN_VERSION_WITH_TAG) are forwarded through xcodebuild.
|
||||
if [ -z "${KEYMAN_VERSION:-}" ]; then
|
||||
# We're not a command-line build... so we'll need to retrieve these values ourselves with ./build-utils.sh.
|
||||
# Note that this script's process will not have access to TC environment variables, but that's fine for
|
||||
# local builds triggered through Xcode's UI, which aren't part of our CI processes.
|
||||
. "$KEYMAN_ROOT/resources/build/build-utils.sh"
|
||||
echo "setSettingsBundleVersion: UI build - fetching version from repository:"
|
||||
echo " Plain: $VERSION"
|
||||
echo " Tagged: $VERSION_WITH_TAG"
|
||||
echo " Plain: $KEYMAN_VERSION"
|
||||
echo " Tagged: $KEYMAN_VERSION_WITH_TAG"
|
||||
echo " Environment: (not setting, assume 'local')"
|
||||
else
|
||||
echo "setSettingsBundleVersion: Command-line build - using provided version parameters"
|
||||
fi
|
||||
|
||||
SETTINGS_PLIST="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Settings.bundle/Root.plist"
|
||||
echo "setSettingsBundleVersion: Setting $VERSION_WITH_TAG for $SETTINGS_PLIST"
|
||||
echo "setSettingsBundleVersion: Setting $KEYMAN_VERSION_WITH_TAG for $SETTINGS_PLIST"
|
||||
# We assume that entry 0 = the version "preference" entry.
|
||||
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $VERSION_WITH_TAG" "$SETTINGS_PLIST"
|
||||
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:0:DefaultValue $KEYMAN_VERSION_WITH_TAG" "$SETTINGS_PLIST"
|
||||
}
|
||||
|
||||
# Build Phase: Upload dSYM (debug) files to Sentry
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2310
|
||||
|
||||
# Note: these two lines can be uncommented for debugging and profiling build
|
||||
# scripts:
|
||||
|
|
@ -169,35 +170,66 @@ function builder_heading() {
|
|||
|
||||
|
||||
builder_echo() {
|
||||
local color=white message= mark=
|
||||
if [[ $# -gt 1 && $1 =~ ^(white|grey|green|success|blue|heading|yellow|warning|red|error|purple|brightwhite|teal|debug|setmark)$ ]]; then
|
||||
color="$1"
|
||||
shift
|
||||
local color=white message= mark= block= action= do_output=true
|
||||
|
||||
if [[ $# -gt 1 ]]; then
|
||||
if [[ $1 =~ ^(white|grey|green|success|blue|heading|yellow|warning|red|error|purple|brightwhite|teal|debug|setmark)$ ]]; then
|
||||
color="$1"
|
||||
shift
|
||||
elif [[ $1 == "start" ]]; then
|
||||
# builder_echo start block message
|
||||
action="$1"
|
||||
block="$2"
|
||||
shift 2
|
||||
color="heading"
|
||||
if ! builder_is_running_on_teamcity && builder_is_child_build; then
|
||||
do_output=${_builder_debug_internal:-false}
|
||||
fi
|
||||
elif [[ $1 == "end" ]]; then
|
||||
# builder_echo end block status message
|
||||
action="$1"
|
||||
block="$2"
|
||||
color="$3"
|
||||
shift 3
|
||||
if [[ "${color}" != "error" ]] && ! builder_is_running_on_teamcity && builder_is_child_build; then
|
||||
do_output=${_builder_debug_internal:-false}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
message="$*"
|
||||
|
||||
if [[ ! -z ${COLOR_RED+x} ]]; then
|
||||
case $color in
|
||||
white) color="$COLOR_WHITE" ;;
|
||||
grey) color="$COLOR_GREY" ;;
|
||||
green|success) color="$COLOR_GREEN" ;;
|
||||
blue|heading) color="$COLOR_BLUE" ;;
|
||||
yellow|warning) color="$COLOR_YELLOW" ;;
|
||||
red|error) color="$COLOR_RED" ;;
|
||||
purple) color="$COLOR_PURPLE" ;;
|
||||
brightwhite) color="$COLOR_BRIGHTWHITE" ;;
|
||||
teal|debug) color="$COLOR_TEAL" ;;
|
||||
setmark) mark="$HEADING_SETMARK" color="$COLOR_PURPLE" ;;
|
||||
esac
|
||||
if [[ "${action}" == "start" ]] && builder_is_running_on_teamcity; then
|
||||
echo -e "##teamcity[blockOpened name='|[${THIS_SCRIPT_IDENTIFIER}|] ${block}']"
|
||||
fi
|
||||
|
||||
if builder_is_dep_build; then
|
||||
echo -e "$mark$COLOR_GREY[$THIS_SCRIPT_IDENTIFIER]$COLOR_RESET $color$message$COLOR_RESET"
|
||||
if ${do_output}; then
|
||||
if [[ ! -z ${COLOR_RED+x} ]]; then
|
||||
case $color in
|
||||
white) color="$COLOR_WHITE" ;;
|
||||
grey) color="$COLOR_GREY" ;;
|
||||
green|success) color="$COLOR_GREEN" ;;
|
||||
blue|heading) color="$COLOR_BLUE" ;;
|
||||
yellow|warning) color="$COLOR_YELLOW" ;;
|
||||
red|error) color="$COLOR_RED" ;;
|
||||
purple) color="$COLOR_PURPLE" ;;
|
||||
brightwhite) color="$COLOR_BRIGHTWHITE" ;;
|
||||
teal|debug) color="$COLOR_TEAL" ;;
|
||||
setmark) mark="$HEADING_SETMARK" color="$COLOR_PURPLE" ;;
|
||||
esac
|
||||
|
||||
if builder_is_dep_build; then
|
||||
echo -e "$mark$COLOR_GREY[$THIS_SCRIPT_IDENTIFIER]$COLOR_RESET $color$message$COLOR_RESET"
|
||||
else
|
||||
echo -e "$mark$BUILDER_BOLD$COLOR_BRIGHT_WHITE[$THIS_SCRIPT_IDENTIFIER]$COLOR_RESET $color$message$COLOR_RESET"
|
||||
fi
|
||||
else
|
||||
echo -e "$mark$BUILDER_BOLD$COLOR_BRIGHT_WHITE[$THIS_SCRIPT_IDENTIFIER]$COLOR_RESET $color$message$COLOR_RESET"
|
||||
# Cope with the case of pre-init message and just emit plain text
|
||||
echo -e "$message"
|
||||
fi
|
||||
else
|
||||
# Cope with the case of pre-init message and just emit plain text
|
||||
echo -e "$message"
|
||||
fi
|
||||
|
||||
if [[ "${action}" == "end" ]] && builder_is_running_on_teamcity; then
|
||||
echo -e "##teamcity[blockClosed name='|[${THIS_SCRIPT_IDENTIFIER}|] ${block}']"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -393,9 +425,7 @@ _builder_execute_child() {
|
|||
|
||||
local script="$THIS_SCRIPT_PATH/${_builder_target_paths[$target]}/build.sh"
|
||||
|
||||
if $_builder_debug_internal; then
|
||||
builder_echo heading "## $action$target starting..."
|
||||
fi
|
||||
builder_echo start "$action$target" "## $action$target starting..."
|
||||
|
||||
# Build array of specified inheritable options
|
||||
local child_options=()
|
||||
|
|
@ -424,12 +454,10 @@ _builder_execute_child() {
|
|||
$builder_debug \
|
||||
$_builder_offline \
|
||||
&& (
|
||||
if $_builder_debug_internal; then
|
||||
builder_echo success "## $action$target completed successfully"
|
||||
fi
|
||||
builder_echo end "$action$target" success "## $action$target completed successfully"
|
||||
) || (
|
||||
result=$?
|
||||
builder_echo error "## $action$target failed with exit code $result"
|
||||
builder_echo end "$action$target" error "## $action$target failed with exit code $result"
|
||||
exit $result
|
||||
) || exit $? # Required due to above subshell masking exit
|
||||
}
|
||||
|
|
@ -619,19 +647,19 @@ builder_start_action() {
|
|||
# verify whether a target output is present.
|
||||
if builder_is_dep_build &&
|
||||
! builder_is_full_dep_build &&
|
||||
_builder_dep_output_exists $_builder_matched_action; then
|
||||
builder_echo "skipping $_builder_matched_action_name, up-to-date"
|
||||
_builder_dep_output_exists "${_builder_matched_action}"; then
|
||||
builder_echo "skipping ${_builder_matched_action_name}, up-to-date"
|
||||
return 1
|
||||
fi
|
||||
|
||||
builder_echo blue "## $_builder_matched_action_name starting..."
|
||||
if [ -n "${_builder_current_action}" ]; then
|
||||
builder_echo start "${_builder_matched_action_name}" "## ${_builder_matched_action_name} starting..."
|
||||
if [[ -n "${_builder_current_action}" ]]; then
|
||||
_builder_warn_if_incomplete
|
||||
fi
|
||||
_builder_current_action="$_builder_matched_action"
|
||||
_builder_current_action="${_builder_matched_action}"
|
||||
|
||||
# Build dependencies as required
|
||||
_builder_do_build_deps "$_builder_matched_action"
|
||||
_builder_do_build_deps "${_builder_matched_action}"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
|
@ -1048,6 +1076,7 @@ _builder_get_default_description() {
|
|||
:module) description="this module" ;;
|
||||
:tools) description="build tools for this project" ;;
|
||||
--debug) description="debug build" ;;
|
||||
--release) description="release build (prevents --debug in local-env builds)" ;;
|
||||
esac
|
||||
echo "$description"
|
||||
}
|
||||
|
|
@ -1269,6 +1298,7 @@ _builder_parse_expanded_parameters() {
|
|||
_builder_build_deps=--deps
|
||||
builder_verbose=
|
||||
builder_debug=
|
||||
local is_release=false
|
||||
local _params=($@)
|
||||
_builder_chosen_action_targets=()
|
||||
_builder_chosen_options=()
|
||||
|
|
@ -1385,10 +1415,15 @@ _builder_parse_expanded_parameters() {
|
|||
_builder_chosen_options+=(--verbose)
|
||||
builder_verbose=--verbose
|
||||
;;
|
||||
--debug|-d)
|
||||
--debug)
|
||||
_builder_chosen_options+=(--debug)
|
||||
builder_debug=--debug
|
||||
;;
|
||||
--release)
|
||||
_builder_chosen_options+=(--release)
|
||||
# As of #13827, this is only checked when detecting if --debug should be auto-applied.
|
||||
is_release=true
|
||||
;;
|
||||
--deps|--no-deps|--force-deps)
|
||||
_builder_build_deps=$key
|
||||
;;
|
||||
|
|
@ -1472,11 +1507,21 @@ _builder_parse_expanded_parameters() {
|
|||
else
|
||||
# This is a top-level invocation, so we want to track which dependencies
|
||||
# have been built, so they don't get built multiple times.
|
||||
export _builder_deps_built=`mktemp`
|
||||
|
||||
# Per #11106, local builds use --debug by default.
|
||||
# Second condition prevents the block (and message) from executing when --debug is already specified explicitly.
|
||||
if [[ $KEYMAN_VERSION_ENVIRONMENT == "local" ]] && [[ $builder_debug != --debug ]] && ! $is_release; then
|
||||
builder_echo grey "Local build environment detected: setting --debug"
|
||||
_params+=(--debug)
|
||||
_builder_chosen_options+=(--debug)
|
||||
builder_debug=--debug
|
||||
fi
|
||||
|
||||
builder_echo setmark "$(basename "$0") parameters: <${_params[@]}>"
|
||||
if [[ ${#builder_extra_params[@]} -gt 0 ]]; then
|
||||
builder_echo grey "$(basename "$0") extra parameters: <${builder_extra_params[@]}>"
|
||||
fi
|
||||
export _builder_deps_built=`mktemp`
|
||||
fi
|
||||
|
||||
if builder_is_debug_build; then
|
||||
|
|
@ -1660,14 +1705,14 @@ builder_finish_action() {
|
|||
# file or directory exist now?
|
||||
if _builder_dep_output_defined $matched_action && ! _builder_dep_output_exists "$matched_action"; then
|
||||
builder_echo warning "Expected output: '${_builder_dep_path[$matched_action]}'."
|
||||
builder_echo warning "## $action_name completed successfully, but output does not exist"
|
||||
builder_echo end "$action_name" warning "## $action_name completed successfully, but output does not exist"
|
||||
else
|
||||
builder_echo success "## $action_name completed successfully"
|
||||
builder_echo end "$action_name" success "## $action_name completed successfully"
|
||||
fi
|
||||
elif [[ $result == failure ]]; then
|
||||
builder_echo error "## $action_name failed"
|
||||
builder_echo end "$action_name" error "## $action_name failed"
|
||||
else
|
||||
builder_echo error "## $action_name failed with message: $result"
|
||||
builder_echo end "$action_name" error "## $action_name failed with message: $result"
|
||||
fi
|
||||
|
||||
# Remove $action$target from the array; it is no longer a current action
|
||||
|
|
@ -2095,6 +2140,33 @@ builder_is_target_excluded_by_platform() {
|
|||
return 1
|
||||
}
|
||||
|
||||
# Returns 0 if the script is running in a Docker container
|
||||
builder_is_running_on_docker() {
|
||||
if [[ -z ${DOCKER_RUNNING:-} ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Returns 0 if the script is running in a GitHub Actions environment
|
||||
builder_is_running_on_gha() {
|
||||
if [[ -z ${GITHUB_ACTIONS:-} ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Returns 0 if the script is running on TeamCity
|
||||
builder_is_running_on_teamcity() {
|
||||
if [[ -z "${TEAMCITY_GIT_PATH:-}" ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Final initialization
|
||||
################################################################################
|
||||
|
|
|
|||
|
|
@ -28,62 +28,13 @@ builder_describe \
|
|||
|
||||
builder_parse "$@"
|
||||
|
||||
_add_build_args() {
|
||||
local var=$1
|
||||
local default_var=$2
|
||||
local name=$3
|
||||
local value
|
||||
|
||||
value="${!var:=${!default_var:-}}"
|
||||
|
||||
build_args+=(--build-arg="${var}=${value}")
|
||||
|
||||
if [[ -n "${build_version:-}" ]]; then
|
||||
build_version="${build_version}-${name:-}${value}"
|
||||
else
|
||||
build_version="${name}${value}"
|
||||
fi
|
||||
}
|
||||
|
||||
_convert_parameters_to_build_args() {
|
||||
build_args=()
|
||||
build_version=
|
||||
local required_node_version keyman_default_distro
|
||||
# shellcheck disable=SC2034
|
||||
required_node_version="$(_print_expected_node_version)"
|
||||
# shellcheck disable=SC2034
|
||||
keyman_default_distro="ubuntu"
|
||||
|
||||
_add_build_args DISTRO keyman_default_distro ""
|
||||
_add_build_args DISTRO_VERSION KEYMAN_DEFAULT_VERSION_UBUNTU_CONTAINER ""
|
||||
_add_build_args JAVA_VERSION KEYMAN_VERSION_JAVA java
|
||||
_add_build_args REQUIRED_NODE_VERSION required_node_version node
|
||||
_add_build_args REQUIRED_EMSCRIPTEN_VERSION KEYMAN_MIN_VERSION_EMSCRIPTEN emsdk
|
||||
|
||||
if [[ -n "${BASE_VERSION:-}" ]]; then
|
||||
build_args+=(--build-arg="BASE_VERSION=${BASE_VERSION}")
|
||||
fi
|
||||
}
|
||||
|
||||
_check_for_default_values() {
|
||||
if [[ -z "${DISTRO_VERSION:-}" ]] && [[ -z "${JAVA_VERSION:-}" ]]; then
|
||||
is_default_values=true
|
||||
else
|
||||
is_default_values=false
|
||||
fi
|
||||
}
|
||||
|
||||
_is_default_values() {
|
||||
${is_default_values}
|
||||
}
|
||||
|
||||
build_action() {
|
||||
local platform=$1
|
||||
|
||||
builder_echo debug "Building image for ${platform}"
|
||||
|
||||
if [[ "${platform}" == "base" ]]; then
|
||||
# shellcheck disable=SC2154 # set by _convert_parameters_to_build_args
|
||||
# shellcheck disable=SC2154 # set by convert_parameters_to_args
|
||||
docker pull "${DISTRO}:${DISTRO_VERSION}"
|
||||
elif [[ "${platform}" == "linux" ]]; then
|
||||
cp "${KEYMAN_ROOT}/linux/debian/control" "${platform}"
|
||||
|
|
@ -116,8 +67,8 @@ test_action() {
|
|||
"${platform}" -- ./build.sh configure,build,test:"${platform}"
|
||||
}
|
||||
|
||||
_check_for_default_values
|
||||
_convert_parameters_to_build_args
|
||||
check_for_default_values
|
||||
convert_parameters_to_args
|
||||
|
||||
if builder_has_action build; then
|
||||
build_action base
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ locate_emscripten() {
|
|||
# For developers, define KEYMAN_USE_EMSDK to do this on your
|
||||
# build machine.
|
||||
verify_emscripten_version() {
|
||||
if [[ "$VERSION_ENVIRONMENT" != local || ! -z "${KEYMAN_USE_EMSDK+x}" ]]; then
|
||||
if [[ "$KEYMAN_VERSION_ENVIRONMENT" != local || ! -z "${KEYMAN_USE_EMSDK+x}" ]]; then
|
||||
_select_emscripten_version_with_emsdk
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,19 +170,19 @@ write_download_info() {
|
|||
set_version ( ) {
|
||||
PRODUCT_PATH=$1
|
||||
|
||||
if [ $VERSION ]; then
|
||||
if [ $KEYMAN_VERSION ]; then
|
||||
if [ $2 ]; then # $2 = product name.
|
||||
echo "Setting version numbers in $2 to $VERSION."
|
||||
echo "Setting version numbers in $2 to $KEYMAN_VERSION."
|
||||
fi
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $VERSION" "$PRODUCT_PATH/Info.plist"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $VERSION" "$PRODUCT_PATH/Info.plist"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $KEYMAN_VERSION" "$PRODUCT_PATH/Info.plist"
|
||||
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $KEYMAN_VERSION" "$PRODUCT_PATH/Info.plist"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Uses npm to set the current package version (package.json).
|
||||
#
|
||||
# This sets the version according to the current VERSION_WITH_TAG.
|
||||
# This sets the version according to the current KEYMAN_VERSION_WITH_TAG.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
|
|
@ -194,7 +194,7 @@ set_npm_version () {
|
|||
# release of Keyman Developer -- these two versions should be in sync. Because this
|
||||
# is a large repo with multiple projects and build systems, it's better for us that
|
||||
# individual build systems don't take too much ownership of git tagging. :)
|
||||
npm version --allow-same-version --no-git-tag-version --no-commit-hooks "$VERSION_WITH_TAG"
|
||||
npm version --allow-same-version --no-git-tag-version --no-commit-hooks "$KEYMAN_VERSION_WITH_TAG"
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -265,7 +265,7 @@ verify_npm_setup() {
|
|||
# If we are on CI environment, automatically select a node version with nvm
|
||||
# Also, a developer can set KEYMAN_USE_NVM variable to get this behaviour
|
||||
# automatically too (see /docs/build/node.md)
|
||||
if [[ "$VERSION_ENVIRONMENT" != local || ! -z "${KEYMAN_USE_NVM+x}" ]]; then
|
||||
if [[ "$KEYMAN_VERSION_ENVIRONMENT" != local || ! -z "${KEYMAN_USE_NVM+x}" ]]; then
|
||||
_select_node_version_with_nvm
|
||||
fi
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ check-markdown() {
|
|||
builder_do_typescript_tests() {
|
||||
local MOCHA_FLAGS=
|
||||
|
||||
if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then
|
||||
if builder_is_running_on_teamcity; then
|
||||
# we're running in TeamCity
|
||||
MOCHA_FLAGS="-reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ builder_describe "Check markdown internal links" \
|
|||
"build"
|
||||
|
||||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
configure "${THIS_SCRIPT_PATH}/node_modules" \
|
||||
build build/index.js
|
||||
|
||||
builder_parse "$@"
|
||||
|
|
|
|||
14
web/build.sh
14
web/build.sh
|
|
@ -9,6 +9,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
|
||||
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
|
||||
|
||||
# ################################ Main script ################################
|
||||
|
||||
|
|
@ -41,8 +42,7 @@ builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
|
|||
":samples Builds all needed resources for the KMW sample-page set" \
|
||||
":tools Builds engine-related development resources" \
|
||||
":test-pages=src/test/manual Builds resources needed for the KMW manual testing pages" \
|
||||
":_all (Meta build target used when targets are not specified)" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
":_all (Meta build target used when targets are not specified)"
|
||||
|
||||
# Possible TODO?
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
@ -135,14 +135,6 @@ build_action() {
|
|||
"${KEYMAN_ROOT}/web/build/test/dom/cases/attachment/"
|
||||
}
|
||||
|
||||
test_action() {
|
||||
TEST_OPTS=
|
||||
if builder_has_option --ci; then
|
||||
TEST_OPTS=--ci
|
||||
fi
|
||||
./test.sh "${TEST_OPTS}"
|
||||
}
|
||||
|
||||
coverage_action() {
|
||||
builder_echo "Creating coverage report..."
|
||||
|
||||
|
|
@ -213,7 +205,7 @@ builder_run_action build:_all build_action
|
|||
|
||||
# Run tests
|
||||
builder_run_child_actions test
|
||||
builder_run_action test:_all test_action
|
||||
builder_run_action test:_all ./test.sh
|
||||
|
||||
function do_test_help() {
|
||||
check-markdown "$KEYMAN_ROOT/web/docs/engine"
|
||||
|
|
|
|||
35
web/ci.sh
35
web/ci.sh
|
|
@ -37,7 +37,7 @@ builder_parse "$@"
|
|||
|
||||
####
|
||||
|
||||
TIER=$(cat ../TIER.md)
|
||||
KEYMAN_TIER=$(cat ../TIER.md)
|
||||
BUILD_NUMBER=$(cat ../VERSION.md)
|
||||
|
||||
function web_sentry_upload () {
|
||||
|
|
@ -50,7 +50,7 @@ function web_sentry_upload () {
|
|||
|
||||
# --strip-common-prefix does not take an argument, unlike --strip-prefix. It auto-detects
|
||||
# the most common prefix instead.
|
||||
sentry-cli releases files "${VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix "$1" \
|
||||
sentry-cli releases files "${KEYMAN_VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix "$1" \
|
||||
--rewrite --ext js --ext map --ext ts
|
||||
echo "Upload successful."
|
||||
}
|
||||
|
|
@ -63,8 +63,7 @@ function build_action() {
|
|||
# - also useful when validating this script on a local dev machine!
|
||||
# - build: then do the ACTUAL build.
|
||||
# one option:
|
||||
# - --ci: For app/browser, outputs 'release' config filesize profiling logs
|
||||
./build.sh configure clean build --ci
|
||||
./build.sh configure clean build
|
||||
|
||||
# Upload the sentry-configuration engine used by the mobile apps to sentry
|
||||
# Also, clean 'em first.
|
||||
|
|
@ -79,19 +78,7 @@ function build_action() {
|
|||
}
|
||||
|
||||
function test_action() {
|
||||
# Testing step: run ALL unit tests, including those of the submodules.
|
||||
|
||||
OPTIONS=
|
||||
if ! builder_is_debug_build; then
|
||||
OPTIONS=--ci
|
||||
fi
|
||||
|
||||
# No --reporter option exists yet for the headless modules.
|
||||
|
||||
"${KEYMAN_ROOT}/web/src/engine/keyboard/build.sh" test ${OPTIONS}
|
||||
"${KEYMAN_ROOT}/web/src/engine/osk/gesture-processor/build.sh" test ${OPTIONS}
|
||||
|
||||
./build.sh test ${OPTIONS}
|
||||
./build.sh test
|
||||
}
|
||||
|
||||
function post_test_action() {
|
||||
|
|
@ -132,7 +119,7 @@ function prepare_s_keyman_com_action() {
|
|||
# Second phase: copy the artifacts over
|
||||
|
||||
# The main build products are expected to reside at the root of this folder.
|
||||
BASE_PUBLISH_FOLDER="${S_KEYMAN_COM}/kmw/engine/${VERSION}"
|
||||
BASE_PUBLISH_FOLDER="${S_KEYMAN_COM}/kmw/engine/${KEYMAN_VERSION}"
|
||||
echo "FOLDER: ${BASE_PUBLISH_FOLDER}"
|
||||
mkdir -p "${BASE_PUBLISH_FOLDER}"
|
||||
|
||||
|
|
@ -143,27 +130,27 @@ function prepare_s_keyman_com_action() {
|
|||
# Third phase: tweak the sourcemaps
|
||||
# We can use an alt-mode of Web's sourcemap-root tool for this.
|
||||
for sourcemap in "${BASE_PUBLISH_FOLDER}/"*.map; do
|
||||
node "${KEYMAN_ROOT}/web/build/tools/building/sourcemap-root/index.js" null "${sourcemap}" --sourceRoot "https://s.keyman.com/kmw/engine/${VERSION}/src"
|
||||
node "${KEYMAN_ROOT}/web/build/tools/building/sourcemap-root/index.js" null "${sourcemap}" --sourceRoot "https://s.keyman.com/kmw/engine/${KEYMAN_VERSION}/src"
|
||||
done
|
||||
|
||||
# Construct the PR
|
||||
echo "Committing and pushing KeymanWeb release ${VERSION} to s.keyman.com"
|
||||
echo "Committing and pushing KeymanWeb release ${KEYMAN_VERSION} to s.keyman.com"
|
||||
|
||||
ci_add_files "${S_KEYMAN_COM}" "kmw/engine/${VERSION}"
|
||||
ci_add_files "${S_KEYMAN_COM}" "kmw/engine/${KEYMAN_VERSION}"
|
||||
if ! ci_repo_has_cached_changes "${S_KEYMAN_COM}"; then
|
||||
builder_die "No release was added to s.keyman.com, something went wrong"
|
||||
fi
|
||||
|
||||
ci_open_pull_request "${S_KEYMAN_COM}" auto/keymanweb/release "auto: KeymanWeb release ${VERSION}"
|
||||
ci_open_pull_request "${S_KEYMAN_COM}" auto/keymanweb/release "auto: KeymanWeb release ${KEYMAN_VERSION}"
|
||||
}
|
||||
|
||||
# Note: for now, this command is used to prepare the artifacts used by the download site, but
|
||||
# NOT to actually UPLOAD them via rsync or to produce related .download_info files.
|
||||
function prepare_downloads_keyman_com_action() {
|
||||
UPLOAD_PATH="${KEYMAN_ROOT}/web/build/upload/${VERSION}"
|
||||
UPLOAD_PATH="${KEYMAN_ROOT}/web/build/upload/${KEYMAN_VERSION}"
|
||||
|
||||
# --- First action artifact - the KMW zip file ---
|
||||
ZIP="${UPLOAD_PATH}/keymanweb-${VERSION}.zip"
|
||||
ZIP="${UPLOAD_PATH}/keymanweb-${KEYMAN_VERSION}.zip"
|
||||
|
||||
mkdir -p "${UPLOAD_PATH}"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
# Needed for builder_is_ci_build check.
|
||||
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
|
||||
|
||||
BUNDLE_CMD="node $KEYMAN_ROOT/web/src/tools/es-bundling/build/common-bundle.mjs"
|
||||
|
||||
# Compiles all build products corresponding to the specified target.
|
||||
|
|
@ -101,7 +104,7 @@ function test-headless() {
|
|||
fi
|
||||
|
||||
TEST_OPTS=
|
||||
if builder_has_option --ci; then
|
||||
if builder_is_ci_build; then
|
||||
TEST_OPTS="--reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
if [[ -n "$TEST_EXTENSIONS" ]]; then
|
||||
|
|
|
|||
301
web/docs/internal/keystroke-lifecycle.md
Normal file
301
web/docs/internal/keystroke-lifecycle.md
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
# The Keyman Engine for Web keystroke lifecycle
|
||||
|
||||
The phases of Keyman Engine for Web keystroke processings are as follows:
|
||||
|
||||
1. Keystroke pre-processing: event interception + interpretation (pre-processing)
|
||||
2. Keystroke processing: keystroke main-group rule evaluation
|
||||
3. Keystroke post-processing: keystroke post-keystroke evaluation + side-effects
|
||||
4. Keystroke resolution: UI state updating
|
||||
|
||||
Keyman Engine for Web currently has two different builds, each used in specific
|
||||
contexts:
|
||||
|
||||
* app/browser - for direct use on a page or site within a web browser
|
||||
* app/webview - for integration with a host app, such as Keyman itself
|
||||
|
||||
The overall phases for the keystroke lifecycle are the same for both; the
|
||||
implementation is merely a bit different for each within specific phases. These
|
||||
differences are documented after the common structure and patterns for each
|
||||
phase.
|
||||
|
||||
Also note that Keyman Engine for Web supports keystroke processing for different
|
||||
keyboard specification formats:
|
||||
- JS
|
||||
- KMX (via web-core)
|
||||
- KMX+ / LDML (via web-core)
|
||||
|
||||
The `KeyboardProcessor` classes each handle keystroke processing for one
|
||||
specification format while adhering to a common interface exposed and accessible
|
||||
to the other layers of the keystroke lifecycle.
|
||||
|
||||
```mermaid
|
||||
---
|
||||
title: Keystroke lifecycle flowchart
|
||||
---
|
||||
%% For rendering, use e.g. https://mermaid.live
|
||||
%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
||||
sequenceDiagram;
|
||||
|
||||
actor User as User + UI
|
||||
participant Keystroke interpretation functionality
|
||||
|
||||
Note over User, KeymanEngine: Start: Keystroke pre-processing
|
||||
User ->> Keystroke interpreter: Types a key
|
||||
Keystroke interpreter ->> Keystroke interpreter: Preprocess keystroke events
|
||||
Keystroke interpreter ->> KeymanEngine: Raise preprocessed event
|
||||
Note over User, KeymanEngine: End: Keystroke pre-processing
|
||||
KeymanEngine ->>+ InputProcessor: Forward keystroke data
|
||||
|
||||
Note over InputProcessor, KeyboardProcessor: Start: Keystroke processing
|
||||
InputProcessor ->> InputProcessor: Validate context, keyboard
|
||||
InputProcessor ->> InputProcessor: Snapshot context state
|
||||
|
||||
InputProcessor ->>+ KeyboardProcessor: Process keystroke
|
||||
KeyboardProcessor ->> KeyboardProcessor: Determine effects
|
||||
KeyboardProcessor -->> User: Update raw context
|
||||
KeyboardProcessor ->>- InputProcessor: Return effects
|
||||
|
||||
opt Predictive Text
|
||||
loop For each nearby key
|
||||
InputProcessor ->>+ KeyboardProcessor: Fat-finger (alternate) keystrokes
|
||||
KeyboardProcessor ->> KeyboardProcessor: Determine effects
|
||||
KeyboardProcessor ->>- InputProcessor: Return effects
|
||||
end
|
||||
end
|
||||
|
||||
Note over InputProcessor, KeyboardProcessor: End: Keystroke processing
|
||||
Note over InputProcessor, KeyboardProcessor: Start: Keystroke post-processing
|
||||
|
||||
InputProcessor ->> InputProcessor: Apply keystroke effects
|
||||
InputProcessor ->> InputProcessor: Cache context state, keystroke effects
|
||||
InputProcessor -->> User: Update OSK layer
|
||||
InputProcessor ->>+ KeyboardProcessor: Process post-keystroke effects
|
||||
KeyboardProcessor ->>- InputProcessor: Return effects
|
||||
InputProcessor -->> User: Update OSK layer
|
||||
|
||||
opt Predictive Text
|
||||
InputProcessor --)+ Predictive-text engine: Request corrections, predictions
|
||||
InputProcessor -->> User: Invalidate outdated predictions
|
||||
end
|
||||
|
||||
Note over InputProcessor, KeyboardProcessor: End: Keystroke post-processing
|
||||
|
||||
opt app/browser
|
||||
InputProcessor ->> InputProcessor: Trigger DOM `input` event
|
||||
end
|
||||
|
||||
Note over Keystroke interpreter, InputProcessor: Start: Keystroke resolution
|
||||
InputProcessor ->>- KeymanEngine: Return effects
|
||||
|
||||
KeymanEngine ->> Keystroke interpreter: Store state token for multitaps
|
||||
KeymanEngine ->> Keystroke interpreter: Determine TAB, ENTER, etc effects
|
||||
Note over Keystroke interpreter, InputProcessor: End: Keystroke resolution
|
||||
|
||||
opt Predictive Text
|
||||
Predictive-text engine ->> Predictive-text engine: Determine corrections,<br>predictions (async)
|
||||
Note over User, Predictive-text engine: After async delay
|
||||
Predictive-text engine --)- User: Return new predictions, update banner
|
||||
end
|
||||
```
|
||||
|
||||
## Keystroke pre-processing
|
||||
|
||||
Both the `app/browser` and `app/webview` products are capable of handling
|
||||
keystrokes from the on-screen keyboard as well as hardware keystrokes. For
|
||||
hardware keystrokes, this varies between the two, while the majority of
|
||||
on-screen keyboard keystrokes are handled identically.
|
||||
|
||||
### `app/browser` - hardware keystrokes
|
||||
|
||||
The `app/browser` version of the engine is designed to integrate with the active
|
||||
page of the user's browser. As a result of this, contexts for text manipulation
|
||||
are directly implemented within Web elements that the engine has direct access
|
||||
to. It can thus attach DOM event handlers (for
|
||||
[`keydown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event),
|
||||
[`keyup`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event),
|
||||
and
|
||||
[`keypress`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event))
|
||||
in order to process hardware keystrokes. Its `HardwareEventKeyboard` class is
|
||||
the primary module for handling hardware keystrokes - it establishes the needed
|
||||
engine event hooks and methods used to fully handle and preprocess their
|
||||
keystroke data for further use later in the keystroke lifecycle.
|
||||
|
||||
The bulk of DOM key events trigger keystroke processing on key-down, though modifier keys also receive key-up handling. Key-press events are handled selectively for held backspaces and possibly certain keystrokes for mnemonic keyboards. In all cases, DOM keyboard event objects are preprocessed by the centralized `preprocessKeyboardEvent` method, which converts the DOM event [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) format into the Web engine's `KeyEvent` format, which is the form required by the keyboard rules within compiled JS keyboards. This includes mnemonic keystroke preprocessing and remapping in addition to AltGr emulation.
|
||||
|
||||
### `app/webview` - hardware keystrokes
|
||||
|
||||
The `app/webview` version of the engine, which is designed to be used while embedded in a platform-specific host app, does not have direct access to standard hardware keystroke events, as those are handled by the host app's OS and by native code handlers run outside the host app's WebView containing the app/webview Web engine. It is the responsibility of the host app to handle hardware keystroke events and preprocess them on behalf of the Web engine, then forward them to the Web engine via JS call into the WebView. The `PassthroughKeyboard` class within `app/webview` space provides the method `raiseKeyEvent` as an internal API for this purpose, which converts the mobile-app format for hardware keystroke into the internal `KeyEvent` format. `raiseKeyEvent` also handles mnemonic keystroke processing and remapping.
|
||||
|
||||
Also note that this variant does not model the user's text context with Web elements - it is entirely managed through the `Mock` type.
|
||||
|
||||
### On-screen keyboard
|
||||
|
||||
For both `app/browser` and `app/webview`, the on-screen keyboard delegates mouse
|
||||
and touch processing to [our internal gesture engine](./gestures/index.md) for
|
||||
most keyboards. (Keyboards that instead display "help pages", such as
|
||||
`sil_euro_latin` on desktop, have specialized handling.) The gesture engine is
|
||||
responsible for interpreting all DOM mouse and touch events for OSKs based on
|
||||
the touch-layout format, which are managed by the `VisualKeyboard` class. The
|
||||
gesture engine will raise events about the gesture lifecycle that, when
|
||||
appropriate, will emit `KeyElement` instances - elements of the constructed OSK
|
||||
corresponding to elements of the OSK directly representing keyboard keys.
|
||||
|
||||
OSK keystroke preprocessing operates a little differently from hardware
|
||||
keystrokes. The `ActiveLayout` object for the current form-factor of the
|
||||
`Keyboard` maintains a "base" `KeyEvent` object, per key, that is
|
||||
lazy-constructed (by the `.baseKeyEvent` property) when first needed - the meat
|
||||
of which is performed by the `ActiveKeyBase.constructBaseKeyEvent` method. This
|
||||
is only evaluated up to once per key per activation of the keyboard. As
|
||||
keystrokes are received during OSK use, `VisualKeyboard.keyEventFromSpec` calls
|
||||
the `Keyboard.constructKeyEvent` method to clone that base `KeyEvent` object for
|
||||
the incoming keystroke and then adjust it to match current modifier and
|
||||
state-key settings.
|
||||
|
||||
### Passing `KeyEvent` on for processing
|
||||
|
||||
Regardless of the path taken to generate the `KeyEvent` object, _all_ keystroke
|
||||
handling modules of Keyman Engine for Web then raise that `KeyEvent` object via
|
||||
their `keyevent` event as specified by the `KeyEventSourceInterface` type. This
|
||||
event also permits a callback that is used by the final phase of the lifecycle -
|
||||
keystroke resolution - as needed. The main `KeymanEngine` base class listens
|
||||
for these events and forwards them for next phase of the lifecycle - keystroke
|
||||
processing - to the `InputProcessor` module, which passes control to whichever
|
||||
`KeystrokeProcessor` type is active for the keyboard when appropriate.
|
||||
|
||||
## Keystroke processing
|
||||
|
||||
Once the `KeyEvent` object for a keystroke has been passed into the
|
||||
`InputProcessor` module and its `processKeyEvent` method, the
|
||||
keystroke-processing stage has been reached. There are a number of subprocesses
|
||||
that trigger here in sequence - keystrokes don't go _straight_ to evaluation
|
||||
against keyboard rules.
|
||||
|
||||
### Pre-keystroke state management
|
||||
|
||||
First, the engine checks the keyboard associated with the `KeyEvent`, ensuring
|
||||
that it is still in place. (See [#7543](https://github.com/keymanapp/keyman/issues/7543) for more details.) With that assertion
|
||||
in place, it then performs a check needed to support multitaps - it checks to
|
||||
see if the key event has an associated "base context" and reverts the current
|
||||
context to match it if so. Once those checks are fulfilled, the engine then
|
||||
checks to see if the key event corresponds to a pure layer-switching or
|
||||
modifier/state-key interaction. If those are detected, rule-evaluation is
|
||||
bypassed.
|
||||
|
||||
On a similar note, backspace and spacebar keystrokes receive special handling
|
||||
next in associated with predictive-text functionality. When autocorrect is
|
||||
enabled, the spacebar in particular can be used to accept the current suggestion
|
||||
instead of acting as whitespace; if this is triggered, its `KeyEvent` will be
|
||||
swallowed - no rule processing will occur for the it. The backspace may trigger
|
||||
display of a "reversion" suggestion when applicable but will not be swallowed.
|
||||
|
||||
Once this phase is reached, the engine will then snapshot the current state of
|
||||
the context, then trigger standard rule processing against the original context
|
||||
by calling the current `KeyboardProcessor`'s `processKeystroke` method. Any
|
||||
operations against the context will be persisted and take full effect; DOM input
|
||||
elements (for `app/browser`) are updated during rule evaluation.
|
||||
|
||||
### Determining direct keystroke effects
|
||||
|
||||
The `KeyboardProcessor` classes, which each embody how one keyboard
|
||||
specification pattern interprets keystrokes, are responsible for determining the
|
||||
effects that should arise when evaluating the incoming keystroke with the
|
||||
current context state. While the exact mechanisms of this may vary depending
|
||||
upon the type of keyboard - be it JS, KMX, or KMX+ (LDML), the role is the same
|
||||
- interpreting the keystroke in context.
|
||||
|
||||
### JS keyboards
|
||||
|
||||
Before proceeding further, `KeyboardProcessor` does a context check to see
|
||||
whether or not the context contains anything considered deletable - in the case
|
||||
of a BKSP, we need to ensure that the keystroke passes through to the engine's
|
||||
host cleanly, as it may have special implications for the site or host app.
|
||||
|
||||
With that out of the way, the JS keyboard's main group is then provided with the
|
||||
`KeyEvent` object in order to evaluate the keyboard's rules against the
|
||||
keystroke. This involves constructing a `RuleBehavior` object to track any and
|
||||
all needed side-effects for the keystroke. Such changes are generally not
|
||||
applied to the engine at large at this time in order to prevent unwanted side
|
||||
effects that may arise to and from predictive text operations that follow
|
||||
shortly afterward.
|
||||
|
||||
The `KeyboardInterface` class defines the internal API used by keyboards for
|
||||
their evaluation of keyboard rules.
|
||||
|
||||
Once the keyboard's script returns control to the main engine, the engine then
|
||||
determines the net effects to the context that resulted from applying the
|
||||
keyboard rule and preserves that as a `Transcription`, part of includes a
|
||||
`Transform` that most directly represents the changes to text surrounding the
|
||||
text insertion point.
|
||||
|
||||
For JS keyboards, if no keyboard rule is defined for a non-frame key on the
|
||||
`default` or `shift` layer, there is an additional set of implied "default"
|
||||
keyboard rules that is applied. (A keyboard's source must _explicitly_ specify
|
||||
to not emit anything for such keys if such an outcome is desired.) This occurs
|
||||
regardless of the keystroke's source, as such effects are necessary to
|
||||
incorporate for predictive-text operations. If no such rule exists, the
|
||||
processor will add a note to the `RuleBehavior` object that default processing
|
||||
could not be provided and is thus needed from the engine's host.
|
||||
|
||||
### KMX keyboards & KMX+ (LDML) keyboards
|
||||
|
||||
For KMX and KMX+ keyboards, keystrokes are evaluated by using the embedded WASM
|
||||
version of Keyman Core.
|
||||
|
||||
TODO: add link to specific mechanisms here once available.
|
||||
|
||||
### "Alternate" processing (predictive-text)
|
||||
|
||||
Once the incoming `KeyEvent` has been processed, if predictive-text is active
|
||||
and the `KeyEvent` includes fat-finger oriented data, the engine will then build
|
||||
a set of "alternates" - of "phantom" keystrokes - and process _them_ against
|
||||
headless clones of the original context in the same manner as the original
|
||||
keystroke.
|
||||
|
||||
Once all relevant "alternates" have been evaluated, the engine will then signal
|
||||
the predictive-text engine with all relevant data, including the original,
|
||||
snapshotted state of the context. It does not actually trigger predictive-text
|
||||
at this time; processing of alternates is done before keystroke post-processing
|
||||
in order to avoid cross-effects from JS-keyboard variable store manipulations
|
||||
and similar mechanisms. Fat-finger "alternate" `KeyEvent`s are evaluated as if
|
||||
they occurred under the exact same conditions as the keystroke that was actually
|
||||
detected.
|
||||
|
||||
### Keystroke post-processing
|
||||
|
||||
At this stage, the side-effects desired for the original keystroke, as saved to
|
||||
its `RuleBehavior`, are then applied. Note that this includes changes to the
|
||||
`&layer` store - this update will also trigger an event that updates the state
|
||||
of the OSK to match the desired layer.
|
||||
|
||||
Once that is done, the engine will then save data relevant to the original
|
||||
context state, the `KeyEvent`, and the `RuleBehavior` to the "context cache"
|
||||
supporting multitap context reversion. These effects include layer-change
|
||||
effects that result from JS keyboard rules, which modify the KMN-style keyboard
|
||||
stores `&oldlayer` and `&newlayer` in preparation for `begin PostKeystroke`
|
||||
group processing, which is then executed (and which can trigger another `&layer`
|
||||
& OSK-layer update).
|
||||
|
||||
Once post-keystroke effects have been determined, the engine then signals
|
||||
predictive-text to generate new predictions associated with the keystroke. For
|
||||
`app/browser` variants of the engine, changes to the context will then also
|
||||
trigger the DOM `input` event on the context's element in case third parties
|
||||
wish to leverage such events for their website's pages.
|
||||
|
||||
### Keystroke resolution
|
||||
|
||||
At this stage, `InputProcessor` passes control back to the main `KeymanEngine`
|
||||
module, which then triggers the "on rule finalization" setting if configured.
|
||||
This setting is mostly used for page-integration within `app/browser`,
|
||||
supporting DOM element `change` event emulation whenever focus shifts away from
|
||||
the active context element.
|
||||
|
||||
For OSK keystrokes, an identifier associated with the `KeyEvent`'s context
|
||||
snapshot will be made accessible through the `keyevent` event's callback
|
||||
parameter - a feature utilized by multitap gesture support.
|
||||
|
||||
For hardware-keyboard keystrokes, the `keyevent` callback is used to determine
|
||||
whether or not native handling for the keystroke should be triggered - such as
|
||||
for TAB and ENTER keys, which may have semantic command-like functionality
|
||||
depending on the state of the Web engine's host - be that a web page or an
|
||||
Android/iOS app utilizing the keyboard. ENTER keys are often used to submit
|
||||
forms, and this helps ensure we trigger such functionality when appropriate.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Keystroke Processing
|
||||
|
||||
In addition to handling keystroke events produced from hardware keyboards, Keyman Engine for Web manages an on-screen keyboard that can also be used to generate such events. This document will enumerate the various components of data management and control flow used to handle and process keystrokes.
|
||||
In addition to handling keystroke events produced from hardware keyboards, Keyman Engine for Web manages an on-screen keyboard that can also be used to generate such events. This document will enumerate the various components of data management and control flow used to handle and process keystrokes. For a more thorough examination of the keystroke lifecycle, see the [keystroke-lifecycle](./keystroke-lifecycle.md) page.
|
||||
|
||||
## Input: KeyEvent - the pre-processed keystroke
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ builder_describe "Builds the Keyman Engine for Web's website-integrating version
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?s
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ builder_describe "Builds the Keyman Engine for Web's desktop form-factor keyboar
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?s
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ builder_describe "Builds the Keyman Engine for Web's puppetable version designed
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?s
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ builder_describe "Builds the Keyman Engine for Web (KMW) attachment engine." \
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
module.exports = {
|
||||
// Temporarily ignored due to noise it would cause within the refactor
|
||||
ignorePatterns: ["**/kmwstring.ts"]
|
||||
};
|
||||
|
|
@ -22,8 +22,7 @@ builder_describe \
|
|||
"Compiles the web-oriented utility function module." \
|
||||
"@/common/web/keyman-version" \
|
||||
"@/web/src/tools/es-bundling" \
|
||||
clean configure build test \
|
||||
"--ci For use with action ${BUILDER_TERM_START}test${BUILDER_TERM_END} - emits CI-friendly test reports"
|
||||
clean configure build test
|
||||
|
||||
builder_describe_outputs \
|
||||
configure "/node_modules" \
|
||||
|
|
@ -49,7 +48,7 @@ function do_test() {
|
|||
builder_heading "Running web-utils test suite"
|
||||
|
||||
local FLAGS=
|
||||
if builder_has_option --ci; then
|
||||
if builder_is_ci_build; then
|
||||
echo "Replacing user-friendly test reports with CI-friendly versions."
|
||||
FLAGS="$FLAGS --reporter mocha-teamcity-reporter"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ export function charCodeAt(s: string, index: number) {
|
|||
}
|
||||
}
|
||||
|
||||
let first = str.charCodeAt(codeUnitIndex);
|
||||
const first = str.charCodeAt(codeUnitIndex);
|
||||
if(first >= 0xD800 && first <= 0xDBFF && str.length > codeUnitIndex + 1) {
|
||||
let second = str.charCodeAt(codeUnitIndex + 1);
|
||||
const second = str.charCodeAt(codeUnitIndex + 1);
|
||||
if(second >= 0xDC00 && second <= 0xDFFF) {
|
||||
return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000;
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ export function substring(s: string, indexA: number, indexB?: number) {
|
|||
indexBCodeUnit = str.length;
|
||||
} else {
|
||||
if(indexA > indexB) {
|
||||
let c = indexA;
|
||||
const c = indexA;
|
||||
indexA = indexB;
|
||||
indexB = c;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ builder_describe "Builds DOM-utility modules used by the Keyman Engine for Web (
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ builder_describe "Builds DOM-based OutputTarget subclasses used by the Keyman En
|
|||
"clean" \
|
||||
"configure" \
|
||||
"build" \
|
||||
"test" \
|
||||
"--ci+ Set to utilize CI-based test configurations & reporting."
|
||||
"test"
|
||||
|
||||
# Possible TODO?
|
||||
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue