Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/build_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ jobs:
runs-on: [windows-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 2.2.108
dotnet-version: '10.x'

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

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

# - name: Push to `Nuget.org` nuget feed
# run: |
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ bld/
[Oo]bj/
[Ll]og/

# Visual Studio 2015/2017 cache/options directory
# Visual Studio cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand Down
35 changes: 35 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project>

<PropertyGroup>
<TargetFramework>net10.0-windows</TargetFramework>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);1573;1591;1712</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<PackageManagerUIRuntimeIdentifier>win-x64</PackageManagerUIRuntimeIdentifier>
</PropertyGroup>

<PropertyGroup>
<Authors>Git Extensions</Authors>
<Company>Git Extensions</Company>
<RepositoryUrl>https://github.com/gitextensions/gitextensions.plugintemplate</RepositoryUrl>
<LangVersion>latest</LangVersion>
<Version>0.0.1</Version>
<AssemblyVersion>0.0.1</AssemblyVersion>
<FileVersion>0.0.1</FileVersion>
<InformationalVersion>0.0.1</InformationalVersion>
<PackageVersion>0.0.1</PackageVersion>
</PropertyGroup>

<!-- Repo layout -->
<PropertyGroup>
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::NormalizeDirectory('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'appveyor.yml'))'))</RepoRoot>

<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', '$(Configuration)'))</ArtifactsDir>
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
<ArtifactsTestResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'TestResults'))</ArtifactsTestResultsDir>
<ArtifactsTmpDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tmp'))</ArtifactsTmpDir>
</PropertyGroup>

</Project>
12 changes: 12 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- 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) -->
<Project>
<PropertyGroup>
<EnablePackageVersionOverride>false</EnablePackageVersionOverride>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="GitExtensions.Extensibility" Version="1.0.0.129" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="System.ComponentModel.Composition" Version="6.0.0" />
</ItemGroup>
</Project>
70 changes: 57 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,74 @@
# version format
version: 1.0.0.{build}

# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
environment:
version_suffix: ''
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

# Do not build on tags (GitHub and BitBucket)
skip_tags: true

# Maximum number of concurrent jobs for the project
max_jobs: 1

#---------------------------------#
# environment configuration #
#---------------------------------#

nuget:
disable_publish_on_pr: true

# Build worker image (VM template)
image:
- Visual Studio 2019
image: Visual Studio 2022

# enable patching of Directory.Build.props
dotnet_csproj:
patch: true
file: '**\*.props'
version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}$(version_suffix)'
package_version: '{version}$(version_suffix)'

#---------------------------------#
# build configuration #
#---------------------------------#

# scripts to run before build
before_build:
- ps: nuget restore .\GitExtensions.PluginTemplate.sln
install:
- ps: |
# Install the required .NET SDK
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
./dotnet-install.ps1 -JSonFile ./global.json -InstallDir 'C:\Program Files\dotnet'
# Remove the script so it doesn't "pollute" the build
Remove-Item -Path .\dotnet-install.ps1

build_script:
- ps: |
dotnet restore --verbosity q --nologo /bl:.\artifacts\logs\restore.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }

- ps: |
dotnet publish --configuration Release --verbosity q -bl:.\artifacts\logs\publish.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }



#---------------------------------#
# artifacts configuration #
#---------------------------------#

artifacts:
- path: '**\GitExtensions.PluginTemplate.*.nupkg'
name: NuGet

build:
# enable MSBuild parallel builds
parallel: true
# MSBuild verbosity level
verbosity: minimal
deploy:
- provider: NuGet
name: production
artifact: /GitExtensions.PluginTemplate.*\.nupkg/
api_key:
secure: 2apdS3bqaEv20ai12PU9uXaF6w/INNVLyvFV7EdGyK8Uxdwk6KAKDuJySbmi/4uO
skip_symbols: false
on:
appveyor_repo_tag: true
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "10.0.103",
"rollForward": "feature"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Pack as .nupkg with dependency on GitExtensions.Extensibility -->
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<VersionPrefix>1.0.0</VersionPrefix>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<TargetFramework>net10.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
<Authors>YOUR NAME HERE</Authors>
<Company>YOUR ORGANIZATION HERE</Company>
<Description>A template for Git Extensions plugins distributed as NuGet packages.</Description>
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.plugintemplate</PackageProjectUrl>
<PackageTags>GitExtensions</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- Assembly binding redirect for WindowsBase compatibility -->
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<!-- Suppress assembly binding resolution warnings for version mismatches -->
<WarningLevel>3</WarningLevel>
<NoWarn>$(NoWarn);MSB3277</NoWarn>
</PropertyGroup>

<!-- References to Git Extensions' DLLs -->
<!-- PackageReference triggers the MSBuild targets that download GE before build -->
<ItemGroup>
<PackageReference Include="GitExtensions.Extensibility" />
<Reference Include="GitExtensions.Extensibility">
<HintPath>$(GitExtensionsPath)\GitExtensions.Extensibility.dll</HintPath>
</Reference>
<Reference Include="GitUIPluginInterfaces">
<HintPath>$(GitExtensionsPath)\GitUIPluginInterfaces.dll</HintPath>
</Reference>
<Reference Include="ResourceManager">
<HintPath>$(GitExtensionsPath)\ResourceManager.dll</HintPath>
</Reference>
<PackageReference Include="System.ComponentModel.Composition" />
<Reference Include="GitCommands">
<HintPath>$(GitExtensionsPath)\GitCommands.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
Expand All @@ -17,40 +49,6 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitExtensions.Extensibility" Version="0.1.1.40" />
</ItemGroup>

<!--SourceLink support: https://github.com/dotnet/sourcelink -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<!--<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All"/>-->
<!--<PackageReference Include="Microsoft.SourceLink.AzureDevOpsServer.Git" Version="1.0.0" PrivateAssets="All"/>-->
<!--<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0" PrivateAssets="All"/>-->
<!--<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0" PrivateAssets="All"/>-->
</ItemGroup>

<!-- Reference to GitExtensions dlls. -->
<ItemGroup>
<Reference Include="GitUIPluginInterfaces">
<HintPath>$(GitExtensionsPath)\GitUIPluginInterfaces.dll</HintPath>
</Reference>
<Reference Include="ResourceManager">
<HintPath>$(GitExtensionsPath)\ResourceManager.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<!-- Pack as .nupkg with dependency on GitExtensions.Extensibility -->
<PropertyGroup>
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
<Authors>YOUR NAME HERE</Authors>
<Company>YOUR ORGANIZATION HERE</Company>
<Description>A template for Git Extensions plugins distributed as NuGet packages.</Description>
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.plugintemplate</PackageProjectUrl>
<PackageTags>GitExtensions</PackageTags>
</PropertyGroup>
<Target Name="SetPackageProperties" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<NuspecProperties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<Project>
<PropertyGroup>
<GitExtensionsDownloadPath>..\..\..\gitextensions.shared</GitExtensionsDownloadPath> <!-- path is relative to $(ProjectDir) -->
<GitExtensionsReferenceVersion>latest</GitExtensionsReferenceVersion> <!-- 'latest' or 'v3.1' (= tag from GitHub releases) or 'v3.1.0.5877' (= build number from AppVeyor)-->
<GitExtensionsReferenceSource>GitHub</GitExtensionsReferenceSource> <!-- 'GitHub' or 'AppYevor' -->
<GitExtensionsPath></GitExtensionsPath> <!-- for local builds (no download) -->
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<!-- path is relative to $(ProjectDir) -->
<GitExtensionsDownloadPath>..\..\..\gitextensions.shared</GitExtensionsDownloadPath>
<!-- 'latest' or 'v3.1' (= tag from GitHub releases) or 'v3.1.0.5877' (= build number from AppVeyor)-->
<GitExtensionsReferenceVersion>latest</GitExtensionsReferenceVersion>
<!-- 'GitHub' or 'AppVeyor' -->
<GitExtensionsReferenceSource>GitHub</GitExtensionsReferenceSource>
<!-- for local builds (no download) -->
<GitExtensionsPath>$(GitExtensionsDownloadPath)</GitExtensionsPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@
<projectUrl>$projectUrl$</projectUrl>
<tags>$tags$</tags>
<dependencies>
<dependency id="GitExtensions.Extensibility" version="[0.4.0, 0.5.0)" />
<group>
<dependency id="GitExtensions.Extensibility" version="[1.0.0, 1.1.0)" />
</group>
<!-- To fix Warning NU5128 Add a dependency group -->
<group targetFramework="net10.0-windows7.0">
<dependency id="GitExtensions.Extensibility" version="[1.0.0, 1.1.0)" />
</group>
</dependencies>
</metadata>
<files>
<file src="$targetDir$$id$.dll" target="/lib" />
<file src="$targetDir$$id$.pdb" target="/lib" />
<file src="$targetDir$$id$.dll" target="/lib/net10.0-windows7.0/" />
<file src="$targetDir$$id$.pdb" target="/lib/net10.0-windows7.0/" />
</files>

</package>
11 changes: 5 additions & 6 deletions src/GitExtensions.PluginTemplate/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using System.Collections.Generic;
using GitExtensions.PluginTemplate.Properties;
using GitUIPluginInterfaces;
using ResourceManager;
using GitExtensions.PluginTemplate.Properties;
using GitExtensions.Extensibility.Git;
using GitExtensions.Extensibility.Plugins;
using System.ComponentModel.Composition;
using System.Windows.Forms;
using GitCommands;

namespace GitExtensions.PluginTemplate
{
/// <summary>
/// A template for Git Extensions plugins.
/// Find more documentation here: https://github.com/gitextensions/gitextensions.plugintemplate/wiki/GitPluginBase
/// </summary>
[Export(typeof(IGitPlugin))]
public class Plugin : GitPluginBase
{
public Plugin()
Expand All @@ -23,7 +22,7 @@ public Plugin()
Icon = Resources.Icon;

// Translate the plugin strings. Do not remove. Should be called in the constructor of the plugin.
Translate();
Translate(AppSettings.CurrentTranslation);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"profiles": {
"GitExtensions.PluginTemplate": {
"commandName": "Executable",
"executablePath": "$(GitExtensionsExecutablePath)"
"executablePath": "$(GitExtensionsExecutablePath)",
"workingDirectory": "$(MSBuildProjectDirectory)"
}
}
}
Loading