Merge pull request #1401 from starkos/fix-pr-1013

Remove commands optimization which breaks tokens
This commit is contained in:
Samuel Surtees 2020-02-14 16:58:49 +10:00 committed by GitHub
commit 789c0ac343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 17 deletions

View File

@ -1099,7 +1099,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nls src\ncp \"a\" \"b\"";
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\nls src\ncp \"a\" \"b\"\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\nls src\ncp \"a\" \"b\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]
@ -1158,7 +1158,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nls src\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\ncp a b\nfi";
shellScript = "set -e\nif [ \"${CONFIGURATION}\" = \"Debug\" ]; then\nls src\ncp a b\nfi\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\nls src\nfi";
};
/* End PBXShellScriptBuildPhase section */
]]

View File

@ -743,16 +743,7 @@
for _, node in ipairs(tr.products.children) do
local name = tr.project.name
-- This function checks whether there are build commands of a specific
-- type to be executed; they will be generated correctly, but the project
-- commands will not contain any per-configuration commands, so the logic
-- has to be extended a bit to account for that.
local function hasBuildCommands(which)
-- standard check...this is what existed before
if #tr.project[which] > 0 then
return true
end
-- what if there are no project-level commands? check configs...
for _, cfg in ipairs(tr.configs) do
if #cfg[which] > 0 then
return true
@ -933,16 +924,13 @@
local wrapperWritten = false
local function doblock(id, name, which)
-- start with the project-level commands (most common)
local prjcmds = tr.project[which]
local commands = table.join(prjcmds, {})
-- see if there are any config-specific commands to add
local commands = {}
for _, cfg in ipairs(tr.configs) do
local cfgcmds = cfg[which]
if #cfgcmds > #prjcmds then
if #cfgcmds > 0 then
table.insert(commands, 'if [ "${CONFIGURATION}" = "' .. cfg.buildcfg .. '" ]; then')
for i = #prjcmds + 1, #cfgcmds do
for i = 1, #cfgcmds do
table.insert(commands, cfgcmds[i])
end
table.insert(commands, 'fi')