Skip to content

Commit 9e25f97

Browse files
committed
widgets: Install into correctly-named directory.
Ensures that the directory that widgets are installed into matches their actual module name.
1 parent e69ed6c commit 9e25f97

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
version: 8.0.0-dp-3
3-
---
41
# Packaged extension name changes
52

63
Earlier versions of the widgets and libraries which are bundled with
@@ -10,5 +7,8 @@ Now all LiveCode extensions are named either
107
**com.livecode.widget.<widget name>** or
118
**com.livecode.library.<library name>**.
129

10+
Their directories in the installed LiveCode bundle have also been updated to
11+
match.
12+
1313
**Note:** This change will break some stacks that have widgets saved
1414
on them, or scripts which refer to a widget by its kind.

tests/_testlib.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ end TestGetIDERepositoryPath
152152
on TestLoadExtension pName
153153
set the itemdelimiter to "."
154154
local tExtensionUnzipFolder
155-
put "com.livecode.extensions.livecode." & toLower(item -1 of pName) into tExtensionUnzipFolder
155+
put pName into tExtensionUnzipFolder
156156

157157
local tPath, tRepoPath
158158
put specialfolderpath("engine") into tPath

util/build-extensions.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44

55
set -e
66

7+
function extract_name {
8+
# Extract an e.g. "module foo.bar.baz" line from an LCB source file
9+
sed -nEe 's/^([[:space:]]*(module|widget|library)[[:space:]]*)([-_\.[:alnum:]]*)[[:space:]]*$/\3/p' < "$1"
10+
}
11+
712
function build_widget {
813
WIDGET_DIR=$1
914
WIDGET_NAME=$(basename $1)
10-
TARGET_DIR="com.livecode.extensions.livecode.${WIDGET_NAME}"
15+
WIDGET_LCB="${WIDGET_DIR}/${WIDGET_NAME}.lcb"
16+
TARGET_DIR=$(extract_name "${WIDGET_LCB}")
1117
BUILD_DIR=$2
1218
MODULE_DIR=$3
1319
LC_COMPILE=$4
@@ -17,8 +23,8 @@ function build_widget {
1723
--modulepath "${MODULE_DIR}" \
1824
--manifest "${WIDGET_DIR}/manifest.xml" \
1925
--output "${WIDGET_DIR}/module.lcm" \
20-
"${WIDGET_DIR}/${WIDGET_NAME}.lcb"
21-
26+
"${WIDGET_LCB}"
27+
2228
pushd "${WIDGET_DIR}" 1>/dev/null
2329
zip -q -r "${TARGET_DIR}.lce" *
2430
popd 1>/dev/null

0 commit comments

Comments
 (0)