Ported PBXSourcesBuildPhase

This commit is contained in:
starkos 2009-11-09 20:42:50 +00:00
parent bd65dcc2c9
commit 382aed3e93
5 changed files with 63 additions and 63 deletions

View File

@ -308,6 +308,29 @@
end
function xcode.PBXSourcesBuildPhase(tr)
_p('/* Begin PBXSourcesBuildPhase section */')
for _, target in ipairs(tr.products.children) do
_p(2,'%s /* Sources */ = {', target.sourcesid)
_p(3,'isa = PBXSourcesBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
tree.traverse(tr, {
onleaf = function(node)
if xcode.getbuildcategory(node) == "Sources" then
_p(4,'%s /* %s in Sources */,', node.buildid, node.name)
end
end
})
_p(3,');')
_p(3,'runOnlyForDeploymentPostprocessing = 0;')
_p(2,'};')
end
_p('/* End PBXSourcesBuildPhase section */')
_p('')
end
function xcode.Footer()
_p(1,'};')
_p('\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')

View File

@ -206,29 +206,6 @@
function xcode.PBXSourcesBuildPhase(tr)
_p('/* Begin PBXSourcesBuildPhase section */')
for _, target in ipairs(tr.products.children) do
_p(2,'%s /* Sources */ = {', target.sourcesid)
_p(3,'isa = PBXSourcesBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
tree.traverse(target.prjnode, {
onleaf = function(node)
if xcode.getbuildcategory(node) == "Sources" then
_p(4,'%s /* %s in Sources */,', node.buildid, node.name)
end
end
})
_p(3,');')
_p(3,'runOnlyForDeploymentPostprocessing = 0;')
_p(2,'};')
end
_p('/* End PBXSourcesBuildPhase section */')
_p('')
end
function xcode.PBXVariantGroup(tr)
_p('/* Begin PBXVariantGroup section */')
tree.traverse(tr, {

View File

@ -123,5 +123,6 @@
xcode.PBXNativeTarget(tr)
xcode.PBXProject(tr)
xcode.PBXResourcesBuildPhase(tr)
xcode.PBXSourcesBuildPhase(tr)
xcode.Footer(tr)
end

View File

@ -27,46 +27,6 @@
end
---------------------------------------------------------------------------
-- PBXSourcesBuildPhase tests
---------------------------------------------------------------------------
function T.xcode3.PBXSourcesBuildPhase_OnNoSources()
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
[MyProject:src] /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end
function T.xcode3.PBXSourcesBuildPhase_OnSources()
files { "hello.cpp", "goodbye.cpp" }
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
[MyProject:src] /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
[hello.cpp:build] /* hello.cpp in Sources */,
[goodbye.cpp:build] /* goodbye.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end
---------------------------------------------------------------------------
-- PBXVariantGroup tests

View File

@ -474,3 +474,42 @@
end
---------------------------------------------------------------------------
-- PBXSourcesBuildPhase tests
---------------------------------------------------------------------------
function suite.PBXSourcesBuildPhase_OnNoSources()
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
[MyProject:src] /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end
function suite.PBXSourcesBuildPhase_OnSources()
files { "hello.cpp", "goodbye.cpp" }
prepare()
xcode.PBXSourcesBuildPhase(tr)
test.capture [[
/* Begin PBXSourcesBuildPhase section */
[MyProject:src] /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
[hello.cpp:build] /* hello.cpp in Sources */,
[goodbye.cpp:build] /* goodbye.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
]]
end