1+ <Project >
2+ <PropertyGroup >
3+ <_PackageManagerFolder >PackageManager</_PackageManagerFolder >
4+ </PropertyGroup >
5+
6+ <!--
7+ ============================================================
8+ _CopyPackageManager
9+
10+ Copy PackageManager.UI into GitExtensions.PluginManager so it can get packed and
11+ to Git Extensions shared installation so we can test it locally
12+ ============================================================
13+ -->
14+ <Target Name =" _CopyPackageManager" >
15+ <PropertyGroup >
16+ <_PackageManagerSourcePath >$([MSBuild]::NormalizePath('$(RepoRoot)', 'src', 'PackageManager.UI', 'bin', '$(Configuration)', '$(TargetFramework)', '$(PackageManagerUIRuntimeIdentifier)', 'publish', 'PackageManager.UI.exe'))</_PackageManagerSourcePath >
17+ <_PackageManagerTargetPath >$(_PackageManagerFolder)\PackageManager.UI.exe</_PackageManagerTargetPath >
18+ </PropertyGroup >
19+
20+ <!-- Copying to we can pack it -->
21+ <Copy SourceFiles =" $(_PackageManagerSourcePath)"
22+ DestinationFiles =" $(TargetDir)$(_PackageManagerTargetPath)" />
23+
24+ <!-- Copying to Git Extensions shared installation so we can test it locally -->
25+ <Copy SourceFiles =" $(_PackageManagerSourcePath)"
26+ DestinationFiles =" $(GitExtensionsPluginsPath)\$(ProjectName)\$(_PackageManagerTargetPath)" />
27+ </Target >
28+
29+ <!--
30+ ============================================================
31+ _SetPackageProperties
32+
33+ Update nuspec properties.
34+ ============================================================
35+ -->
36+ <Target Name =" _SetPackageProperties" BeforeTargets =" GenerateNuspec" >
37+ <PropertyGroup >
38+ <NuspecProperties >
39+ id=$(PackageId);
40+ version=$(PackageVersion);
41+ configuration=$(Configuration);
42+ tags=$(PackageTags.Replace(';',' '));
43+ projectUrl=$(PackageProjectUrl);
44+ iconUrl=$(PackageIconUrl);
45+ repositoryUrl=$(RepositoryUrl);
46+ repositoryType=$(RepositoryType);
47+ repositoryCommit=$(RepositoryCommit);
48+ author=$(Authors);
49+ copyright=$(Copyright);
50+ description=$(Description);
51+ targetDir=$(TargetDir);
52+ </NuspecProperties >
53+ </PropertyGroup >
54+ </Target >
55+
56+ <!--
57+ ============================================================
58+ _OverrideGetAbsoluteOutputPathsForPack
59+
60+ Override PackageOutputAbsolutePath to output the nupkg in artifacts folder instead of bin.
61+ ============================================================
62+ -->
63+ <Target Name =" _OverrideGetAbsoluteOutputPathsForPack" AfterTargets =" _GetAbsoluteOutputPathsForPack" >
64+ <PropertyGroup >
65+ <!-- Set the nupkg output path, used by GenerateNuspec targets, PackTask task -->
66+ <PackageOutputAbsolutePath >$([MSBuild]::NormalizePath('$(ArtifactsDir)', '..'))</PackageOutputAbsolutePath >
67+ </PropertyGroup >
68+ </Target >
69+
70+ <!--
71+ ============================================================
72+ CreatePortable
73+
74+ Creates a portable archive.
75+ ============================================================
76+ -->
77+ <Target Name =" CreatePortable"
78+ AfterTargets =" Publish"
79+ DependsOnTargets =" _CopyPackageManager;Pack" >
80+ <PropertyGroup >
81+ <_PublishPortableFileName >GitExtensions.PluginManager.$(PackageVersion).zip</_PublishPortableFileName >
82+ <_PublishPortablePath >$([MSBuild]::NormalizePath('$(ArtifactsDir)', '..', '$(_PublishPortableFileName)'))</_PublishPortablePath >
83+
84+ <!-- We want to archive the whole publish folder, so get one level up -->
85+ <_PublishedPath >$([MSBuild]::NormalizeDirectory('$(PublishDir)'))</_PublishedPath >
86+ </PropertyGroup >
87+ <!-- 1. Copy GitExtensions.PluginManager.dll and PackageManager\PackageManager.UI.exe files -->
88+ <Copy
89+ SourceFiles =" $(TargetPath)"
90+ DestinationFolder =" $(ArtifactsTmpDir)"
91+ ContinueOnError =" ErrorAndStop"
92+ />
93+ <ItemGroup >
94+ <_ZipContent Include =" $([MSBuild]::NormalizePath('$(TargetDir)', '$(_PackageManagerFolder)'))\*.*" />
95+ </ItemGroup >
96+ <Copy
97+ SourceFiles =" @(_ZipContent)"
98+ DestinationFolder =" $(ArtifactsTmpDir)$(_PackageManagerFolder)\%(RecursiveDir)"
99+ ContinueOnError =" ErrorAndStop"
100+ />
101+
102+ <!-- 2. Create a portable archive -->
103+ <ZipDirectory
104+ SourceDirectory =" $(ArtifactsTmpDir)"
105+ DestinationFile =" $(_PublishPortablePath)"
106+ Overwrite =" true"
107+ ContinueOnError =" ErrorAndStop"
108+ />
109+ </Target >
110+ </Project >
0 commit comments