-
Notifications
You must be signed in to change notification settings - Fork 9
/
shared.proj
83 lines (65 loc) · 3.46 KB
/
shared.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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0" DefaultTargets="CreateNugetPackage">
<!-- This file is designed to be executed from the OutputRoot\ directory not the source directory -->
<Import Project="$(SharedProps)" Condition=" '$(SharedProps)'!='' "/>
<Import Project="$(MSBuildThisFileDirectory)..\shared.props" Condition=" '$(SharedProps)'=='' " />
<PropertyGroup>
<NuspecFile Condition=" '$(NuspecFile)'=='' ">$(MSBuildThisProjectDirectory)shared.nuspec</NuspecFile>
<NugetSourceRoot Condition=" ''=='' ">$(SharedSourceRoot)</NugetSourceRoot>
<PackageRoot Condition=" '$(PackageRoot)'=='' ">$(OutputRoot)_SharedNuGet\</PackageRoot>
<_ls-tempoutfolder Condition=" '$(_ls-tempoutfolder)'=='' ">$(OutputRoot)AzureJobs.NuGet.Shared\</_ls-tempoutfolder>
</PropertyGroup>
<ItemGroup>
<!-- This item should never have more than 1 value -->
<_NugetSpecFile Include="$(NuspecFile)" />
<!-- Standard declarations -->
<LibItems Include="$(NugetSourceRoot)NuGet\lib\**\*" />
<ContentItems Include="$(NugetSourceRoot)NuGet\content\**\*"/>
<ToolsItems Include="$(OutputPathImgComp)NuGet\tools\**\*" />
<!--<ToolsItems Include="$(OutputPathImgComp)tools\**\*">
<DestDir>tools\</DestDir>
</ToolsItems>
<ToolsItems Include="$(_ls-tempoutfolder)*.*"
Exclude="$(_ls-tempoutfolder)*.pdb;$(_ls-tempoutfolder)*.nuspec;$(_ls-tempoutfolder)*.proj"/>-->
</ItemGroup>
<PropertyGroup>
<CreateNugetPackageDependsOn>
PrepareAndPopulateNugetFolder;
CoreCreateNugetPackage;
</CreateNugetPackageDependsOn>
</PropertyGroup>
<Target Name="CreateNugetPackage" DependsOnTargets="$(CreateNugetPackageDependsOn)" />
<Target Name="CoreCreateNugetPackage">
<Message Text="OutputRoot: $(OutputRoot)" Importance="low"/>
<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>
<Message Text="ToolsItems: [@(ToolsItems)]
ToolsItems :[@(ContentItems)]
ContentItems : [@(ContentItems)]
LibItems : [@(LibItems)]
NuGetRootItems : [@(NuGetRootItems)]" Importance="low"/>
<Copy SourceFiles="@(ToolsItems)"
DestinationFiles="@(ToolsItems->'$(PackageRoot)tools\%(DestDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(ContentItems)"
DestinationFiles="@(ContentItems->'$(PackageRoot)content\%(DestDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(LibItems)"
DestinationFiles="@(LibItems->'$(PackageRoot)lib\%(DestDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(NuGetRootItems)"
DestinationFiles="@(NuGetRootItems->'$(PackageRoot)%(DestDir)%(Filename)%(Extension)')" />
</Target>
</Project>