Skip to content

Commit 706684b

Browse files
[[ Gyp ]] Build the IDE library and widget extensions
1 parent 1972cb2 commit 706684b

2 files changed

Lines changed: 142 additions & 0 deletions

File tree

extensions/extensions.gyp

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
'includes':
3+
[
4+
'../common.gypi',
5+
],
6+
7+
'targets':
8+
[
9+
{
10+
'target_name': 'extensions',
11+
'type': 'none',
12+
13+
'dependencies':
14+
[
15+
'../toolchain/lc-compile/lc-compile.gyp:lc-compile',
16+
'../engine/lcb-modules.gyp:engine_lcb_modules',
17+
],
18+
19+
'sources':
20+
[
21+
'libraries/canvas/canvas.lcb',
22+
'libraries/iconsvg/iconsvg.lcb',
23+
24+
'widgets/button/button.lcb',
25+
#'widgets/button-popup/button-popup.lcb',
26+
'widgets/chart/chart.lcb',
27+
'widgets/checkbox/checkbox.lcb',
28+
'widgets/clock/clock.lcb',
29+
'widgets/graph/graph.lcb',
30+
'widgets/header/header.lcb',
31+
'widgets/iconpicker/iconpicker.lcb',
32+
'widgets/list/list.lcb',
33+
'widgets/multilist/multilist.lcb',
34+
'widgets/navbar/navbar.lcb',
35+
'widgets/paletteactions/paletteactions.lcb',
36+
'widgets/pinkcircle/pinkcircle.lcb',
37+
'widgets/progressbar/progressbar.lcb',
38+
'widgets/radiobutton/radiobutton.lcb',
39+
'widgets/segmented/segmented.lcb',
40+
#'widgets/segmented-popup/segmented-popup.lcb',
41+
'widgets/selector/selector.lcb',
42+
#'widgets/svgicon/svgicon.lcb',
43+
'widgets/svgpath/svgpath.lcb',
44+
'widgets/switchbutton/switchbutton.lcb',
45+
'widgets/treeview/treeview.lcb',
46+
],
47+
48+
'all_dependent_settings':
49+
{
50+
'variables':
51+
{
52+
'dist_aux_files':
53+
[
54+
'<(PRODUCT_DIR)/packaged_extensions',
55+
],
56+
},
57+
},
58+
59+
'rules':
60+
[
61+
{
62+
'rule_name': 'build_extension',
63+
'extension': 'lcb',
64+
65+
'inputs':
66+
[
67+
'../util/build-widget.sh',
68+
],
69+
70+
'outputs':
71+
[
72+
'<(PRODUCT_DIR)/packaged_extensions/com.livecode.extensions.livecode.<(RULE_INPUT_ROOT)/module.lcb',
73+
],
74+
75+
'message': 'Building extension <(RULE_INPUT_ROOT)',
76+
77+
'conditions':
78+
[
79+
[
80+
'OS == "win"',
81+
{
82+
'variables':
83+
{
84+
'build_command': [ '$(ProjectDir)../../../util/invoke-unix.bat', '$(ProjectDir)../../../util/build-widget.sh' ],
85+
},
86+
},
87+
{
88+
'variables':
89+
{
90+
'build_command': [ '../util/build-widget.sh' ],
91+
},
92+
},
93+
],
94+
],
95+
96+
'action':
97+
[
98+
'<@(build_command)',
99+
'<(RULE_INPUT_DIRNAME)',
100+
'<(PRODUCT_DIR)',
101+
'<(PRODUCT_DIR)/modules/lci',
102+
'>(lc-compile_host)',
103+
],
104+
},
105+
],
106+
},
107+
],
108+
}

util/build-widget.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
function build_widget {
6+
WIDGET_DIR=$1
7+
WIDGET_NAME=$(basename $1)
8+
TARGET_DIR="com.livecode.extensions.livecode.${WIDGET_NAME}"
9+
BUILD_DIR=$2
10+
MODULE_DIR=$3
11+
LC_COMPILE=$4
12+
13+
"${LC_COMPILE}" \
14+
--modulepath "${MODULE_DIR}" \
15+
--manifest "${WIDGET_DIR}/manifest.xml" \
16+
--output "${WIDGET_DIR}/module.lcm" \
17+
"${WIDGET_DIR}/${WIDGET_NAME}.lcb"
18+
19+
pushd "${WIDGET_DIR}" 1>/dev/null
20+
zip -q -r "${TARGET_DIR}.lce" *
21+
popd 1>/dev/null
22+
23+
mkdir -p "${BUILD_DIR}/packaged_extensions/${TARGET_DIR}"
24+
25+
unzip -q \
26+
-o "${WIDGET_DIR}/${TARGET_DIR}.lce" \
27+
-d "${BUILD_DIR}/packaged_extensions/${TARGET_DIR}"
28+
29+
rm "${WIDGET_DIR}/${TARGET_DIR}.lce"
30+
31+
return 0
32+
}
33+
34+
build_widget $@

0 commit comments

Comments
 (0)