Skip to content

Commit

Permalink
iOS/tvOS: reducing On Demand Resources script to allow more ODRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchvova committed Apr 21, 2022
1 parent 9d1c093 commit 110f9ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
17 changes: 6 additions & 11 deletions platform/resources/iPhonePackageApp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -646,22 +646,17 @@ local function generateOdrFileStructureScript(bundleDir, destDir, odr, appBundle
mkdir -p "$DST_DIR"
]==]

-- BNDL_DIR=BD BNDL_REL_SRC=BR BUNDLE_SUBFOLDER=BS
for i = 1,#odr do
local tag, resource = odr[i].tag, odr[i].resource
if type(tag)=="string" and type(resource)=="string" then
local tagBundle = appBundleId .. "." .. tag
script = script .. 'BNDL_DIR="$DST_DIR/' .. tagBundle .. '.assetpack"\n'
script = script .. 'BNDL_REL_SRC="' .. resource .. '"\n'
script = script .. 'BD="$DST_DIR/' .. tagBundle .. '.assetpack"\n'
script = script .. 'BR="' .. resource .. '"\n'
script = script .. [==[
/bin/mkdir -p "$BNDL_DIR"
pushd "$SRC_DIR" > /dev/null
BUNDLE_SUBFOLDER="$(dirname "$BNDL_REL_SRC")"
popd > /dev/null
if [ "$BUNDLE_SUBFOLDER" != "." ]
then
/bin/mkdir -p "$BNDL_DIR/$BUNDLE_SUBFOLDER"
fi
/bin/mv "$SRC_DIR"/"$BNDL_REL_SRC" "$BNDL_DIR/$BUNDLE_SUBFOLDER/"
BS="$(dirname "$BR")"
/bin/mkdir -p "$BD/$BS"
/bin/mv "$SRC_DIR"/"$BR" "$BD/$BS/"
]==]
else
err = "ERROR: invalid On-Demand Resources Entry: " .. json.encode(odr[i]) .. "; 'onDemandResources' should be array of tables with tag and resource fields."
Expand Down
20 changes: 7 additions & 13 deletions platform/resources/tvosPackageApp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1043,24 +1043,18 @@ local function generateOdrFileStructureScript(bundleDir, destDir, odr, appBundle
mkdir -p "$DST_DIR"
]==]


-- BNDL_DIR=BD BNDL_REL_SRC=BR BUNDLE_SUBFOLDER=BS
for i = 1,#odr do
local tag, resource = odr[i].tag, odr[i].resource
if type(tag)=="string" and type(resource)=="string" then
local tagBundle = appBundleId .. "." .. tag
script = script .. 'BNDL_DIR="$DST_DIR/' .. tagBundle .. '.assetpack"\n'
script = script .. 'BNDL_REL_SRC="' .. resource .. '"\n'
script = script .. 'BD="$DST_DIR/' .. tagBundle .. '.assetpack"\n'
script = script .. 'BR="' .. resource .. '"\n'
script = script .. [==[
/bin/mkdir -p "$BNDL_DIR"
pushd "$SRC_DIR" > /dev/null
BUNDLE_SUBFOLDER="$(dirname "$BNDL_REL_SRC")"
popd > /dev/null
if [ "$BUNDLE_SUBFOLDER" != "." ]
then
/bin/mkdir -p "$BNDL_DIR/$BUNDLE_SUBFOLDER"
fi
/bin/mv "$SRC_DIR"/"$BNDL_REL_SRC" "$BNDL_DIR/$BUNDLE_SUBFOLDER/"
BS="$(dirname "$BR")"
/bin/mkdir -p "$BD/$BS"
/bin/mv "$SRC_DIR"/"$BR" "$BD/$BS/"
]==]
else
err = "ERROR: invalid On-Demand Resources Entry: " .. json.encode(odr[i]) .. "; 'onDemandResources' should be array of tables with tag and resource fields."
Expand Down

0 comments on commit 110f9ca

Please sign in to comment.