-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.proj
123 lines (102 loc) · 4.86 KB
/
build.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CreateNugetPackage">
<!--
You can use this scrip to:
1. Create the SlowCheetah.Xdt NuGet package
#1: msbuild.exe build.proj
-->
<PropertyGroup>
<SourceRoot Condition=" '$(SourceRoot)'=='' ">$(MSBuildProjectDirectory)\src\</SourceRoot>
<OutputRootNoTrailingSlash Condition=" '$(OutputRoot)'=='' ">$(MSBuildProjectDirectory)\OutputRoot</OutputRootNoTrailingSlash>
<OutputRoot Condition=" '$(OutputRoot)'=='' ">$(OutputRootNoTrailingSlash)\</OutputRoot>
<PackageRoot Condition=" '$(PackageRoot)'=='' ">$(OutputRoot)Nugetpkg\</PackageRoot>
<NugetExe Condition=" '$(NugetExe)'=='' ">$(SourceRoot).nuget\NuGet.exe</NugetExe>
<NugetLocalRepo Condition=" '$(NugetLocalRepo)'=='' ">C:\Temp\Nuget\LocalRepo\</NugetLocalRepo>
<PackageDirectory Condition=" '$(PackageDirectory)'=='' ">_Package</PackageDirectory>
<CopyOutputToDevFolder Condition=" '$(CopyOutputToDevFolder)'=='' ">true</CopyOutputToDevFolder>
<DevFolder Condition=" '$(DevFolder)'=='' ">c:\temp\msbuild\</DevFolder>
<RestorePackages Condition=" '$(RestorePackages)'=='' ">true</RestorePackages>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration>
</PropertyGroup>
<ItemGroup>
<!-- This item should never have more than 1 value -->
<_NugetSpecFile Include="$(SourceRoot)ls.publishignore.nuspec" />
<!--<ToolsItems Include="$(SourceRoot)tools\Install.ps1" />-->
<ContentItems Include="$(SourceRoot)ls.pubignore.wpp.targets" />
<ContentItems Include="$(SourceRoot)publish.ignore" />
<!--<ToolsItems Include="" />-->
<!--<ContentItems Include="$(PublishPs1)">
<DestDir>$(PackageDirectory)\</DestDir>
</ContentItems>
<ContentItems Include="$(SourceRoot)Nuget\Sedodream.Package.targets">
<DestDir>$(PackageDirectory)\</DestDir>
</ContentItems>
<ContentItems Include="$(SourceRoot)Sedodream.Publish.proj">
<DestDir>$(PackageDirectory)\</DestDir>
</ContentItems>
<ContentItems Include="$(SourceRoot)Lib\SlowCheetah.Tasks.dll">
<DestDir>$(PackageDirectory)\</DestDir>
</ContentItems>-->
<!--<LibItems Include="$(OutputRoot)Microsoft.Web.XmlTransform.dll" />
<LibItems Include="$(OutputRoot)SlowCheetah.Xdt.dll" />-->
</ItemGroup>
<!--<ItemGroup>
<ProjectsToBuild Include="$(SourceRoot)SlowCheetah.Xdt\SlowCheetah.Xdt.csproj"/>
</ItemGroup>-->
<PropertyGroup>
<CreateNugetPackageDependsOn>
CleanAndInitalize;
PrepareAndPopulateNugetFolder;
CoreCreateNugetPackage;
</CreateNugetPackageDependsOn>
<!--<BuildProjectsDependsOn>
$(BuildProjectsDependsOn);
CleanAndInitalize;
CoreBuildProjects;
CopyOutputToDevFolder;
</BuildProjectsDependsOn>-->
</PropertyGroup>
<Target Name="CreateNugetPackage" DependsOnTargets="$(CreateNugetPackageDependsOn)" />
<Target Name="CoreCreateNugetPackage">
<!-- nuget pack "C:\...\SlowCheetah.Xdt.nuspec" -NoPackageAnalysis -OutputDirectory "C:\...\Output\" -->
<PropertyGroup>
<_NugetSpecFile>%(_NugetSpecOutputFile.FullPath)</_NugetSpecFile>
<_Cmd>"$(NugetExe)" pack "$(_NugetSpecFile)" -NoPackageAnalysis -OutputDirectory "$(OutputRootNoTrailingSlash)" </_Cmd>
</PropertyGroup>
<Message Text="_Cmd: $(_Cmd)" Importance="low" />
<Exec Command="$(_Cmd)"/>
<ItemGroup>
<_CreatedPackage Include="$(OutputRoot)*.nupkg"/>
</ItemGroup>
<Copy SourceFiles="@(_CreatedPackage)"
DestinationFiles="@(_CreatedPackage->'$(NugetLocalRepo)%(Filename)%(Extension)')"
Condition="Exists('$(NugetLocalRepo)')"/><!---->
</Target>
<Target Name="PrepareAndPopulateNugetFolder">
<Copy SourceFiles="@(_NugetSpecFile)"
DestinationFiles="@(_NugetSpecFile->'$(PackageRoot)%(Filename)%(Extension)')">
<Output ItemName="_NugetSpecOutputFile" TaskParameter="DestinationFiles"/>
</Copy>
<Copy SourceFiles="@(ToolsItems)"
DestinationFiles="@(ToolsItems->'$(PackageRoot)tools\%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(ContentItems)"
DestinationFiles="@(ContentItems->'$(PackageRoot)content\%(DestDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(LibItems)"
DestinationFiles="@(LibItems->'$(PackageRoot)lib\%(DestDir)%(Filename)%(Extension)')"/>
</Target>
<Target Name="CleanAndInitalize">
<MakeDir Directories="$(OutputRoot)"/>
<MakeDir Directories="$(PackageRoot)"/>
<ItemGroup>
<_FilesToDelete Remove="@(_FilesToDelete)"/>
<_FilesToDelete Include="$(OutputRoot)**\*"/>
</ItemGroup>
<Delete Files="@(_FilesToDelete)"/>
<ItemGroup>
<_FilesToDelete Remove="@(_FilesToDelete)"/>
<_FilesToDelete Include="$(PackageRoot)**\*"/>
</ItemGroup>
<Delete Files="@(_FilesToDelete)"/>
</Target>
</Project>