Skip to content

Commit f4ef7d6

Browse files
authored
fix: .NET 10 CI build support via dotnet restore and global.json (#97)
various copilot and manual changes
1 parent c5756ef commit f4ef7d6

6 files changed

Lines changed: 90 additions & 70 deletions

File tree

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.13.61" />
1313
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
1414
<PackageVersion Include="NUnit" Version="3.13.3" />
15-
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
16-
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
15+
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
16+
<PackageVersion Include="coverlet.collector" Version="8.0.0" />
1717
</ItemGroup>
1818
</Project>

GitExtensions.GerritPlugin.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
ProjectSection(SolutionItems) = preProject
1212
Directory.Build.props = Directory.Build.props
1313
Directory.Packages.props = Directory.Packages.props
14+
global.json = global.json
1415
README.md = README.md
1516
EndProjectSection
1617
EndProject

appveyor.yml

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,77 @@
1-
#---------------------------------#
2-
# general configuration #
3-
#---------------------------------#
4-
5-
# version format
6-
version: 3.2.0.{build}
7-
8-
# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
9-
environment:
10-
version_suffix: ''
11-
12-
#---------------------------------#
13-
# environment configuration #
14-
#---------------------------------#
15-
16-
nuget:
17-
disable_publish_on_pr: true
18-
19-
# Build worker image (VM template)
20-
image: Visual Studio 2022
21-
22-
# enable patching of Directory.Build.props
23-
dotnet_csproj:
24-
patch: true
25-
file: '**\*.props'
26-
version: '{version}'
27-
assembly_version: '{version}'
28-
file_version: '{version}'
29-
informational_version: '{version}$(version_suffix)'
30-
package_version: '{version}$(version_suffix)'
31-
32-
#---------------------------------#
33-
# build configuration #
34-
#---------------------------------#
35-
36-
# scripts to run before build
37-
before_build:
38-
- ps: nuget restore .\GitExtensions.GerritPlugin.sln -Verbosity quiet
39-
40-
# build configuration
41-
configuration: Release
42-
43-
build:
44-
# enable MSBuild parallel builds
45-
parallel: true
46-
# MSBuild verbosity level
47-
verbosity: quiet
48-
49-
#---------------------------------#
50-
# artifacts configuration #
51-
#---------------------------------#
52-
53-
artifacts:
54-
- path: '**\GitExtensions.GerritPlugin.*.nupkg'
55-
name: NuGet
56-
57-
deploy:
58-
- provider: NuGet
59-
name: production
60-
artifact: /GitExtensions.GerritPlugin.*\.nupkg/
61-
api_key:
62-
secure: Cu5mvoCI+zw9j2rAhznAyc+pqunWrR9EodrrLyufOGMF10YahzhvyQWfk72an+Fm
63-
skip_symbols: false
64-
on:
65-
appveyor_repo_tag: true
1+
#---------------------------------#
2+
# general configuration #
3+
#---------------------------------#
4+
5+
# version format
6+
version: 3.2.0.{build}
7+
8+
# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
9+
environment:
10+
# Disable the .NET logo in the console output.
11+
DOTNET_NOLOGO: true
12+
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
13+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
14+
version_suffix: ''
15+
16+
#---------------------------------#
17+
# environment configuration #
18+
#---------------------------------#
19+
20+
nuget:
21+
disable_publish_on_pr: true
22+
23+
# Build worker image (VM template)
24+
image: Visual Studio 2022
25+
26+
# enable patching of Directory.Build.props
27+
dotnet_csproj:
28+
patch: true
29+
file: '**\*.props'
30+
version: '{version}'
31+
assembly_version: '{version}'
32+
file_version: '{version}'
33+
informational_version: '{version}$(version_suffix)'
34+
package_version: '{version}$(version_suffix)'
35+
36+
# Install .NET 10 SDK (not pre-installed on AppVeyor VS2022 image)
37+
install:
38+
- ps: |
39+
# Install the required .NET SDK
40+
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
41+
./dotnet-install.ps1 -JsonFile global.json -InstallDir 'C:\Program Files\dotnet'
42+
# Remove the script so it doesn't "pollute" the build
43+
Remove-Item -Path .\dotnet-install.ps1
44+
45+
#---------------------------------#
46+
# build configuration #
47+
#---------------------------------#
48+
49+
# build configuration
50+
configuration: Release
51+
52+
build_script:
53+
- ps: |
54+
dotnet restore .\GitExtensions.GerritPlugin.sln --verbosity quiet --nologo -bl:restore.binlog
55+
56+
- ps: |
57+
dotnet publish .\GitExtensions.GerritPlugin.sln --configuration Release --no-restore --verbosity quiet --nologo -bl:msbuild.binlog
58+
59+
#---------------------------------#
60+
# artifacts configuration #
61+
#---------------------------------#
62+
63+
artifacts:
64+
- path: '**\GitExtensions.GerritPlugin.*.nupkg'
65+
name: NuGet
66+
- path: '*.binlog'
67+
name: Binlogs
68+
69+
deploy:
70+
- provider: NuGet
71+
name: production
72+
artifact: /GitExtensions.GerritPlugin.*\.nupkg/
73+
api_key:
74+
secure: Cu5mvoCI+zw9j2rAhznAyc+pqunWrR9EodrrLyufOGMF10YahzhvyQWfk72an+Fm
75+
skip_symbols: false
76+
on:
77+
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.GerritPlugin/GitExtensions.GerritPlugin.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
<ItemGroup>
6+
<PackageReference Include="GitExtensions.Extensibility" />
67
<PackageReference Include="JetBrains.Annotations">
78
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
89
</PackageReference>
@@ -60,7 +61,7 @@
6061
<!-- Pack as .nupkg with dependency on GitExtensions.Extensibility -->
6162
<PropertyGroup>
6263
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
63-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
64+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6465
<PackageIcon>IconGerrit.png</PackageIcon>
6566
<PackageReadmeFile>README.md</PackageReadmeFile>
6667
<RepositoryUrl>https://github.com/gitextensions/GitExtensions.GerritPlugin</RepositoryUrl>

src/GitExtensions.GerritPlugin/GitExtensions.GerritPlugin.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<tags>$tags$</tags>
1111
<icon>Resources\IconGerrit.png</icon>
1212
<dependencies>
13-
<group targetFramework="net10.0-windows">
13+
<group targetFramework="net10.0-windows7.0">
1414
<dependency id="GitExtensions.Extensibility" version="[1.0.0, 1.1.0)" />
1515
</group>
1616
</dependencies>
1717
</metadata>
1818
<files>
1919
<file src="..\..\LICENSE.md" target="\" />
20-
<file src="bin\$configuration$\net10.0-windows\GitExtensions.GerritPlugin.dll" target="\lib\" />
20+
<file src="bin\$configuration$\net10.0-windows\GitExtensions.GerritPlugin.dll" target="\lib\net10.0-windows7.0\" />
2121
<file src="Resources\IconGerrit.png" target="\Resources\" />
2222
</files>
2323
</package>

0 commit comments

Comments
 (0)