12 | | <!-- to-do: provide a sample for Cobra --> |
| 12 | <PropertyGroup> |
| 13 | <ProjectName>Company.Project</ProjectName> |
| 14 | <OutputDir>build</OutputDir> |
| 15 | <BuildPartsDir>parts</BuildPartsDir> |
| 16 | </PropertyGroup> |
| 17 | |
| 18 | <ItemGroup> |
| 19 | |
| 20 | <CobraFlags Include="-d"/> |
| 21 | <CobraFlags Include="-correct-source"/> |
| 22 | |
| 23 | <CobraFiles Include="source\A.cobra"/> |
| 24 | <CobraFiles Include="source\B.cobra"/> |
| 25 | <CobraFiles Include="source\C.cobra"/> |
| 26 | |
| 27 | <References Include="System"/> |
| 28 | <References Include="System.Web"/> |
| 29 | |
| 30 | </ItemGroup> |
| 31 | |
| 32 | <Target Name="Clean"> |
| 33 | <RemoveDir Directories="$(OutputDir)"/> |
| 34 | </Target> |
| 35 | |
| 36 | <Target Name="Build"> |
| 37 | <CallTarget Targets="Reset"/> |
| 38 | <Exec Command="cobra -c -t:lib @(CobraFlags, ' ') -out:$(OutputDir)/$(ProjectName).dll @(References -> '-ref:%(Identity)', ' ') @(CobraFiles, ' ')"/> |
| 39 | </Target> |
| 40 | |
| 41 | <Target Name="Test"> |
| 42 | <CallTarget Targets="Reset"/> |
| 43 | <Exec Command="cobra -test @(CobraFlags, ' ') -out:$(OutputDir)/$(ProjectName).dll @(References -> '-ref:%(Identity)', ' ') @(CobraFiles, ' ')"/> |
| 44 | </Target> |
| 45 | |
| 46 | <Target Name="Reset"> |
| 47 | <CallTarget Targets="Clean"/> |
| 48 | <MakeDir Condition="!Exists('$(OutputDir)')" Directories="$(OutputDir)"/> |
| 49 | </Target> |