Skip to content

Commit 53df9e7

Browse files
committed
feat: Git Extensions 7.0
Centralize package management, align with main app
1 parent ae235f2 commit 53df9e7

11 files changed

Lines changed: 182 additions & 82 deletions

.github/workflows/build_plugin.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@ jobs:
1414
runs-on: [windows-latest]
1515

1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1818

19-
- name: Setup .NET Core
20-
uses: actions/setup-dotnet@v1
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 2.2.108
22+
dotnet-version: '10.x'
2323

24-
- name: Setup MSBuild.exe
25-
uses: warrenbuckley/Setup-MSBuild@v1
24+
- name: Restore
25+
run: dotnet restore --verbosity q --nologo
2626

27-
- name: Build & package with `msbuild`
28-
run: |
29-
msbuild -target:restore -property:Configuration=Release
30-
msbuild -target:pack -property:Configuration=Release
27+
- name: Publish with `dotnet`
28+
run: dotnet publish --configuration Release --verbosity q --nologo
3129

3230
# - name: Push to `Nuget.org` nuget feed
3331
# run: |

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@ bld/
2424
[Oo]bj/
2525
[Ll]og/
2626

27-
# Visual Studio 2015/2017 cache/options directory
27+
# Visual Studio cache/options directory
2828
.vs/
2929
# Uncomment if you have tasks that create the project's static files in wwwroot
3030
#wwwroot/
3131

32-
# Visual Studio 2017 auto generated files
33-
Generated\ Files/
34-
3532
# MSTest test Results
3633
[Tt]est[Rr]esult*/
3734
[Bb]uild[Ll]og.*

Directory.Build.props

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0-windows</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<NoWarn>$(NoWarn);1573;1591;1712</NoWarn>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
9+
<PackageManagerUIRuntimeIdentifier>win-x64</PackageManagerUIRuntimeIdentifier>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<Authors>Git Extensions</Authors>
14+
<Company>Git Extensions</Company>
15+
<RepositoryUrl>https://github.com/gitextensions/gitextensions.plugintemplate</RepositoryUrl>
16+
<LangVersion>latest</LangVersion>
17+
<Version>0.0.1</Version>
18+
<AssemblyVersion>0.0.1</AssemblyVersion>
19+
<FileVersion>0.0.1</FileVersion>
20+
<InformationalVersion>0.0.1</InformationalVersion>
21+
<PackageVersion>0.0.1</PackageVersion>
22+
</PropertyGroup>
23+
24+
<!-- Repo layout -->
25+
<PropertyGroup>
26+
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::NormalizeDirectory('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'appveyor.yml'))'))</RepoRoot>
27+
28+
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', '$(Configuration)'))</ArtifactsDir>
29+
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
30+
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
31+
<ArtifactsTestResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'TestResults'))</ArtifactsTestResultsDir>
32+
<ArtifactsTmpDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tmp'))</ArtifactsTmpDir>
33+
</PropertyGroup>
34+
35+
</Project>

Directory.Packages.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Do not use XML namespaces here (<Project xmlns="...">), because it would break patching of version numbers during builds on AppVeyor (https://github.com/appveyor/website/pull/409) -->
2+
<Project>
3+
<PropertyGroup>
4+
<EnablePackageVersionOverride>false</EnablePackageVersionOverride>
5+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageVersion Include="GitExtensions.Extensibility" Version="1.0.0.129" />
9+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
10+
<PackageVersion Include="System.ComponentModel.Composition" Version="6.0.0" />
11+
</ItemGroup>
12+
</Project>

appveyor.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,74 @@
55
# version format
66
version: 1.0.0.{build}
77

8+
# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
9+
environment:
10+
version_suffix: ''
11+
# Disable the .NET logo in the console output.
12+
DOTNET_NOLOGO: true
13+
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
14+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
15+
816
# Do not build on tags (GitHub and BitBucket)
917
skip_tags: true
1018

11-
# Maximum number of concurrent jobs for the project
12-
max_jobs: 1
13-
1419
#---------------------------------#
1520
# environment configuration #
1621
#---------------------------------#
1722

23+
nuget:
24+
disable_publish_on_pr: true
25+
1826
# Build worker image (VM template)
19-
image:
20-
- Visual Studio 2019
27+
image: Visual Studio 2022
28+
29+
# enable patching of Directory.Build.props
30+
dotnet_csproj:
31+
patch: true
32+
file: '**\*.props'
33+
version: '{version}'
34+
assembly_version: '{version}'
35+
file_version: '{version}'
36+
informational_version: '{version}$(version_suffix)'
37+
package_version: '{version}$(version_suffix)'
2138

2239
#---------------------------------#
2340
# build configuration #
2441
#---------------------------------#
2542

26-
# scripts to run before build
27-
before_build:
28-
- ps: nuget restore .\GitExtensions.PluginTemplate.sln
43+
install:
44+
- ps: |
45+
# Install the required .NET SDK
46+
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
47+
./dotnet-install.ps1 -JSonFile ./global.json -InstallDir 'C:\Program Files\dotnet'
48+
# Remove the script so it doesn't "pollute" the build
49+
Remove-Item -Path .\dotnet-install.ps1
50+
51+
build_script:
52+
- ps: |
53+
dotnet restore --verbosity q --nologo /bl:.\artifacts\logs\restore.binlog
54+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
55+
56+
- ps: |
57+
dotnet publish --configuration Release --verbosity q -bl:.\artifacts\logs\publish.binlog
58+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
59+
60+
61+
62+
#---------------------------------#
63+
# artifacts configuration #
64+
#---------------------------------#
65+
66+
artifacts:
67+
- path: '**\GitExtensions.PluginTemplate.*.nupkg'
68+
name: NuGet
2969

30-
build:
31-
# enable MSBuild parallel builds
32-
parallel: true
33-
# MSBuild verbosity level
34-
verbosity: minimal
70+
deploy:
71+
- provider: NuGet
72+
name: production
73+
artifact: /GitExtensions.PluginTemplate.*\.nupkg/
74+
api_key:
75+
secure: 2apdS3bqaEv20ai12PU9uXaF6w/INNVLyvFV7EdGyK8Uxdwk6KAKDuJySbmi/4uO
76+
skip_symbols: false
77+
on:
78+
appveyor_repo_tag: true

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.103",
4+
"rollForward": "feature"
5+
}
6+
}

src/GitExtensions.PluginTemplate/GitExtensions.PluginTemplate.csproj

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<!-- Pack as .nupkg with dependency on GitExtensions.Extensibility -->
34
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
5-
<VersionPrefix>1.0.0</VersionPrefix>
6-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
5+
<TargetFramework>net10.0-windows</TargetFramework>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
8+
<Authors>YOUR NAME HERE</Authors>
9+
<Company>YOUR ORGANIZATION HERE</Company>
10+
<Description>A template for Git Extensions plugins distributed as NuGet packages.</Description>
11+
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.plugintemplate</PackageProjectUrl>
12+
<PackageTags>GitExtensions</PackageTags>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
<!-- Assembly binding redirect for WindowsBase compatibility -->
15+
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
16+
<!-- Suppress assembly binding resolution warnings for version mismatches -->
17+
<WarningLevel>3</WarningLevel>
18+
<NoWarn>$(NoWarn);MSB3277</NoWarn>
719
</PropertyGroup>
20+
21+
<!-- References to Git Extensions' DLLs -->
22+
<!-- PackageReference triggers the MSBuild targets that download GE before build -->
23+
<ItemGroup>
24+
<PackageReference Include="GitExtensions.Extensibility" />
25+
<Reference Include="GitExtensions.Extensibility">
26+
<HintPath>$(GitExtensionsPath)\GitExtensions.Extensibility.dll</HintPath>
27+
</Reference>
28+
<Reference Include="GitUIPluginInterfaces">
29+
<HintPath>$(GitExtensionsPath)\GitUIPluginInterfaces.dll</HintPath>
30+
</Reference>
31+
<Reference Include="ResourceManager">
32+
<HintPath>$(GitExtensionsPath)\ResourceManager.dll</HintPath>
33+
</Reference>
34+
<PackageReference Include="System.ComponentModel.Composition" />
35+
<Reference Include="GitCommands">
36+
<HintPath>$(GitExtensionsPath)\GitCommands.dll</HintPath>
37+
</Reference>
38+
</ItemGroup>
39+
840
<ItemGroup>
941
<Compile Update="Properties\Resources.Designer.cs">
1042
<DesignTime>True</DesignTime>
@@ -17,40 +49,6 @@
1749
</EmbeddedResource>
1850
</ItemGroup>
1951

20-
<ItemGroup>
21-
<PackageReference Include="GitExtensions.Extensibility" Version="0.1.1.40" />
22-
</ItemGroup>
23-
24-
<!--SourceLink support: https://github.com/dotnet/sourcelink -->
25-
<ItemGroup>
26-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
27-
<!--<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All"/>-->
28-
<!--<PackageReference Include="Microsoft.SourceLink.AzureDevOpsServer.Git" Version="1.0.0" PrivateAssets="All"/>-->
29-
<!--<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0" PrivateAssets="All"/>-->
30-
<!--<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0" PrivateAssets="All"/>-->
31-
</ItemGroup>
32-
33-
<!-- Reference to GitExtensions dlls. -->
34-
<ItemGroup>
35-
<Reference Include="GitUIPluginInterfaces">
36-
<HintPath>$(GitExtensionsPath)\GitUIPluginInterfaces.dll</HintPath>
37-
</Reference>
38-
<Reference Include="ResourceManager">
39-
<HintPath>$(GitExtensionsPath)\ResourceManager.dll</HintPath>
40-
</Reference>
41-
<Reference Include="System.ComponentModel.Composition" />
42-
<Reference Include="System.Windows.Forms" />
43-
</ItemGroup>
44-
45-
<!-- Pack as .nupkg with dependency on GitExtensions.Extensibility -->
46-
<PropertyGroup>
47-
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
48-
<Authors>YOUR NAME HERE</Authors>
49-
<Company>YOUR ORGANIZATION HERE</Company>
50-
<Description>A template for Git Extensions plugins distributed as NuGet packages.</Description>
51-
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.plugintemplate</PackageProjectUrl>
52-
<PackageTags>GitExtensions</PackageTags>
53-
</PropertyGroup>
5452
<Target Name="SetPackageProperties" BeforeTargets="GenerateNuspec">
5553
<PropertyGroup>
5654
<NuspecProperties>
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<Project>
2-
<PropertyGroup>
3-
<GitExtensionsDownloadPath>..\..\..\gitextensions.shared</GitExtensionsDownloadPath> <!-- path is relative to $(ProjectDir) -->
4-
<GitExtensionsReferenceVersion>latest</GitExtensionsReferenceVersion> <!-- 'latest' or 'v3.1' (= tag from GitHub releases) or 'v3.1.0.5877' (= build number from AppVeyor)-->
5-
<GitExtensionsReferenceSource>GitHub</GitExtensionsReferenceSource> <!-- 'GitHub' or 'AppYevor' -->
6-
<GitExtensionsPath></GitExtensionsPath> <!-- for local builds (no download) -->
7-
</PropertyGroup>
8-
</Project>
1+
<Project>
2+
<PropertyGroup>
3+
<!-- path is relative to $(ProjectDir) -->
4+
<GitExtensionsDownloadPath>..\..\..\gitextensions.shared</GitExtensionsDownloadPath>
5+
<!-- 'latest' or 'v3.1' (= tag from GitHub releases) or 'v3.1.0.5877' (= build number from AppVeyor)-->
6+
<GitExtensionsReferenceVersion>latest</GitExtensionsReferenceVersion>
7+
<!-- 'GitHub' or 'AppVeyor' -->
8+
<GitExtensionsReferenceSource>GitHub</GitExtensionsReferenceSource>
9+
<!-- for local builds (no download) -->
10+
<GitExtensionsPath>$(GitExtensionsDownloadPath)</GitExtensionsPath>
11+
</PropertyGroup>
12+
</Project>

src/GitExtensions.PluginTemplate/GitExtensions.PluginTemplate.nuspec

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@
88
<projectUrl>$projectUrl$</projectUrl>
99
<tags>$tags$</tags>
1010
<dependencies>
11-
<dependency id="GitExtensions.Extensibility" version="[0.4.0, 0.5.0)" />
11+
<group>
12+
<dependency id="GitExtensions.Extensibility" version="[1.0.0, 1.1.0)" />
13+
</group>
14+
<!-- To fix Warning NU5128 Add a dependency group -->
15+
<group targetFramework="net10.0-windows7.0">
16+
<dependency id="GitExtensions.Extensibility" version="[1.0.0, 1.1.0)" />
17+
</group>
1218
</dependencies>
1319
</metadata>
1420
<files>
15-
<file src="$targetDir$$id$.dll" target="/lib" />
16-
<file src="$targetDir$$id$.pdb" target="/lib" />
21+
<file src="$targetDir$$id$.dll" target="/lib/net10.0-windows7.0/" />
22+
<file src="$targetDir$$id$.pdb" target="/lib/net10.0-windows7.0/" />
1723
</files>
1824

1925
</package>

src/GitExtensions.PluginTemplate/Plugin.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
using System.Collections.Generic;
2-
using GitExtensions.PluginTemplate.Properties;
3-
using GitUIPluginInterfaces;
4-
using ResourceManager;
1+
using GitExtensions.PluginTemplate.Properties;
2+
using GitExtensions.Extensibility.Git;
3+
using GitExtensions.Extensibility.Plugins;
54
using System.ComponentModel.Composition;
65
using System.Windows.Forms;
6+
using GitCommands;
77

88
namespace GitExtensions.PluginTemplate
99
{
1010
/// <summary>
1111
/// A template for Git Extensions plugins.
1212
/// Find more documentation here: https://github.com/gitextensions/gitextensions.plugintemplate/wiki/GitPluginBase
1313
/// </summary>
14-
[Export(typeof(IGitPlugin))]
1514
public class Plugin : GitPluginBase
1615
{
1716
public Plugin()
@@ -23,7 +22,7 @@ public Plugin()
2322
Icon = Resources.Icon;
2423

2524
// Translate the plugin strings. Do not remove. Should be called in the constructor of the plugin.
26-
Translate();
25+
Translate(AppSettings.CurrentTranslation);
2726
}
2827

2928

0 commit comments

Comments
 (0)