-
Notifications
You must be signed in to change notification settings - Fork 2
/
nuget.proj
79 lines (69 loc) · 4.07 KB
/
nuget.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="14.0"
DefaultTargets="PackageNuget">
<Import Project="nuget.proj.user" Condition="Exists('nuget.proj.user')" />
<PropertyGroup>
<AssemblyName>MSBuildSample</AssemblyName>
<NugetPath>Nuget\</NugetPath>
<OutputPath>bin\</OutputPath>
<NugetCurrentPath>Nuget\archive\4.1.0\</NugetCurrentPath>
<NugetOutputPath>Nuget\dist\</NugetOutputPath>
<NugetTempPath>artifacts</NugetTempPath>
<NugetSource>https://www.myget.org/F/dub-nightly/api/v3/index.json</NugetSource>
<SymbolSource>https://nuget.symbolsource.org/MyGet/dub-nightly</SymbolSource>
<NugetAspnet5Source>https://www.myget.org/F/dub-aspnet5-nightly/api/v2/package</NugetAspnet5Source>
</PropertyGroup>
<ItemGroup>
<!-- Solution files which has to be built. -->
<SolutionsToBuild Include="Dub\Dub.sln"/>
<!-- Spec files which should be built -->
<NugetSpecFile Include="Dub.Core\dub.core.nuspec" />
<NugetSpecFile Include="Dub.Web.Identity\dub.identity.nuspec" />
<NugetSpecFile Include="Dub.Web.Mvc\dub.mvc.nuspec" />
</ItemGroup>
<!-- Build the solution and place files to the OutpuPath -->
<Target Name="BuildSolution">
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
<MSBuild Projects="@(SolutionsToBuild)"
Targets="Clean"
Properties="Configuration=Release;" />
<MSBuild Projects="@(SolutionsToBuild)"
Targets="Build"
Properties="Configuration=Release;RunCodeAnalysis=true">
<!--<Output
TaskParameter="TargetOutputs"
ItemName="AssembliesBuiltByChildProjects" />-->
</MSBuild>
<!--<Copy SourceFiles="@(AssembliesBuiltByChildProjects)" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="@(AssembliesBuiltByChildProjects->'%(rootdir)%(directory)%(filename).xml')" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="@(AssembliesBuiltByChildProjects->'%(rootdir)%(directory)%(filename).pdb')" DestinationFolder="$(OutputPath)" />-->
</Target>
<ItemGroup>
<BuiltNugetFiles Include="$(NugetTempPath)\**\*.*"/>
</ItemGroup>
<!-- Package Nuget files -->
<Target Name="PackageNuget" DependsOnTargets="BuildSolution">
<RemoveDir Directories="$(NugetTempPath)" Condition="Exists('$(NugetTempPath)')" />
<MakeDir Directories="$(NugetTempPath)" Condition="!Exists('$(NugetTempPath)')" />
<RemoveDir Directories="$(NugetCurrentPath)" Condition="Exists('$(NugetCurrentPath)')" />
<MakeDir Directories="$(NugetCurrentPath)" Condition="!Exists('$(NugetCurrentPath)')" />
<Exec Command="$(NugetPath)Nuget.exe pack $(NugetPath)%(NugetSpecFile.Identity) -OutputDirectory $(NugetTempPath)" />
<Copy SourceFiles="@(BuiltNugetFiles)" DestinationFolder="$(NugetCurrentPath)" />
</Target>
<Target Name="PublishAspNet5Nightly" DependsOnTargets="BuildSolution">
<CreateItem Include="Dub\artifacts\**\*.nupkg">
<Output TaskParameter="Include" ItemName="NugetAspNet5Package" />
</CreateItem>
<Error Text="Please create nuget.proj.user which specify the NugetApiKey variable" Condition="$(NugetApiKey) == ''" />
<Exec Command="$(NugetPath)Nuget.exe push %(NugetAspNet5Package.Identity) $(NugetApiKey) -Source $(NugetSource)" Condition="$(NugetApiKey) != ''" />
<!--<Message Text="$(NugetPath)Nuget.exe push %(NugetAspNet5Package.Identity) $(NugetApiKey) -Source $(NugetSource)" Condition="$(NugetApiKey) != ''" />-->
</Target>
<Target Name="PublishNightly">
<CreateItem Include="$(NugetTempPath)\*.*">
<Output TaskParameter="Include" ItemName="NugetPackage" />
</CreateItem>
<Error Text="Please create nuget.proj.user which specify the NugetApiKey variable" Condition="$(NugetApiKey) == ''" />
<Exec Command="$(NugetPath)Nuget.exe push %(NugetPackage.Identity) $(NugetApiKey) -Source $(NugetSource)" Condition="$(NugetApiKey) != ''" />
<!--<Message Text="$(NugetPath)Nuget.exe push $(NugetPath)%(NugetPackage.Identity) $(NugetApiKey) -Source $(NugetSource)" Condition="$(NugetApiKey) != ''" />-->
</Target>
</Project>