Merge pull request #745 from LORgames/ssurtees/codeliteStartProjectFix

Fixed issue with using startproject API in CodeLite
This commit is contained in:
Samuel Surtees 2017-04-25 15:09:21 +10:00 committed by GitHub
commit 43c5e0a4ae
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