Skip to content

Commit

Permalink
Merge pull request #745 from LORgames/ssurtees/codeliteStartProjectFix
Browse files Browse the repository at this point in the history
Fixed issue with using startproject API in CodeLite
  • Loading branch information
samsinsane authored Apr 25, 2017
2 parents 694f934 + 5a85b73 commit 43c5e0a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/codelite/codelite_workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions modules/codelite/tests/test_codelite_workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 43c5e0a

Please sign in to comment.