-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalise local and CI build experiences (#76)
The app can be build with "dotnet" without custom scripts. Packaging and publishing moved into MSBuild targets.
- Loading branch information
Showing
14 changed files
with
267 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<Project> | ||
|
||
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" /> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup> | ||
<!-- To support GitExtensions.Extensibility 0.3.*, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1011 --> | ||
<CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled> | ||
</PropertyGroup> | ||
|
||
<!-- Solution dependencies --> | ||
<ItemGroup> | ||
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.2.41" /> | ||
<PackageVersion Include="GitExtensions.Extensibility" Version="0.3.*" /> | ||
<PackageVersion Include="Neptuo" Version="6.0.2" /> | ||
<PackageVersion Include="Neptuo.Exceptions" Version="1.2.2" /> | ||
<PackageVersion Include="Neptuo.Observables" Version="2.1.1" /> | ||
<PackageVersion Include="NuGet.PackageManagement" Version="6.8.0" /> | ||
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<!-- Test-related --> | ||
<ItemGroup> | ||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.0" /> | ||
<PackageVersion Include="Moq" Version="4.18.2" /> | ||
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" /> | ||
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" /> | ||
<PackageVersion Include="Appveyor.TestLogger" Version="2.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
src/GitExtensions.PluginManager/Project.Publish.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<_PackageManagerFolder>PackageManager</_PackageManagerFolder> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
============================================================ | ||
_CopyPackageManager | ||
Copy PackageManager.UI into GitExtensions.PluginManager so it can get packed and | ||
to Git Extensions shared installation so we can test it locally | ||
============================================================ | ||
--> | ||
<Target Name="_CopyPackageManager"> | ||
<PropertyGroup> | ||
<_PackageManagerSourcePath>$([MSBuild]::NormalizePath('$(RepoRoot)', 'src', 'PackageManager.UI', 'bin', '$(Configuration)', '$(TargetFramework)', '$(PackageManagerUIRuntimeIdentifier)', 'publish', 'PackageManager.UI.exe'))</_PackageManagerSourcePath> | ||
<_PackageManagerTargetPath>$(_PackageManagerFolder)\PackageManager.UI.exe</_PackageManagerTargetPath> | ||
</PropertyGroup> | ||
|
||
<!-- Copying to we can pack it --> | ||
<Copy SourceFiles="$(_PackageManagerSourcePath)" | ||
DestinationFiles="$(TargetDir)$(_PackageManagerTargetPath)" /> | ||
|
||
<!-- Copying to Git Extensions shared installation so we can test it locally --> | ||
<Copy SourceFiles="$(_PackageManagerSourcePath)" | ||
DestinationFiles="$(GitExtensionsPluginsPath)\$(ProjectName)\$(_PackageManagerTargetPath)" /> | ||
</Target> | ||
|
||
<!-- | ||
============================================================ | ||
_SetPackageProperties | ||
Update nuspec properties. | ||
============================================================ | ||
--> | ||
<Target Name="_SetPackageProperties" BeforeTargets="GenerateNuspec"> | ||
<PropertyGroup> | ||
<NuspecProperties> | ||
id=$(PackageId); | ||
version=$(PackageVersion); | ||
configuration=$(Configuration); | ||
tags=$(PackageTags.Replace(';',' ')); | ||
projectUrl=$(PackageProjectUrl); | ||
iconUrl=$(PackageIconUrl); | ||
repositoryUrl=$(RepositoryUrl); | ||
repositoryType=$(RepositoryType); | ||
repositoryCommit=$(RepositoryCommit); | ||
author=$(Authors); | ||
copyright=$(Copyright); | ||
description=$(Description); | ||
targetDir=$(TargetDir); | ||
</NuspecProperties> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<!-- | ||
============================================================ | ||
_OverrideGetAbsoluteOutputPathsForPack | ||
Override PackageOutputAbsolutePath to output the nupkg in artifacts folder instead of bin. | ||
============================================================ | ||
--> | ||
<Target Name="_OverrideGetAbsoluteOutputPathsForPack" AfterTargets="_GetAbsoluteOutputPathsForPack"> | ||
<PropertyGroup> | ||
<!-- Set the nupkg output path, used by GenerateNuspec targets, PackTask task --> | ||
<PackageOutputAbsolutePath>$([MSBuild]::NormalizePath('$(ArtifactsDir)', '..'))</PackageOutputAbsolutePath> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<!-- | ||
============================================================ | ||
CreatePortable | ||
Creates a portable archive. | ||
============================================================ | ||
--> | ||
<Target Name="CreatePortable" | ||
AfterTargets="Publish" | ||
DependsOnTargets="_CopyPackageManager;Pack"> | ||
<PropertyGroup> | ||
<_PublishPortableFileName>GitExtensions.PluginManager.$(PackageVersion).zip</_PublishPortableFileName> | ||
<_PublishPortablePath>$([MSBuild]::NormalizePath('$(ArtifactsDir)', '..', '$(_PublishPortableFileName)'))</_PublishPortablePath> | ||
|
||
<!-- We want to archive the whole publish folder, so get one level up --> | ||
<_PublishedPath>$([MSBuild]::NormalizeDirectory('$(PublishDir)'))</_PublishedPath> | ||
</PropertyGroup> | ||
<!-- 1. Copy GitExtensions.PluginManager.dll and PackageManager\PackageManager.UI.exe files --> | ||
<Copy | ||
SourceFiles="$(TargetPath)" | ||
DestinationFolder="$(ArtifactsTmpDir)" | ||
ContinueOnError="ErrorAndStop" | ||
/> | ||
<ItemGroup> | ||
<_ZipContent Include="$([MSBuild]::NormalizePath('$(TargetDir)', '$(_PackageManagerFolder)'))\*.*" /> | ||
</ItemGroup> | ||
<Copy | ||
SourceFiles="@(_ZipContent)" | ||
DestinationFolder="$(ArtifactsTmpDir)$(_PackageManagerFolder)\%(RecursiveDir)" | ||
ContinueOnError="ErrorAndStop" | ||
/> | ||
|
||
<!-- 2. Create a portable archive --> | ||
<ZipDirectory | ||
SourceDirectory="$(ArtifactsTmpDir)" | ||
DestinationFile="$(_PublishPortablePath)" | ||
Overwrite="true" | ||
ContinueOnError="ErrorAndStop" | ||
/> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.