Skip to content

Commit a39510e

Browse files
Merge pull request #2356 from keymanapp/auto/A19S17-merge-master-into-staging
auto: A19S17 merge master into staging
2 parents f8f1518 + 970b3f5 commit a39510e

68 files changed

Lines changed: 4981 additions & 45 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
shell: bash
1919
run: |
2020
echo "TIER_TEST" > tier.txt
21-
./build.sh configure build start
21+
./build.sh configure build start --debug
2222
env:
2323
fail-fast: true
2424

@@ -37,13 +37,21 @@ jobs:
3737
3838
- name: Check broken links
3939
shell: bash
40+
continue-on-error: false
4041
run: |
41-
set +e;
42-
set +o pipefail;
43-
npx broken-link-checker http://localhost:8055 --ordered --recursive --requests 50 --host-requests 50 -e --filter-level 3 | \
42+
set +e
43+
set +o pipefail
44+
npx broken-link-checker http://localhost:8055 --ordered --recursive --host-requests 50 -e --filter-level 3 | tee blc.log
45+
echo "BLC_RESULT=${PIPESTATUS[0]}" >> "$GITHUB_ENV"
46+
47+
- name: Report on broken links
48+
run: |
49+
set +e
50+
set +o pipefail
51+
cat blc.log | \
4452
grep -E "BROKEN|Getting links from" | \
45-
grep -B 1 "BROKEN"
46-
exit ${PIPESTATUS[0]}
53+
grep -B 1 "BROKEN";
54+
exit "${BLC_RESULT}"
4755
4856
- name: Check PHP errors
4957
shell: bash

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
**/.DS_Store
33
.idea/
44
cdn/deploy
5+
6+
tier.txt
7+
8+
# unit test artifacts
9+
blc.log
10+
.phpunit.result.cache
11+
512
vendor*
613
.vscode/
714
node_modules/

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# syntax=docker/dockerfile:1
2+
3+
ARG BUILDER_CONFIGURATION="release"
24
FROM php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d AS composer-builder
35

46
# Install Zip to use composer
@@ -15,7 +17,14 @@ RUN composer self-update
1517
USER www-data
1618
WORKDIR /composer
1719
COPY composer.* /composer/
18-
RUN composer install
20+
# Consume the build argment
21+
ARG BUILDER_CONFIGURATION
22+
RUN if [ "$BUILDER_CONFIGURATION" = "debug" ]; then \
23+
# composer install --dev deprecated
24+
COMPOSER_NO_DEV=0 composer install ; \
25+
else \
26+
COMPOSER_NO_DEV=1 composer install ; \
27+
fi
1928

2029
# Site
2130
FROM php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ shell, and from this folder, run:
7272
./build.sh build
7373
```
7474

75+
If you'll be running tests locally, the Docker image will need to be built with dev dependencies:
76+
77+
```sh
78+
./build.sh build --debug
79+
```
80+
7581
#### Start the Docker container
7682

7783
To start up the website, in bash, run:
@@ -101,7 +107,11 @@ In bash, run:
101107

102108
#### Running tests
103109

104-
To check for broken links and .php file conformance, when the site is running,
110+
When the site is running, the test action will do the following:
111+
* PHP unit tests
112+
* Check .php file conformance
113+
* Check for internal broken links
114+
105115
in bash, run:
106116

107117
```sh

build.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## START STANDARD SITE BUILD SCRIPT INCLUDE
33
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
44
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
5-
readonly BOOTSTRAP_VERSION=v1.0.7
5+
readonly BOOTSTRAP_VERSION=v1.08
66
[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -H "Cache-Control: no-cache" -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
77
## END STANDARD SITE BUILD SCRIPT INCLUDE
88

@@ -31,21 +31,38 @@ builder_parse "$@"
3131
function test_docker_container() {
3232
# Note: ci.yml replicates these
3333

34-
# Run unit tests
34+
echo "TIER_TEST" > tier.txt
35+
set +e;
36+
set +o pipefail;
37+
38+
builder_echo blue "---- PHP unit tests"
3539
docker exec $HELP_CONTAINER_DESC sh -c "vendor/bin/phpunit --testdox"
3640

3741
# Lint .php files for obvious errors
42+
builder_echo blue "---- Lint PHP files"
3843
docker exec $HELP_CONTAINER_DESC sh -c "find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\n' php -l"
3944

4045
# Check all internal links
4146
# NOTE: link checker runs on host rather than in docker image
42-
npx broken-link-checker http://localhost:8055 --ordered --recursive --host-requests 10 -e --filter-level 3
47+
builder_echo blue "---- Testing links"
48+
npx broken-link-checker http://localhost:8055 --recursive --ordered ---host-requests 50 -e --filter-level 3 | tee blc.log
49+
local BLC_RESULT=${PIPESTATUS[0]}
50+
echo ----------------------------------------------------------------------
51+
echo Link check summary
52+
echo ----------------------------------------------------------------------
53+
cat blc.log | \
54+
grep -E "BROKEN|Getting links from" | \
55+
grep -B 1 "BROKEN";
56+
57+
builder_echo blue "Done checking links"
58+
rm tier.txt
59+
return "${BLC_RESULT}"
4360
}
4461

4562
builder_run_action configure bootstrap_configure
4663
builder_run_action clean clean_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME
4764
builder_run_action stop stop_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME
48-
builder_run_action build build_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME
65+
builder_run_action build build_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $BUILDER_CONFIGURATION
4966
builder_run_action start start_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $HELP_CONTAINER_DESC $HOST_HELP_KEYMAN_COM $PORT_HELP_KEYMAN_COM $BUILDER_CONFIGURATION
5067

5168
builder_run_action test test_docker_container
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Keyman for Android APIs
3+
---
4+
5+
## Summary
6+
7+
The **`Keyman for Android`** app has the following APIs for integration:
8+
9+
10+
## Description
11+
12+
The Keyman for Android app installs as an Input Method Extension. When selected as the active system keyboard, it provides the following APIs:
13+
14+
15+
## Intents
16+
17+
When the Keyman system keyboard changes the associated font name, the following Intent is broadcast so the integrating application can match the font:
18+
19+
```java
20+
intent = new Intent("com.tavultesoft.kmapro.keyboard_changed");
21+
intent.putExtra("fontName", fontName);
22+
sendBroadcast(intent);
23+
```

developer/engine/android/19.0/KMManager/applyKeyboardHeight.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ KMManager.applyKeyboardHeight(Context context, int height, int orientation)
2323
: The context
2424

2525
`height`
26-
: The height of the keyboard frame in *density-independent pixels (dp)*. Pass `KMManager.KeyboardHeight_Reset` to reset the keyboard height (for current orientation) to device-specific defaults.
26+
: The height of the keyboard frame in *density-independent pixels (dp)*. Pass `KMManager.KeyboardHeight_Reset` to reset the keyboard height (for the current orientation) to device-specific defaults.
2727

2828
`orientation` _(Optional)_
2929
: Accepts a [screen orientation](https://developer.android.com/training/multiscreen/screensizes#TaskUseOriQuali) value. This is most useful if you want to change the size of the keyboard in the other (non-current) orientation. If `orientation` is not defined, keyboard height is set for the current device orientation.
@@ -78,3 +78,5 @@ The following script illustrates the use of `applyKeyboardHeight()` to reset key
7878

7979
## See also
8080
* [getKeyboardHeight()](getKeyboardHeight)
81+
* [getKeyboardHeightMax()](getKeyboardHeightMax)
82+
* [getKeyboardHeightMin()](getKeyboardHeightMin)

developer/engine/android/19.0/KMManager/getKeyboardHeight.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ or
5555
## See also
5656

5757
- [applyKeyboardHeight()](applyKeyboardHeight)
58+
- [getKeyboardHeightMax](getKeyboardHeightMax)
59+
- [getKeyboardHeightMin](getKeyboardHeightMin)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: KMManager.getKeyboardHeightMax()
3+
---
4+
5+
## Summary
6+
7+
The **`getKeyboardHeightMax()`** method returns the maximum allowed height of the keyboard frame for this context.
8+
9+
## Syntax
10+
11+
``` javascript
12+
KMManager.getKeyboardHeightMax(Context context)
13+
```
14+
or
15+
``` javascript
16+
KMManager.getKeyboardHeightMax(Context context, int orientation)
17+
```
18+
19+
### Parameters
20+
21+
`context`
22+
: The context.
23+
24+
`orientation` _(Optional)_
25+
: Accepts a [screen orientation](https://developer.android.com/training/multiscreen/screensizes#TaskUseOriQuali) value. This is most useful if you want to get the size of the keyboard in the other (non-current) orientation. If `orientation` is not defined, maximum keyboard height is returned for the current device orientation.
26+
27+
### Returns
28+
29+
Returns the maximum allowed height of the keyboard frame in *density-independent pixels
30+
(dp)*.
31+
32+
## Description
33+
34+
Use this method to get the maximum allowed height of the keyboard frame.
35+
36+
## Examples
37+
38+
### Example: Using `getKeyboardHeightMax()`
39+
40+
The following script illustrate the use of `getKeyboardHeightMax()`:
41+
42+
``` javascript
43+
int maxKeyboardHeight = KMManager.getKeyboardHeightMax(this);
44+
```
45+
or
46+
```java
47+
import android.content.res.Configuration;
48+
...
49+
// Get the maximum allowed Keyman keyboard height for landscape mode.
50+
int maxKeyboardHeightLandscape = KMManager.getKeyboardHeightMax(this, Configuration.ORIENTATION_LANDSCAPE);
51+
```
52+
53+
## See also
54+
55+
- [applyKeyboardHeight()](applyKeyboardHeight)
56+
- [getKeyboardHeight()](getKeyboardHeight)
57+
- [getKeyboardHeightMin()](getKeyboardHeightMin)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: KMManager.getKeyboardHeightMin()
3+
---
4+
5+
## Summary
6+
7+
The **`getKeyboardHeightMin()`** method returns the minimum allowed height of the keyboard frame for this context.
8+
9+
## Syntax
10+
11+
``` javascript
12+
KMManager.getKeyboardHeightMin(Context context)
13+
```
14+
or
15+
``` javascript
16+
KMManager.getKeyboardHeightMin(Context context, int orientation)
17+
```
18+
19+
### Parameters
20+
21+
`context`
22+
: The context.
23+
24+
`orientation` _(Optional)_
25+
: Accepts a [screen orientation](https://developer.android.com/training/multiscreen/screensizes#TaskUseOriQuali) value. This is most useful if you want to get the size of the keyboard in the other (non-current) orientation. If `orientation` is not defined, minimum keyboard height is returned for the current device orientation.
26+
27+
### Returns
28+
29+
Returns the minimum allowed height of the keyboard frame in *density-independent pixels
30+
(dp)*.
31+
32+
## Description
33+
34+
Use this method to get the minimum allowed height of the keyboard frame.
35+
36+
## Examples
37+
38+
### Example: Using `getKeyboardHeightMin()`
39+
40+
The following script illustrate the use of `getKeyboardHeightMin()`:
41+
42+
``` javascript
43+
int minKeyboardHeight = KMManager.getKeyboardHeightMin(this);
44+
```
45+
or
46+
```java
47+
import android.content.res.Configuration;
48+
...
49+
// Get the minimum allowed Keyman keyboard height for landscape mode.
50+
int minKeyboardHeightLandscape = KMManager.getKeyboardHeightMin(this, Configuration.ORIENTATION_LANDSCAPE);
51+
```
52+
53+
## See also
54+
55+
- [applyKeyboardHeight()](applyKeyboardHeight)
56+
- [getKeyboardHeight()](getKeyboardHeight)
57+
- [getKeyboardHeightMax()](getKeyboardHeightMax)

0 commit comments

Comments
 (0)