-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43f6b69
commit e23708e
Showing
9 changed files
with
157 additions
and
30 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,36 +1,28 @@ | ||
#Ignore thumbnails created by Windows | ||
#windows | ||
Thumbs.db | ||
|
||
#Ignore metadata created by OSX | ||
#osx | ||
.DS_Store | ||
._* | ||
|
||
#Ignore files created by Visual Studio | ||
#visual-studio | ||
.vs/ | ||
*.user | ||
*.suo | ||
*.tmp_proj | ||
*.dbmdl | ||
*.dbproj.schemaview | ||
*.cache | ||
*.vsdoc | ||
[Oo]bj/ | ||
[Bb]in/ | ||
[Dd]ebug/ | ||
[Rr]elease/ | ||
[Rr][Cc]/ | ||
[Cc]ode[Cc]overage/ | ||
[Ff]x[Cc]op/ | ||
[Ll]og/ | ||
[Tt]emp/ | ||
|
||
# Ignore NuGet Packages | ||
#nuget | ||
*.nupkg | ||
**/packages/* | ||
|
||
#Ignore files created by ReSharper | ||
_ReSharper*/ | ||
|
||
#Ignore files created by NUnit | ||
TestResult.xml | ||
*.VisualState.xml | ||
#cake | ||
/build/* | ||
/tools/* |
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,105 @@ | ||
#tool "nuget:?package=NuGet.CommandLine&version=5.8.0" | ||
#addin "nuget:?package=Cake.MinVer&version=0.1.0" | ||
|
||
var target = Argument<string>("target", "pack"); | ||
var buildVersion = MinVer(s => s.WithTagPrefix("v").WithDefaultPreReleasePhase("preview")); | ||
|
||
Task("clean") | ||
.Does(() => | ||
{ | ||
CleanDirectory("./build/artifacts"); | ||
CleanDirectories("./src/**/bin"); | ||
CleanDirectories("./src/**/obj"); | ||
CleanDirectories("./test/**/bin"); | ||
CleanDirectories("./test/**/obj"); | ||
}); | ||
|
||
Task("restore") | ||
.IsDependentOn("clean") | ||
.Does(() => | ||
{ | ||
NuGetRestore("./Ookii.Dialogs.WinForms.sln", new NuGetRestoreSettings | ||
{ | ||
NoCache = true, | ||
}); | ||
}); | ||
|
||
Task("build") | ||
.IsDependentOn("restore") | ||
.Does(() => | ||
{ | ||
var assemblyVersionInfoFile = FilePath.FromString("./src/Ookii.Dialogs.WinForms/Properties/AssemblyVersionInfo.cs"); | ||
var assemblyVersionInfoBytes = System.IO.File.ReadAllBytes(assemblyVersionInfoFile.FullPath); | ||
|
||
try | ||
{ | ||
CreateAssemblyInfo(assemblyVersionInfoFile, new AssemblyInfoSettings | ||
{ | ||
Version = buildVersion.AssemblyVersion, | ||
FileVersion = buildVersion.FileVersion, | ||
InformationalVersion = buildVersion.PackageVersion, | ||
}); | ||
|
||
MSBuild("./Ookii.Dialogs.WinForms.sln", new MSBuildSettings | ||
{ | ||
Configuration = "Debug", | ||
ToolVersion = MSBuildToolVersion.VS2019, | ||
}.WithTarget("Rebuild")); | ||
|
||
MSBuild("./Ookii.Dialogs.WinForms.sln", new MSBuildSettings | ||
{ | ||
Configuration = "Release", | ||
ToolVersion = MSBuildToolVersion.VS2019, | ||
}.WithTarget("Rebuild")); | ||
} | ||
finally | ||
{ | ||
System.IO.File.WriteAllBytes(assemblyVersionInfoFile.FullPath, assemblyVersionInfoBytes); | ||
} | ||
}); | ||
|
||
Task("pack") | ||
.IsDependentOn("build") | ||
.Does(() => | ||
{ | ||
var releaseNotes = $"https://github.com/augustoproiete/ookii-dialogs-winforms/releases/tag/v{buildVersion.PackageVersion}"; | ||
|
||
NuGetPack("./src/Ookii.Dialogs.WinForms/Ookii.Dialogs.WinForms.nuspec", new NuGetPackSettings | ||
{ | ||
Version = buildVersion.PackageVersion, | ||
OutputDirectory = "./build/artifacts", | ||
ReleaseNotes = new[] { releaseNotes }, | ||
}); | ||
}); | ||
|
||
Task("publish") | ||
.IsDependentOn("pack") | ||
.Does(context => | ||
{ | ||
var url = context.EnvironmentVariable("NUGET_URL"); | ||
if (string.IsNullOrWhiteSpace(url)) | ||
{ | ||
context.Information("No NuGet URL specified. Skipping publishing of NuGet packages"); | ||
return; | ||
} | ||
|
||
var apiKey = context.EnvironmentVariable("NUGET_API_KEY"); | ||
if (string.IsNullOrWhiteSpace(apiKey)) | ||
{ | ||
context.Information("No NuGet API key specified. Skipping publishing of NuGet packages"); | ||
return; | ||
} | ||
|
||
var nugetPushSettings = new DotNetCoreNuGetPushSettings | ||
{ | ||
Source = url, | ||
ApiKey = apiKey, | ||
}; | ||
|
||
foreach (var nugetPackageFile in GetFiles("./build/artifacts/*.nupkg")) | ||
{ | ||
DotNetCoreNuGetPush(nugetPackageFile.FullPath, nugetPushSettings); | ||
} | ||
}); | ||
|
||
RunTarget(target); |
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,11 @@ | ||
@echo on | ||
@cd %~dp0 | ||
|
||
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
set DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
set DOTNET_NOLOGO=1 | ||
|
||
dotnet tool restore | ||
@if %ERRORLEVEL% neq 0 goto :eof | ||
|
||
dotnet cake --verbosity=diagnostic %* |
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,10 @@ | ||
#!/usr/bin/env bash | ||
set -euox pipefail | ||
|
||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
export DOTNET_NOLOGO=1 | ||
|
||
dotnet tool restore | ||
|
||
dotnet cake --verbosity=diagnostic $@ |
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,12 @@ | ||
[Nuget] | ||
Source=https://api.nuget.org/v3/index.json | ||
UseInProcessClient=true | ||
LoadDependencies=false | ||
|
||
[Paths] | ||
Tools=./tools | ||
Addins=./tools/addins | ||
Modules=./tools/modules | ||
|
||
[Settings] | ||
SkipVerification=false |
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
10 changes: 10 additions & 0 deletions
10
src/Ookii.Dialogs.WinForms/Properties/AssemblyVersionInfo.cs
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,10 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by Cake. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] | ||
[assembly: AssemblyInformationalVersion("1.0.0.0")] |