Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions extensions/extensions.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@
},
},

'rules':
'actions':
[
{
'rule_name': 'build_extension',
'extension': 'lcb',
'action_name': 'build_extensions',

'inputs':
[
'../util/build-widget.sh',
'../util/build-extensions.sh',
'<@(_sources)',
],

'outputs':
[
'<(PRODUCT_DIR)/packaged_extensions/com.livecode.extensions.livecode.<(RULE_INPUT_ROOT)/module.lcb',
'<(PRODUCT_DIR)/packaged_extensions',
],

'message': 'Building extension <(RULE_INPUT_ROOT)',
'message': 'Building extensions',

'conditions':
[
Expand All @@ -81,13 +81,13 @@
{
'variables':
{
'build_command': [ '$(ProjectDir)../../../util/invoke-unix.bat', '$(ProjectDir)../../../util/build-widget.sh' ],
'build_command': [ '$(ProjectDir)../../../util/invoke-unix.bat', '$(ProjectDir)../../../util/build-extensions.sh' ],
},
},
{
'variables':
{
'build_command': [ '../util/build-widget.sh' ],
'build_command': [ '../util/build-extensions.sh' ],
},
},
],
Expand All @@ -96,10 +96,10 @@
'action':
[
'<@(build_command)',
'<(RULE_INPUT_DIRNAME)',
'<(PRODUCT_DIR)',
'<(PRODUCT_DIR)/packaged_extensions',
'<(PRODUCT_DIR)/modules/lci',
'>(lc-compile_host)',
'<@(_sources)',
],
},
],
Expand Down
52 changes: 52 additions & 0 deletions util/build-extensions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Utility script called by the build system to compile extensions

set -e

function build_widget {
WIDGET_DIR=$1
WIDGET_NAME=$(basename $1)
TARGET_DIR="com.livecode.extensions.livecode.${WIDGET_NAME}"
BUILD_DIR=$2
MODULE_DIR=$3
LC_COMPILE=$4

"${LC_COMPILE}" \
--modulepath "${MODULE_DIR}" \
--manifest "${WIDGET_DIR}/manifest.xml" \
--output "${WIDGET_DIR}/module.lcm" \
"${WIDGET_DIR}/${WIDGET_NAME}.lcb"

pushd "${WIDGET_DIR}" 1>/dev/null
zip -q -r "${TARGET_DIR}.lce" *
popd 1>/dev/null

mkdir -p "${BUILD_DIR}/${TARGET_DIR}"

unzip -q \
-o "${WIDGET_DIR}/${TARGET_DIR}.lce" \
-d "${BUILD_DIR}/${TARGET_DIR}"

rm "${WIDGET_DIR}/${TARGET_DIR}.lce"

return 0
}

# Arguments 4 and above are the list of extensions to compile
destination_dir=$1
module_dir=$2
lc_compile=$3
shift 3

# Find the dependency/build ordering of the extensions
build_order=$(${lc_compile} --modulepath ${module_dir} --deps changed-order -- $@)

# Loop over the extensions that need to be (re-)built
for ext in ${build_order} ; do
# Create the output directory
mkdir -p "${destination_dir}"/com.livecode.extensions.livecode.$(basename -s .lcb "${ext}")

# Build this extension
build_widget $(dirname "${ext}") "${destination_dir}" "${module_dir}" "${lc_compile}"
done
36 changes: 0 additions & 36 deletions util/build-widget.sh

This file was deleted.