Skip to content

Commit e6daaf7

Browse files
authored
Merge pull request #506 from punker76/targetframeworks
Set target to net462, net6 and net8
2 parents 2e203bc + 1ac2daa commit e6daaf7

17 files changed

+125
-80
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "3.1.0",
6+
"version": "4.0.0",
77
"commands": [
88
"dotnet-cake"
99
]

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
uses: actions/setup-dotnet@v1
2121
with:
2222
dotnet-version: |
23-
5.x
2423
6.x
24+
8.x
25+
9.x
2526
- name: List dotnet sdks
26-
run: dotnet --list-sdks
27+
run: dotnet --info
2728
- name: Run the Cake script
2829
uses: cake-build/cake-action@v1
2930
with:

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
assembly-versioning-scheme: Major
22
assembly-file-versioning-scheme: MajorMinorPatchTag
3-
next-version: 3.2.0
3+
next-version: 4.0.0
44
mode: ContinuousDeployment
55
branches:
66
master:

NuGet.Config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@
1515
<clear />
1616
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
1717
</activePackageSource>
18+
<packageSourceMapping>
19+
<packageSource key="nuget.org">
20+
<package pattern="*" />
21+
</packageSource>
22+
</packageSourceMapping>
1823
</configuration>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
An easy to use drag'n'drop framework for WPF.
1111
</p>
1212
<p>
13-
Supporting .NET Framework 4.6.2+, .NET Core 3.1, .NET 5 and .NET 6 (on Windows)
13+
Supporting .NET Framework 4.6.2 and later, .NET 6 and later (on Windows)
1414
</p>
1515

1616
<a href="https://gitter.im/punker76/gong-wpf-dragdrop">

appveyor.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ branches:
66
- main
77

88
environment:
9+
# bad, but without this, gitversion doesn't work anymore
10+
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
911
azure-key-vault-url:
1012
secure: 1mKS/HfCVq+iYNRVSrrN8NEowOkKt3knrpMzw+SOy3g=
1113
azure-key-vault-client-id:
@@ -17,28 +19,20 @@ environment:
1719
azure-key-vault-certificate:
1820
secure: BSPdW2TgnQtoQXXbeDECug==
1921

20-
skip_tags: true
2122
image: Visual Studio 2022
22-
test: off
23-
24-
install:
25-
# Appveyor uses git checkout -qf FETCH_HEAD but all GitVersion versions above 5.6.3 doesn't support this detached header
26-
# This is a workaround for this issue
27-
- ps: |
28-
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne "")
29-
{
30-
git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)
31-
}
23+
test: false
24+
25+
# install:
3226
# - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
33-
# - ps: ./dotnet-install.ps1 -Version 6.0.100 -InstallDir "C:\Program Files\dotnet"
27+
# - ps: ./dotnet-install.ps1 -Version 8.0.403 -InstallDir "C:\Program Files\dotnet"
3428

3529
pull_requests:
3630
do_not_increment_build_number: false
3731

3832
build_script:
39-
- ps: dotnet --list-sdks
33+
- ps: dotnet --info
4034
- ps: gitversion /version
41-
- ps: .\build.ps1 --target=ci #--verbosity=diagnostic
35+
- ps: .\build.ps1 --target=ci --verbosity=diagnostic
4236

4337
artifacts:
4438
- path: \Publish\*.*

build.cake

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
///////////////////////////////////////////////////////////////////////////////
44

55
#tool dotnet:?package=NuGetKeyVaultSignTool&version=3.2.3
6-
#tool dotnet:?package=AzureSignTool&version=4.0.1
7-
#tool dotnet:?package=GitReleaseManager.Tool&version=0.15.0
6+
#tool dotnet:?package=AzureSignTool&version=6.0.0
7+
#tool dotnet:?package=GitReleaseManager.Tool&version=0.17.0
88
#tool dotnet:?package=XamlStyler.Console&version=3.2206.4
99

1010
#tool nuget:?package=GitVersion.CommandLine&version=5.12.0
1111

12-
#addin nuget:?package=Cake.Figlet&version=2.0.1
13-
1412
///////////////////////////////////////////////////////////////////////////////
1513
// ARGUMENTS
1614
///////////////////////////////////////////////////////////////////////////////
@@ -37,8 +35,8 @@ public class BuildData
3735
public DotNetVerbosity DotNetVerbosity { get; }
3836
public bool IsLocalBuild { get; set; }
3937
public bool IsPullRequest { get; set; }
40-
public bool IsDevelopBranch { get; set; }
41-
public bool IsReleaseBranch { get; set; }
38+
public bool IsPrerelease { get; set; }
39+
public bool IsRunningOnCI { get; set; }
4240
public GitVersion GitVersion { get; set; }
4341

4442
public BuildData(
@@ -55,9 +53,7 @@ public class BuildData
5553
public void SetGitVersion(GitVersion gitVersion)
5654
{
5755
GitVersion = gitVersion;
58-
59-
IsDevelopBranch = StringComparer.OrdinalIgnoreCase.Equals("develop", GitVersion.BranchName);
60-
IsReleaseBranch = StringComparer.OrdinalIgnoreCase.Equals("main", GitVersion.BranchName);
56+
IsPrerelease = GitVersion.NuGetVersion.Contains("-");
6157
}
6258
}
6359

@@ -72,10 +68,9 @@ Setup<BuildData>(ctx =>
7268
throw new NotImplementedException($"{repoName} will only build on Windows because it's not possible to target WPF and Windows Forms from UNIX.");
7369
}
7470

75-
Information(Figlet(repoName));
71+
Spectre.Console.AnsiConsole.Write(new Spectre.Console.FigletText(repoName));
7672

7773
var gitVersionPath = Context.Tools.Resolve("gitversion.exe");
78-
7974
Information("GitVersion : {0}", gitVersionPath);
8075

8176
var buildData = new BuildData(
@@ -85,6 +80,7 @@ Setup<BuildData>(ctx =>
8580
)
8681
{
8782
IsLocalBuild = BuildSystem.IsLocalBuild,
83+
IsRunningOnCI = BuildSystem.GitHubActions.IsRunningOnGitHubActions || BuildSystem.AppVeyor.IsRunningOnAppVeyor,
8884
IsPullRequest =
8985
(BuildSystem.GitHubActions.IsRunningOnGitHubActions && BuildSystem.GitHubActions.Environment.PullRequest.IsPullRequest)
9086
|| (BuildSystem.AppVeyor.IsRunningOnAppVeyor && BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest)
@@ -97,15 +93,19 @@ Setup<BuildData>(ctx =>
9793
}
9894
buildData.SetGitVersion(GitVersion(new GitVersionSettings { ToolPath = gitVersionPath, OutputType = GitVersionOutput.Json }));
9995

96+
Information("GitVersion : {0}", gitVersionPath);
10097
Information("Branch : {0}", buildData.GitVersion.BranchName);
10198
Information("Configuration : {0}", buildData.Configuration);
102-
Information("IsLocalBuild : {0}", buildData.IsLocalBuild);
99+
Information("IsRunningOnCI : {0}", buildData.IsRunningOnCI);
100+
Information("IsPrerelease : {0}", buildData.IsPrerelease);
101+
Information("IsPrerelease : {0}", buildData.IsPrerelease);
103102
Information("Informational Version: {0}", buildData.GitVersion.InformationalVersion);
104103
Information("SemVer Version: {0}", buildData.GitVersion.SemVer);
105104
Information("AssemblySemVer Version: {0}", buildData.GitVersion.AssemblySemVer);
106105
Information("MajorMinorPatch Version: {0}", buildData.GitVersion.MajorMinorPatch);
107106
Information("NuGet Version: {0}", buildData.GitVersion.NuGetVersion);
108107
Information("Verbosity : {0}", buildData.Verbosity);
108+
Information("Publish folder : {0}", publishDir);
109109

110110
return buildData;
111111
});
@@ -141,11 +141,11 @@ Task("Build")
141141
var msbuildSettings = new DotNetMSBuildSettings
142142
{
143143
MaxCpuCount = 0,
144-
Version = data.IsReleaseBranch ? data.GitVersion.MajorMinorPatch : data.GitVersion.NuGetVersion,
144+
Version = data.GitVersion.NuGetVersion,
145145
AssemblyVersion = data.GitVersion.AssemblySemVer,
146146
FileVersion = data.GitVersion.AssemblySemFileVer,
147147
InformationalVersion = data.GitVersion.InformationalVersion,
148-
ContinuousIntegrationBuild = data.IsReleaseBranch,
148+
ContinuousIntegrationBuild = data.IsRunningOnCI,
149149
ArgumentCustomization = args => args.Append("/m").Append("/nr:false") // The /nr switch tells msbuild to quite once it's done
150150
};
151151
// msbuildSettings.FileLoggers.Add(
@@ -177,10 +177,11 @@ Task("Pack")
177177
var msbuildSettings = new DotNetMSBuildSettings
178178
{
179179
MaxCpuCount = 0,
180-
Version = data.IsReleaseBranch ? data.GitVersion.MajorMinorPatch : data.GitVersion.NuGetVersion,
180+
Version = data.GitVersion.NuGetVersion,
181181
AssemblyVersion = data.GitVersion.AssemblySemVer,
182182
FileVersion = data.GitVersion.AssemblySemFileVer,
183-
InformationalVersion = data.GitVersion.InformationalVersion
183+
InformationalVersion = data.GitVersion.InformationalVersion,
184+
ContinuousIntegrationBuild = data.IsRunningOnCI
184185
}
185186
.WithProperty("IncludeBuildOutput", "true")
186187
.WithProperty("RepositoryBranch", data.GitVersion.BranchName)
@@ -211,7 +212,7 @@ Task("Pack")
211212
Task("Sign")
212213
.WithCriteria<BuildData>((context, data) => !data.IsPullRequest)
213214
.ContinueOnError()
214-
.Does(() =>
215+
.Does<BuildData>(data =>
215216
{
216217
var files = GetFiles("./src/GongSolutions.WPF.DragDrop/bin/**/*/GongSolutions.WPF.DragDrop.dll");
217218
SignFiles(files, "GongSolutions.WPF.DragDrop, an easy to use drag'n'drop framework for WPF applications.");
@@ -312,7 +313,7 @@ Task("CreateRelease")
312313
GitReleaseManagerCreate(token, "punker76", repoName, new GitReleaseManagerCreateSettings {
313314
Milestone = data.GitVersion.MajorMinorPatch,
314315
Name = data.GitVersion.AssemblySemFileVer,
315-
Prerelease = data.IsDevelopBranch,
316+
Prerelease = data.IsPrerelease,
316317
TargetCommitish = data.GitVersion.BranchName,
317318
WorkingDirectory = "."
318319
});

cake.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Modules=./tools/Modules
1414
[Settings]
1515
SkipVerification=false
1616
SkipPackageVersionCheck=true
17+
ShowProcessCommandLine=true

global.json

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

src/Directory.build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Project properties -->
99
<PropertyGroup>
10-
<TargetFrameworks>net462;net47;net48;net5.0-windows;net6.0-windows</TargetFrameworks>
10+
<TargetFrameworks>net8.0-windows;net6.0-windows;net462</TargetFrameworks>
1111
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
1212
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1313
<AutoGenerateBindingRedirects Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">true</AutoGenerateBindingRedirects>

0 commit comments

Comments
 (0)