Fixed issue with using startproject API in CodeLite

- Added test to ensure this doesn't break again
This commit is contained in:
Sam Surtees 2017-04-18 00:41:48 +10:00
parent 39367d6c57
commit 83e0229a2a
2 changed files with 26 additions and 2 deletions

View File

@ -44,8 +44,11 @@
local prjpath = p.filename(prj, ".project")
prjpath = path.getrelative(prj.workspace.location, prjpath)
local active = iif(prj.name == wks.startproject, ' Active="Yes"', '')
_x(1, '<Project Name="%s" Path="%s"%s/>', prj.name, prjpath, active)
if (prj.name == wks.startproject) then
_x(1, '<Project Name="%s" Path="%s" Active="Yes"/>', prj.name, prjpath)
else
_x(1, '<Project Name="%s" Path="%s"/>', prj.name, prjpath)
end
end,
onbranch = function(n)

View File

@ -129,3 +129,24 @@
</CodeLite_Workspace>
]])
end
function suite.onActiveProject()
workspace("MyWorkspace")
startproject "MyProject"
prepare()
test.capture([[
<?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Workspace Name="MyWorkspace" Database="" SWTLW="No">
<Project Name="MyProject" Path="MyProject.project" Active="Yes"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Debug" Selected="yes">
<Project Name="MyProject" ConfigName="Debug"/>
</WorkspaceConfiguration>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="MyProject" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
</CodeLite_Workspace>
]])
end