Skip to content

Commit 70dfbce

Browse files
authored
Merge pull request #9571 from keymanapp/feat/developer/remove-kmcmpdll
feat(developer): remove kmcomp, kmcmpdll 🎺
2 parents d2856a3 + fafedbb commit 70dfbce

File tree

125 files changed

+225
-14871
lines changed

Some content is hidden

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

125 files changed

+225
-14871
lines changed

.github/labeler.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ developer/:
3535
- developer/**
3636

3737
developer/compilers/:
38-
- developer/src/kmcomp/**
39-
- developer/src/kmcmpdll/**
4038
- developer/src/kmc/**
39+
- developer/src/kmcmplib/**
4140
- developer/src/kmc-*/**
4241

4342
developer/ide/:

.github/multi-labeler.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,3 @@ labels:
8787
- label: 'windows/'
8888
matcher:
8989
title: '\(.*windows.*\):'
90-
91-
#
92-
# epics -- we will add/remove these as we work on new epics each release
93-
#
94-
95-
- label: 'epic-ldml'
96-
matcher:
97-
branch: '.*epic-ldml.*' # anywhere in the branch name, e.g. feat/epic-ldml/developer/... or feat/developer/foo-epic-ldml
98-
99-
- label: 'epic-kmcompx'
100-
matcher:
101-
branch: '.*epic-kmcompx.*'

.gitignore

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373

7474
# /developer/TIKE/
7575
/windows/src/developer/TIKE/stock.kct
76-
/windows/src/developer/TIKE/kmcmpdll.dll
7776

7877
# /developer/TIKE/redist/
7978
/windows/src/developer/TIKE/redist/Addins
@@ -85,12 +84,6 @@
8584
/windows/src/developer/inst/download.mak
8685
/windows/src/developer/inst/copydev.mak
8786

88-
# /developer/kmcmpdll/
89-
/windows/src/developer/kmcmpdll/*.lastbuildstate
90-
91-
# /developer/kmcmpdll/Debug/
92-
/windows/src/developer/kmcmpdll/Debug/*.idb
93-
9487
/windows/src/developer/stock/stock.kct
9588
/windows/src/developer/uitemplates/keyman.kct
9689

@@ -192,9 +185,3 @@ lcov.info
192185
/keyman*.changes
193186
/keyman*.tar.?z
194187

195-
#Sabine:
196-
# /common/test/keyboards/invalid/source/*.kmx
197-
# /developer/src/test/auto/kmcomp/*.kmn
198-
# /developer/src/test/auto/kmcomp/*.kvk
199-
# /developer/src/test/auto/kmcomp/*.kvk*
200-
# /developer/src/test/auto/kmcomp/*.txt

common/test/keyboards/build.sh

Lines changed: 59 additions & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -1,225 +1,43 @@
11
#!/usr/bin/env bash
2-
3-
set -e
4-
set -u
5-
62
## START STANDARD BUILD SCRIPT INCLUDE
73
# adjust relative paths as necessary
84
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
95
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
10-
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
116
## END STANDARD BUILD SCRIPT INCLUDE
12-
THIS_DIR="$(dirname "$THIS_SCRIPT")"
13-
14-
display_usage() {
15-
echo "usage: build.sh [build options] [targets]"
16-
echo
17-
echo "Build options:"
18-
echo " --clean, -c Clean instead of build"
19-
echo " --debug, -d Debug build"
20-
echo " --silent, -s Suppress information messages"
21-
echo " --keyboard, -k Build only keyboards (not packages)"
22-
echo " --kmcomp path Specify path to kmcomp.exe, defaults"
23-
echo " to windows/bin/developer/kmcomp.exe"
24-
echo " --zip-source Create zip file for source of each"
25-
echo " keyboard for artifact tests"
26-
echo " --index Build index.html for artifact tests"
27-
echo
28-
echo "Targets (all unless specified):"
29-
30-
for d in "$THIS_DIR/"*/; do
31-
d="$(basename "$d")"
32-
if [ "$d" != "invalid" ]; then
33-
echo " $d"
34-
fi
35-
done
367

37-
echo
38-
exit 0
39-
}
8+
cd "$THIS_SCRIPT_PATH"
409

41-
QUIET=false
42-
DEBUG=false
43-
CLEAN=false
44-
KEYBOARDS_ONLY=false
45-
CUSTOM_KMCOMP=
46-
INDEX=false
47-
ZIPSOURCE=false
48-
KMCOMP="$KEYMAN_ROOT/developer/bin/kmcomp.exe"
49-
TARGETS=()
50-
51-
# Parse args
52-
shopt -s nocasematch
53-
54-
while [[ $# -gt 0 ]] ; do
55-
key="$1"
56-
case $key in
57-
--help|-h|-\?)
58-
display_usage
59-
;;
60-
--clean|-c)
61-
CLEAN=true
62-
;;
63-
--debug|-d)
64-
DEBUG=true
65-
;;
66-
--silent|-s)
67-
QUIET=true
68-
;;
69-
--keyboard|-k)
70-
KEYBOARDS_ONLY=true
71-
;;
72-
--zip-source)
73-
ZIPSOURCE=true
74-
;;
75-
--index)
76-
INDEX=true
77-
;;
78-
--kmcomp)
79-
shift
80-
KMCOMP="$1"
81-
CUSTOM_KMCOMP=true
82-
;;
83-
*)
84-
TARGETS+=("$key")
85-
esac
86-
shift
10+
targets=()
11+
# Build list of available targets from subfolders, if none specified
12+
for d in */; do
13+
d="$(basename "$d")"
14+
if [ "$d" != "invalid" ] && [ "$d" != "issue" ]; then
15+
targets+=(":$d")
16+
fi
8717
done
8818

89-
# TODO: while this is intended to be cross platform, we
90-
# don't currently have a binary version of kmcomp available
91-
# during Linux and macOS builds, so that will need to be
92-
# manually sourced.
93-
KMCOMP_LAUNCHER=
94-
95-
if ! $CUSTOM_KMCOMP; then
96-
case "${OSTYPE}" in
97-
"cygwin")
98-
;;
99-
"msys")
100-
;;
101-
"darwin"*)
102-
# For Catalina (10.15) onwards, must use wine64
103-
base_macos_ver=10.15
104-
macos_ver=$(sw_vers -productVersion)
105-
if verlt "$macos_ver" "$base_macos_ver"; then
106-
KMCOMP_LAUNCHER=wine
107-
else
108-
# On Catalina, and later versions:
109-
# wine-4.12.1 works; wine-5.0, wine-5.7 do not.
110-
# retrieve these from:
111-
# `brew tap gcenx/wine && brew install --cask --no-quarantine wine-crossover`
112-
# may also need to `sudo spctl --master-disable`
113-
KMCOMP_LAUNCHER=wine64
114-
KMCOMP="$(dirname $KMCOMP)/kmcomp.x64.exe"
115-
fi
116-
;;
117-
*)
118-
KMCOMP_LAUNCHER=wine
119-
;;
120-
esac
121-
fi
19+
KMC="$KEYMAN_ROOT/developer/src/kmc/build/src/kmc.js"
12220

123-
# Build list of available targets from subfolders, if none specified
124-
if [ ${#TARGETS[@]} == 0 ]; then
125-
for d in "$THIS_DIR/"*/; do
126-
d="$(basename "$d")"
127-
if [ "$d" != "invalid" ] && [ "$d" != "issue" ]; then
128-
TARGETS+=("$d")
129-
fi
130-
done
131-
fi
132-
133-
if ! $QUIET; then
134-
displayInfo "" \
135-
"CLEAN: $CLEAN" \
136-
"DEBUG: $DEBUG" \
137-
"QUIET: $QUIET" \
138-
"KEYBOARDS_ONLY: $KEYBOARDS_ONLY" \
139-
"TARGETS: ${TARGETS[@]}" \
140-
"ZIPSOURCE: $ZIPSOURCE" \
141-
"INDEX: $INDEX" \
142-
""
143-
fi
144-
145-
clean() {
146-
local kpj="$1.kpj" ss= s=
147-
if $QUIET; then
148-
ss=-ss
149-
s=-s
150-
fi
151-
pushd "$1" > /dev/null
152-
if [ -f build.sh ]; then
153-
./build.sh -c $s
154-
else
155-
$KMCOMP_LAUNCHER "$KMCOMP" -c $ss "$kpj"
156-
fi
157-
popd > /dev/null
158-
}
21+
builder_describe "Test Keyboards" \
22+
clean configure build \
23+
${targets[@]} \
24+
"--index Build index.html for artifact tests" \
25+
"--zip-source Create zip file for source of each keyboard for artifact tests" \
26+
"--kmc=KMC Specify path to kmc, defaults to developer/src/kmc/build/" \
27+
"--silent,-s Suppress information messages"
15928

160-
build() {
161-
local kpj="$1.kpj" d= t= ss= target= s= k=
162-
if $KEYBOARDS_ONLY; then
163-
k=-k
164-
t=-t
165-
target="$1.kmn"
166-
fi
167-
if $DEBUG; then
168-
d=-d
169-
fi
170-
if $QUIET; then
171-
s=-s
172-
ss=-ss
173-
fi
174-
# -w - treat warnings as errors, we'll force this
175-
# -cfc - check filename conventions
176-
pushd "$1" > /dev/null
177-
if [ -f build.sh ]; then
178-
./build.sh $d $k $s
179-
else
180-
$KMCOMP_LAUNCHER "$KMCOMP" $d $ss -w -cfc "$kpj" $t "$target"
181-
fi
182-
popd > /dev/null
183-
}
29+
builder_parse "$@"
18430

185-
zipsource() {
31+
function zipsource() {
18632
local target="$1"
18733
pushd "$1" > /dev/null
18834
7z a -r -x!build -x"!$target.kpj.user" "${target}_source.zip" .
18935
popd > /dev/null
19036
}
19137

192-
###
193-
194-
for TARGET in "${TARGETS[@]}"; do
195-
if $CLEAN; then
196-
if ! $QUIET; then
197-
echo
198-
builder_heading "Cleaning target $TARGET"
199-
echo
200-
fi
201-
clean "$TARGET"
202-
else
203-
if ! $QUIET; then
204-
echo
205-
builder_heading "Building target $TARGET"
206-
echo
207-
fi
208-
build "$TARGET"
209-
210-
if $ZIPSOURCE; then
211-
zipsource "$TARGET"
212-
fi
213-
fi
214-
done
215-
216-
###
217-
218-
if $INDEX; then
219-
if $CLEAN; then
220-
rm -f "$THIS_DIR/index.html"
221-
else
222-
cat << EOF > "$THIS_DIR/index.html"
38+
function build_index() {
39+
local active_targets=($*)
40+
cat << EOF > index.html
22341
<!DOCTYPE html>
22442
<html>
22543
<head>
@@ -231,19 +49,47 @@ if $INDEX; then
23149
<ul>
23250
EOF
23351

234-
for TARGET in "${TARGETS[@]}"; do
235-
if $ZIPSOURCE; then
236-
echo " <li><a href='$TARGET/build/$TARGET.kmp'>$TARGET.kmp</a> (<a href='$TARGET/${TARGET}_source.zip'>source</a>)</li>" >> "$THIS_DIR/index.html"
237-
else
238-
echo " <li><a href='$TARGET/build/$TARGET.kmp'>$TARGET.kmp</a></li>" >> "$THIS_DIR/index.html"
239-
fi
240-
done
52+
for TARGET in "${active_targets[@]}"; do
53+
if builder_has_option --zip-source; then
54+
echo " <li><a href='$TARGET/build/$TARGET.kmp'>$TARGET.kmp</a> (<a href='$TARGET/${TARGET}_source.zip'>source</a>)</li>" >> index.html
55+
else
56+
echo " <li><a href='$TARGET/build/$TARGET.kmp'>$TARGET.kmp</a></li>" >> index.html
57+
fi
58+
done
24159

242-
cat << 'EOF' >> "$THIS_DIR/index.html"
60+
cat << EOF >> index.html
24361
</ul>
24462
</body>
24563
</html>
24664
EOF
65+
}
66+
67+
###
68+
69+
function build() {
70+
local active_targets=()
71+
for TARGET in "${targets[@]}"; do
72+
if builder_has_action build$TARGET; then
73+
active_targets+=(${TARGET#:})
74+
fi
75+
done
76+
77+
local ss=
78+
if builder_has_option --silent; then
79+
ss="--log-level silent"
24780
fi
248-
fi
249-
exit 0
81+
82+
node "$KMC" build $builder_debug $ss -w "${active_targets[@]}"
83+
84+
if builder_has_option --zip-source; then
85+
for TARGET in "${active_targets[@]}"; do
86+
zipsource "$TARGET"
87+
done
88+
fi
89+
90+
if builder_has_option --index; then
91+
build_index "${active_targets[@]}"
92+
fi
93+
}
94+
95+
builder_run_action build build

core/doc/BUILDING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ See [build configuration](../../docs/build/index.md) for details on how to confi
88
On all platforms, use `build.sh`.
99

1010
* See `./build.sh --help` for more details
11-
12-
## Note on kmcomp
13-
14-
kmcomp is the command-line compiler from Keyman Developer, available from
15-
<https://keyman.com/developer/download> or in this repo in
16-
`/windows/src/developer/kmcomp`. The compiler is currently available as a
17-
Windows PE executable only, but it does run under WINE.

0 commit comments

Comments
 (0)