Added nuke build
This commit is contained in:
Родитель
9f6d9d5317
Коммит
cf1052aefb
|
@ -43,17 +43,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{D83B9ECD
|
|||
ProjectSection(SolutionItems) = preProject
|
||||
build\Avalonia.Desktop.props = build\Avalonia.Desktop.props
|
||||
build\Avalonia.props = build\Avalonia.props
|
||||
build\NetFX.props = build\NetFX.props
|
||||
build\Rx.props = build\Rx.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ci", "ci", "{32DB24AD-BD3C-4F4B-B44D-75C488A04142}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
_config.yml = _config.yml
|
||||
appveyor.yml = appveyor.yml
|
||||
azure-pipelines.yml = azure-pipelines.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.ViewBox", "src\Avalonia.Controls.ViewBox\Avalonia.Controls.ViewBox.csproj", "{35B9AD6F-290C-4932-9900-D51721966E93}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "git", "git", "{10DDB443-E910-47C5-B1C1-1ED769BE9834}"
|
||||
|
@ -127,7 +119,6 @@ Global
|
|||
{670F5FF3-999F-450B-8F31-8AB62A43DCEF} = {6E241F85-FE51-47E5-B9C2-50AAA7FEC499}
|
||||
{E16CD9A4-AA47-4440-9EB7-B9E8E59EBFC5} = {6E241F85-FE51-47E5-B9C2-50AAA7FEC499}
|
||||
{D83B9ECD-F143-4A6C-AFD7-F961174D824C} = {6E241F85-FE51-47E5-B9C2-50AAA7FEC499}
|
||||
{32DB24AD-BD3C-4F4B-B44D-75C488A04142} = {6E241F85-FE51-47E5-B9C2-50AAA7FEC499}
|
||||
{35B9AD6F-290C-4932-9900-D51721966E93} = {3FBE9035-8FFD-447D-949A-8E63AF15B89A}
|
||||
{10DDB443-E910-47C5-B1C1-1ED769BE9834} = {6E241F85-FE51-47E5-B9C2-50AAA7FEC499}
|
||||
EndGlobalSection
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
[![Gitter](https://badges.gitter.im/wieslawsoltes/PanAndZoom.svg)](https://gitter.im/wieslawsoltes/PanAndZoom?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
[![Build status](https://ci.appveyor.com/api/projects/status/mbwd4i983lkc15c0/branch/master?svg=true)](https://ci.appveyor.com/project/wieslawsoltes/panandzoom/branch/master)
|
||||
[![Build Status](https://dev.azure.com/wieslawsoltes/PanAndZoom/_apis/build/status/wieslawsoltes.PanAndZoom)](https://dev.azure.com/wieslawsoltes/PanAndZoom/_build/latest?definitionId=1)
|
||||
|
||||
[![NuGet](https://img.shields.io/nuget/v/Avalonia.Controls.PanAndZoom.svg)](https://www.nuget.org/packages/Avalonia.Controls.PanAndZoom)
|
||||
|
|
36
appveyor.yml
36
appveyor.yml
|
@ -1,36 +0,0 @@
|
|||
version: '{build}'
|
||||
image: Visual Studio 2017
|
||||
skip_branch_with_pr: true
|
||||
configuration: Release
|
||||
platform: Any CPU
|
||||
environment:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
NUGET_API_KEY:
|
||||
secure: iSkm19DNdKOLxxCvHiaKikWXy25ZMwGBKpv+EgEprliGl0qX5HtKohLmwJsLnx5O
|
||||
NUGET_API_URL: https://www.nuget.org/api/v2/package
|
||||
MYGET_API_KEY:
|
||||
secure: xhYvrWYPHdNI+mQD+f4Zu3baL7fqW+nO/hYXJdN070Lej8wpa6gfrLi1NGtnQlAs
|
||||
MYGET_API_URL: https://www.myget.org/F/panandzoom-nightly/api/v2/package
|
||||
install:
|
||||
- if not exist dotnet-sdk-2.1.401-win-x64.exe appveyor DownloadFile https://download.microsoft.com/download/E/8/A/E8AF2EE0-5DDA-4420-A395-D1A50EEFD83E/dotnet-sdk-2.1.401-win-x64.exe -FileName "dotnet-sdk-2.1.401-win-x64.exe"
|
||||
- ps: Start-Process -FilePath "dotnet-sdk-2.1.401-win-x64.exe" -ArgumentList "/quiet" -Wait
|
||||
- cmd: dotnet --info
|
||||
- cmd: dotnet tool install -g Cake.Tool --version 0.30.0
|
||||
before_build:
|
||||
- cmd: git submodule update --init
|
||||
build_script:
|
||||
- cmd: dotnet cake build.cake -Target="AppVeyor" -Platform="%PLATFORM%" -Configuration="%CONFIGURATION%"
|
||||
test: off
|
||||
notifications:
|
||||
- provider: Webhook
|
||||
url: https://webhooks.gitter.im/e/6ef347bda74add05c258
|
||||
method: POST
|
||||
on_build_success: true
|
||||
on_build_failure: true
|
||||
on_build_status_changed: true
|
||||
artifacts:
|
||||
- path: artifacts\test-results\*.xml
|
||||
- path: artifacts\nuget\*.nupkg
|
||||
cache:
|
||||
- dotnet-sdk-2.1.401-win-x64.exe
|
|
@ -1,49 +0,0 @@
|
|||
jobs:
|
||||
- job: Linux
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
steps:
|
||||
- task: DotNetCoreInstaller@0
|
||||
inputs:
|
||||
version: '2.1.401'
|
||||
- script: |
|
||||
export COREHOST_TRACE=0
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
which dotnet
|
||||
dotnet --info
|
||||
dotnet tool install -g Cake.Tool --version 0.30.0
|
||||
export PATH="$PATH:$HOME/.dotnet/tools"
|
||||
dotnet cake build.cake -Target="Azure-Linux" -Platform="Any CPU" -Configuration="Release"
|
||||
- job: macOS
|
||||
pool:
|
||||
vmImage: 'xcode9-macos10.13'
|
||||
steps:
|
||||
- task: DotNetCoreInstaller@0
|
||||
inputs:
|
||||
version: '2.1.401'
|
||||
- script: |
|
||||
export COREHOST_TRACE=0
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
which dotnet
|
||||
dotnet --info
|
||||
dotnet tool install -g Cake.Tool --version 0.30.0
|
||||
export PATH="$PATH:$HOME/.dotnet/tools"
|
||||
dotnet cake build.cake -Target="Azure-macOS" -Platform="Any CPU" -Configuration="Release"
|
||||
- job: Windows
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
steps:
|
||||
- task: DotNetCoreInstaller@0
|
||||
inputs:
|
||||
version: '2.1.401'
|
||||
- script: |
|
||||
set COREHOST_TRACE=0
|
||||
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
set DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
where dotnet
|
||||
dotnet --info
|
||||
dotnet tool install -g Cake.Tool --version 0.30.0
|
||||
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
|
||||
dotnet cake build.cake -Target="Azure-Windows" -Platform="Any CPU" -Configuration="Release"
|
549
build.cake
549
build.cake
|
@ -1,549 +0,0 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ADDINS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#addin "nuget:?package=Polly&version=5.3.1"
|
||||
#addin "nuget:?package=PackageReferenceEditor&version=0.0.3"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TOOLS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#tool "nuget:?package=NuGet.CommandLine&version=4.3.0"
|
||||
#tool "nuget:?package=xunit.runner.console&version=2.3.1"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// USINGS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using PackageReferenceEditor;
|
||||
using Polly;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ARGUMENTS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var target = Argument("target", "Default");
|
||||
var platform = Argument("platform", "Any CPU");
|
||||
var configuration = Argument("configuration", "Release");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CONFIGURATION
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var MainRepo = "wieslawsoltes/PanAndZoom";
|
||||
var MasterBranch = "master";
|
||||
var AssemblyInfoPath = File("./src/Shared/SharedAssemblyInfo.cs");
|
||||
var ReleasePlatform = "Any CPU";
|
||||
var ReleaseConfiguration = "Release";
|
||||
var MSBuildSolution = "./PanAndZoom.sln";
|
||||
var UnitTestsFramework = "net461";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// .NET Core Projects
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var netCoreAppsRoot= "./samples";
|
||||
var netCoreApps = new string[] { "AvaloniaDemo" };
|
||||
var netCoreProjects = netCoreApps.Select(name =>
|
||||
new {
|
||||
Path = string.Format("{0}/{1}", netCoreAppsRoot, name),
|
||||
Name = name,
|
||||
Framework = XmlPeek(string.Format("{0}/{1}/{1}.csproj", netCoreAppsRoot, name), "//*[local-name()='TargetFramework']/text()"),
|
||||
Runtimes = XmlPeek(string.Format("{0}/{1}/{1}.csproj", netCoreAppsRoot, name), "//*[local-name()='RuntimeIdentifiers']/text()").Split(';')
|
||||
}).ToList();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// .NET Core UnitTests
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var netCoreUnitTestsRoot= "./tests";
|
||||
var netCoreUnitTests = new string[] {
|
||||
};
|
||||
var netCoreUnitTestsProjects = netCoreUnitTests.Select(name =>
|
||||
new {
|
||||
Name = name,
|
||||
Path = string.Format("{0}/{1}", netCoreUnitTestsRoot, name),
|
||||
File = string.Format("{0}/{1}/{1}.csproj", netCoreUnitTestsRoot, name)
|
||||
}).ToList();
|
||||
var netCoreUnitTestsFrameworks = new List<string>() { "netcoreapp2.0" };
|
||||
if (IsRunningOnWindows())
|
||||
{
|
||||
netCoreUnitTestsFrameworks.Add("net461");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// PARAMETERS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var isPlatformAnyCPU = StringComparer.OrdinalIgnoreCase.Equals(platform, "Any CPU");
|
||||
var isPlatformX86 = StringComparer.OrdinalIgnoreCase.Equals(platform, "x86");
|
||||
var isPlatformX64 = StringComparer.OrdinalIgnoreCase.Equals(platform, "x64");
|
||||
var isLocalBuild = BuildSystem.IsLocalBuild;
|
||||
var isRunningOnUnix = IsRunningOnUnix();
|
||||
var isRunningOnWindows = IsRunningOnWindows();
|
||||
var isRunningOnAppVeyor = BuildSystem.AppVeyor.IsRunningOnAppVeyor;
|
||||
var isPullRequest = BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
|
||||
var isMainRepo = StringComparer.OrdinalIgnoreCase.Equals(MainRepo, BuildSystem.AppVeyor.Environment.Repository.Name);
|
||||
var isMasterBranch = StringComparer.OrdinalIgnoreCase.Equals(MasterBranch, BuildSystem.AppVeyor.Environment.Repository.Branch);
|
||||
var isTagged = BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag
|
||||
&& !string.IsNullOrWhiteSpace(BuildSystem.AppVeyor.Environment.Repository.Tag.Name);
|
||||
var isReleasable = StringComparer.OrdinalIgnoreCase.Equals(ReleasePlatform, platform)
|
||||
&& StringComparer.OrdinalIgnoreCase.Equals(ReleaseConfiguration, configuration);
|
||||
var isMyGetRelease = !isTagged && isReleasable;
|
||||
var isNuGetRelease = isTagged && isReleasable;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// VERSION
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var version = ParseAssemblyInfo(AssemblyInfoPath).AssemblyVersion;
|
||||
|
||||
if (isRunningOnAppVeyor)
|
||||
{
|
||||
if (isTagged)
|
||||
{
|
||||
// Use Tag Name as version
|
||||
version = BuildSystem.AppVeyor.Environment.Repository.Tag.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use AssemblyVersion with Build as version
|
||||
version += "-build" + EnvironmentVariable("APPVEYOR_BUILD_NUMBER");
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// DIRECTORIES
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var artifactsDir = (DirectoryPath)Directory("./artifacts");
|
||||
var testResultsDir = artifactsDir.Combine("test-results");
|
||||
var nugetRoot = artifactsDir.Combine("nuget");
|
||||
var dirSuffix = isPlatformAnyCPU ? configuration : platform + "/" + configuration;
|
||||
var buildDirs =
|
||||
GetDirectories("./src/**/bin/" + dirSuffix) +
|
||||
GetDirectories("./src/**/obj/" + dirSuffix) +
|
||||
GetDirectories("./samples/**/bin/" + dirSuffix) +
|
||||
GetDirectories("./samples/**/obj/" + dirSuffix) +
|
||||
GetDirectories("./tests/**/bin/" + dirSuffix) +
|
||||
GetDirectories("./tests/**/obj/" + dirSuffix);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// NUGET NUSPECS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var result = Updater.FindReferences("./build", "*.props", new string[] { });
|
||||
|
||||
result.ValidateVersions();
|
||||
|
||||
Information("Setting NuGet package dependencies versions:");
|
||||
|
||||
var AvaloniaVersion = result.GroupedReferences["Avalonia"].FirstOrDefault().Version;
|
||||
|
||||
Information("Package: Avalonia, version: {0}", AvaloniaVersion);
|
||||
|
||||
var nuspecNuGet = new NuGetPackSettings()
|
||||
{
|
||||
Id = "PanAndZoom",
|
||||
Version = version,
|
||||
Authors = new [] { "wieslawsoltes" },
|
||||
Owners = new [] { "wieslawsoltes" },
|
||||
LicenseUrl = new Uri("http://opensource.org/licenses/MIT"),
|
||||
ProjectUrl = new Uri("https://github.com/wieslawsoltes/PanAndZoom/"),
|
||||
RequireLicenseAcceptance = false,
|
||||
Symbols = false,
|
||||
NoPackageAnalysis = true,
|
||||
Description = "Easily add pan and zoom functionality to your Avalonia apps using PanAndZoom control.",
|
||||
Copyright = "Copyright 2017",
|
||||
Tags = new [] { "Pan", "Zoom", "Control", "Xaml", "Managed", "C#" },
|
||||
Files = new []
|
||||
{
|
||||
// netstandard2.0
|
||||
new NuSpecContent { Source = "src/PanAndZoom/bin/" + dirSuffix + "/netstandard2.0/" + "PanAndZoom.dll", Target = "lib/netstandard2.0" },
|
||||
new NuSpecContent { Source = "src/PanAndZoom/bin/" + dirSuffix + "/netstandard2.0/" + "PanAndZoom.xml", Target = "lib/netstandard2.0" },
|
||||
// net45
|
||||
new NuSpecContent { Source = "src/PanAndZoom/bin/" + dirSuffix + "/net45/" + "PanAndZoom.dll", Target = "lib/net45" },
|
||||
new NuSpecContent { Source = "src/PanAndZoom/bin/" + dirSuffix + "/net45/" + "PanAndZoom.xml", Target = "lib/net45" }
|
||||
},
|
||||
BasePath = Directory("./"),
|
||||
OutputDirectory = nugetRoot
|
||||
};
|
||||
|
||||
var nuspecNuGetAvaloniaPanAndZoom = new NuGetPackSettings()
|
||||
{
|
||||
Id = "Avalonia.Controls.PanAndZoom",
|
||||
Version = version,
|
||||
Authors = new [] { "wieslawsoltes" },
|
||||
Owners = new [] { "wieslawsoltes" },
|
||||
LicenseUrl = new Uri("http://opensource.org/licenses/MIT"),
|
||||
ProjectUrl = new Uri("https://github.com/wieslawsoltes/PanAndZoom/"),
|
||||
RequireLicenseAcceptance = false,
|
||||
Symbols = false,
|
||||
NoPackageAnalysis = true,
|
||||
Description = "Easily add pan and zoom functionality to your Avalonia apps using PanAndZoom control.",
|
||||
Copyright = "Copyright 2017",
|
||||
Tags = new [] { "Avalonia", "Pan", "Zoom", "Control", "Xaml", "Managed", "C#" },
|
||||
Dependencies = new []
|
||||
{
|
||||
new NuSpecDependency { Id = "PanAndZoom", Version = version },
|
||||
new NuSpecDependency { Id = "Avalonia", Version = AvaloniaVersion }
|
||||
},
|
||||
Files = new []
|
||||
{
|
||||
// netstandard2.0
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.PanAndZoom/bin/" + dirSuffix + "/netstandard2.0/" + "Avalonia.Controls.PanAndZoom.dll", Target = "lib/netstandard2.0" },
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.PanAndZoom/bin/" + dirSuffix + "/netstandard2.0/" + "Avalonia.Controls.PanAndZoom.xml", Target = "lib/netstandard2.0" },
|
||||
// net461
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.PanAndZoom/bin/" + dirSuffix + "/net461/" + "Avalonia.Controls.PanAndZoom.dll", Target = "lib/net461" },
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.PanAndZoom/bin/" + dirSuffix + "/net461/" + "Avalonia.Controls.PanAndZoom.xml", Target = "lib/net461" }
|
||||
},
|
||||
BasePath = Directory("./"),
|
||||
OutputDirectory = nugetRoot
|
||||
};
|
||||
|
||||
|
||||
var nuspecNuGetAvaloniaViewBox = new NuGetPackSettings()
|
||||
{
|
||||
Id = "Avalonia.Controls.ViewBox",
|
||||
Version = version,
|
||||
Authors = new [] { "wieslawsoltes" },
|
||||
Owners = new [] { "wieslawsoltes" },
|
||||
LicenseUrl = new Uri("http://opensource.org/licenses/MIT"),
|
||||
ProjectUrl = new Uri("https://github.com/wieslawsoltes/PanAndZoom/"),
|
||||
RequireLicenseAcceptance = false,
|
||||
Symbols = false,
|
||||
NoPackageAnalysis = true,
|
||||
Description = "ViewBox control for Avalonia apps.",
|
||||
Copyright = "Copyright 2018",
|
||||
Tags = new [] { "Avalonia", "ViewBox", "Control", "Xaml", "Managed", "C#" },
|
||||
Dependencies = new []
|
||||
{
|
||||
new NuSpecDependency { Id = "Avalonia", Version = AvaloniaVersion }
|
||||
},
|
||||
Files = new []
|
||||
{
|
||||
// netstandard2.0
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.ViewBox/bin/" + dirSuffix + "/netstandard2.0/" + "Avalonia.Controls.ViewBox.dll", Target = "lib/netstandard2.0" },
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.ViewBox/bin/" + dirSuffix + "/netstandard2.0/" + "Avalonia.Controls.ViewBox.xml", Target = "lib/netstandard2.0" },
|
||||
// net461
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.ViewBox/bin/" + dirSuffix + "/net461/" + "Avalonia.Controls.ViewBox.dll", Target = "lib/net461" },
|
||||
new NuSpecContent { Source = "src/Avalonia.Controls.ViewBox/bin/" + dirSuffix + "/net461/" + "Avalonia.Controls.ViewBox.xml", Target = "lib/net461" }
|
||||
},
|
||||
BasePath = Directory("./"),
|
||||
OutputDirectory = nugetRoot
|
||||
};
|
||||
|
||||
|
||||
var nuspecNuGetWpf = new NuGetPackSettings()
|
||||
{
|
||||
Id = "Wpf.Controls.PanAndZoom",
|
||||
Version = version,
|
||||
Authors = new [] { "wieslawsoltes" },
|
||||
Owners = new [] { "wieslawsoltes" },
|
||||
LicenseUrl = new Uri("http://opensource.org/licenses/MIT"),
|
||||
ProjectUrl = new Uri("https://github.com/wieslawsoltes/PanAndZoom/"),
|
||||
RequireLicenseAcceptance = false,
|
||||
Symbols = false,
|
||||
NoPackageAnalysis = true,
|
||||
Description = "Easily add pan and zoom functionality to your WPF apps using PanAndZoom control.",
|
||||
Copyright = "Copyright 2017",
|
||||
Tags = new [] { "WPF", "Pan", "Zoom", "Control", "Xaml", "Managed", "C#" },
|
||||
Dependencies = new []
|
||||
{
|
||||
new NuSpecDependency { Id = "PanAndZoom", Version = version }
|
||||
},
|
||||
Files = new []
|
||||
{
|
||||
// net45
|
||||
new NuSpecContent { Source = "src/Wpf.Controls.PanAndZoom/bin/" + dirSuffix + "/net45/" + "Wpf.Controls.PanAndZoom.dll", Target = "lib/net45" },
|
||||
new NuSpecContent { Source = "src/Wpf.Controls.PanAndZoom/bin/" + dirSuffix + "/net45/" + "Wpf.Controls.PanAndZoom.xml", Target = "lib/net45" }
|
||||
},
|
||||
BasePath = Directory("./"),
|
||||
OutputDirectory = nugetRoot
|
||||
};
|
||||
|
||||
var nuspecNuGetSettings = new List<NuGetPackSettings>();
|
||||
|
||||
nuspecNuGetSettings.Add(nuspecNuGet);
|
||||
nuspecNuGetSettings.Add(nuspecNuGetAvaloniaPanAndZoom);
|
||||
nuspecNuGetSettings.Add(nuspecNuGetAvaloniaViewBox);
|
||||
nuspecNuGetSettings.Add(nuspecNuGetWpf);
|
||||
|
||||
var nugetPackages = nuspecNuGetSettings.Select(nuspec => {
|
||||
return nuspec.OutputDirectory.CombineWithFilePath(string.Concat(nuspec.Id, ".", nuspec.Version, ".nupkg"));
|
||||
}).ToArray();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// INFORMATION
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Information("Building version {0} of PanAndZoom ({1}, {2}, {3}) using version {4} of Cake.",
|
||||
version,
|
||||
platform,
|
||||
configuration,
|
||||
target,
|
||||
typeof(ICakeContext).Assembly.GetName().Version.ToString());
|
||||
|
||||
if (isRunningOnAppVeyor)
|
||||
{
|
||||
Information("Repository Name: " + BuildSystem.AppVeyor.Environment.Repository.Name);
|
||||
Information("Repository Branch: " + BuildSystem.AppVeyor.Environment.Repository.Branch);
|
||||
}
|
||||
|
||||
Information("Target: " + target);
|
||||
Information("Platform: " + platform);
|
||||
Information("Configuration: " + configuration);
|
||||
Information("IsLocalBuild: " + isLocalBuild);
|
||||
Information("IsRunningOnUnix: " + isRunningOnUnix);
|
||||
Information("IsRunningOnWindows: " + isRunningOnWindows);
|
||||
Information("IsRunningOnAppVeyor: " + isRunningOnAppVeyor);
|
||||
Information("IsPullRequest: " + isPullRequest);
|
||||
Information("IsMainRepo: " + isMainRepo);
|
||||
Information("IsMasterBranch: " + isMasterBranch);
|
||||
Information("IsTagged: " + isTagged);
|
||||
Information("IsReleasable: " + isReleasable);
|
||||
Information("IsMyGetRelease: " + isMyGetRelease);
|
||||
Information("IsNuGetRelease: " + isNuGetRelease);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TASKS: VISUAL STUDIO
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Task("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
CleanDirectories(buildDirs);
|
||||
CleanDirectory(artifactsDir);
|
||||
CleanDirectory(testResultsDir);
|
||||
CleanDirectory(nugetRoot);
|
||||
});
|
||||
|
||||
Task("Restore-NuGet-Packages")
|
||||
.IsDependentOn("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
var maxRetryCount = 5;
|
||||
var toolTimeout = 1d;
|
||||
Policy
|
||||
.Handle<Exception>()
|
||||
.Retry(maxRetryCount, (exception, retryCount, context) => {
|
||||
if (retryCount == maxRetryCount)
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
else
|
||||
{
|
||||
Verbose("{0}", exception);
|
||||
toolTimeout+=0.5;
|
||||
}})
|
||||
.Execute(()=> {
|
||||
if(isRunningOnWindows)
|
||||
{
|
||||
NuGetRestore(MSBuildSolution, new NuGetRestoreSettings {
|
||||
ToolTimeout = TimeSpan.FromMinutes(toolTimeout)
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Task("Build")
|
||||
.IsDependentOn("Restore-NuGet-Packages")
|
||||
.Does(() =>
|
||||
{
|
||||
if(isRunningOnWindows)
|
||||
{
|
||||
MSBuild(MSBuildSolution, settings => {
|
||||
settings.SetConfiguration(configuration);
|
||||
settings.UseToolVersion(MSBuildToolVersion.VS2017);
|
||||
settings.WithProperty("Platform", "\"" + platform + "\"");
|
||||
settings.SetVerbosity(Verbosity.Minimal);
|
||||
settings.SetMaxCpuCount(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Task("Run-Unit-Tests")
|
||||
.IsDependentOn("Build")
|
||||
.Does(() =>
|
||||
{
|
||||
if(!isRunningOnWindows)
|
||||
return;
|
||||
var assemblies = GetFiles("./tests/**/bin/" + dirSuffix + "/" + UnitTestsFramework + "/*.UnitTests.dll");
|
||||
var settings = new XUnit2Settings {
|
||||
ToolPath = (isPlatformAnyCPU || isPlatformX86) ?
|
||||
Context.Tools.Resolve("xunit.console.x86.exe") :
|
||||
Context.Tools.Resolve("xunit.console.exe"),
|
||||
OutputDirectory = testResultsDir,
|
||||
XmlReportV1 = true,
|
||||
NoAppDomain = true,
|
||||
Parallelism = ParallelismOption.None,
|
||||
ShadowCopy = false
|
||||
};
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
XUnit2(assembly.FullPath, settings);
|
||||
}
|
||||
});
|
||||
|
||||
Task("Create-NuGet-Packages")
|
||||
.IsDependentOn("Build")
|
||||
.Does(() =>
|
||||
{
|
||||
foreach(var nuspec in nuspecNuGetSettings)
|
||||
{
|
||||
NuGetPack(nuspec);
|
||||
}
|
||||
});
|
||||
|
||||
Task("Publish-MyGet")
|
||||
.IsDependentOn("Create-NuGet-Packages")
|
||||
.WithCriteria(() => !isLocalBuild)
|
||||
.WithCriteria(() => !isPullRequest)
|
||||
.WithCriteria(() => isMainRepo)
|
||||
.WithCriteria(() => isMasterBranch)
|
||||
.WithCriteria(() => isMyGetRelease)
|
||||
.Does(() =>
|
||||
{
|
||||
var apiKey = EnvironmentVariable("MYGET_API_KEY");
|
||||
if(string.IsNullOrEmpty(apiKey))
|
||||
{
|
||||
throw new InvalidOperationException("Could not resolve MyGet API key.");
|
||||
}
|
||||
|
||||
var apiUrl = EnvironmentVariable("MYGET_API_URL");
|
||||
if(string.IsNullOrEmpty(apiUrl))
|
||||
{
|
||||
throw new InvalidOperationException("Could not resolve MyGet API url.");
|
||||
}
|
||||
|
||||
foreach(var nupkg in nugetPackages)
|
||||
{
|
||||
NuGetPush(nupkg, new NuGetPushSettings {
|
||||
Source = apiUrl,
|
||||
ApiKey = apiKey
|
||||
});
|
||||
}
|
||||
})
|
||||
.OnError(exception =>
|
||||
{
|
||||
Information("Publish-MyGet Task failed, but continuing with next Task...");
|
||||
});
|
||||
|
||||
Task("Publish-NuGet")
|
||||
.IsDependentOn("Create-NuGet-Packages")
|
||||
.WithCriteria(() => !isLocalBuild)
|
||||
.WithCriteria(() => !isPullRequest)
|
||||
.WithCriteria(() => isMainRepo)
|
||||
.WithCriteria(() => isMasterBranch)
|
||||
.WithCriteria(() => isNuGetRelease)
|
||||
.Does(() =>
|
||||
{
|
||||
var apiKey = EnvironmentVariable("NUGET_API_KEY");
|
||||
if(string.IsNullOrEmpty(apiKey))
|
||||
{
|
||||
throw new InvalidOperationException("Could not resolve NuGet API key.");
|
||||
}
|
||||
|
||||
var apiUrl = EnvironmentVariable("NUGET_API_URL");
|
||||
if(string.IsNullOrEmpty(apiUrl))
|
||||
{
|
||||
throw new InvalidOperationException("Could not resolve NuGet API url.");
|
||||
}
|
||||
|
||||
foreach(var nupkg in nugetPackages)
|
||||
{
|
||||
NuGetPush(nupkg, new NuGetPushSettings {
|
||||
ApiKey = apiKey,
|
||||
Source = apiUrl
|
||||
});
|
||||
}
|
||||
})
|
||||
.OnError(exception =>
|
||||
{
|
||||
Information("Publish-NuGet Task failed, but continuing with next Task...");
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TASKS: .NET Core
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Task("Restore-NetCore")
|
||||
.IsDependentOn("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
foreach (var project in netCoreProjects)
|
||||
{
|
||||
DotNetCoreRestore(project.Path);
|
||||
}
|
||||
});
|
||||
|
||||
Task("Run-Unit-Tests-NetCore")
|
||||
.IsDependentOn("Clean")
|
||||
.Does(() =>
|
||||
{
|
||||
foreach (var project in netCoreUnitTestsProjects)
|
||||
{
|
||||
DotNetCoreRestore(project.Path);
|
||||
foreach(var framework in netCoreUnitTestsFrameworks)
|
||||
{
|
||||
Information("Running tests for: {0}, framework: {1}", project.Name, framework);
|
||||
DotNetCoreTest(project.File, new DotNetCoreTestSettings {
|
||||
Configuration = configuration,
|
||||
Framework = framework
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Task("Build-NetCore")
|
||||
.IsDependentOn("Restore-NetCore")
|
||||
.Does(() =>
|
||||
{
|
||||
foreach (var project in netCoreProjects)
|
||||
{
|
||||
Information("Building: {0}", project.Name);
|
||||
DotNetCoreBuild(project.Path, new DotNetCoreBuildSettings {
|
||||
Configuration = configuration,
|
||||
MSBuildSettings = new DotNetCoreMSBuildSettings() {
|
||||
MaxCpuCount = 0
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TARGETS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Task("Package")
|
||||
.IsDependentOn("Create-NuGet-Packages");
|
||||
|
||||
Task("Default")
|
||||
.IsDependentOn("Run-Unit-Tests");
|
||||
|
||||
Task("AppVeyor")
|
||||
.IsDependentOn("Run-Unit-Tests-NetCore")
|
||||
.IsDependentOn("Build-NetCore")
|
||||
.IsDependentOn("Publish-MyGet")
|
||||
.IsDependentOn("Publish-NuGet");
|
||||
|
||||
Task("Azure-Windows")
|
||||
.IsDependentOn("Run-Unit-Tests-NetCore")
|
||||
.IsDependentOn("Build-NetCore");
|
||||
|
||||
Task("Azure-macOS")
|
||||
.IsDependentOn("Run-Unit-Tests-NetCore");
|
||||
|
||||
Task("Azure-Linux")
|
||||
.IsDependentOn("Run-Unit-Tests-NetCore");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// EXECUTE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RunTarget(target);
|
|
@ -0,0 +1,69 @@
|
|||
[CmdletBinding()]
|
||||
Param(
|
||||
#[switch]$CustomParam,
|
||||
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
||||
[string[]]$BuildArguments
|
||||
)
|
||||
|
||||
Write-Output "Windows PowerShell $($Host.Version)"
|
||||
|
||||
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { exit 1 }
|
||||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
|
||||
###########################################################################
|
||||
# CONFIGURATION
|
||||
###########################################################################
|
||||
|
||||
$BuildProjectFile = "$PSScriptRoot\build\build\_build.csproj"
|
||||
$TempDirectory = "$PSScriptRoot\\.tmp"
|
||||
|
||||
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
|
||||
$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
|
||||
$DotNetChannel = "Current"
|
||||
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
|
||||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
|
||||
$env:NUGET_XMLDOC_MODE = "skip"
|
||||
|
||||
###########################################################################
|
||||
# EXECUTION
|
||||
###########################################################################
|
||||
|
||||
function ExecSafe([scriptblock] $cmd) {
|
||||
& $cmd
|
||||
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
# If global.json exists, load expected version
|
||||
if (Test-Path $DotNetGlobalFile) {
|
||||
$DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json)
|
||||
if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) {
|
||||
$DotNetVersion = $DotNetGlobal.sdk.version
|
||||
}
|
||||
}
|
||||
|
||||
# If dotnet is installed locally, and expected version is not set or installation matches the expected version
|
||||
if ((Get-Command "dotnet" -ErrorAction SilentlyContinue) -ne $null -and `
|
||||
(!(Test-Path variable:DotNetVersion) -or $(& dotnet --version) -eq $DotNetVersion)) {
|
||||
$env:DOTNET_EXE = (Get-Command "dotnet").Path
|
||||
}
|
||||
else {
|
||||
$DotNetDirectory = "$TempDirectory\dotnet-win"
|
||||
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
|
||||
|
||||
# Download install script
|
||||
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
|
||||
md -force $TempDirectory > $null
|
||||
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
|
||||
|
||||
# Install by channel or version
|
||||
if (!(Test-Path variable:DotNetVersion)) {
|
||||
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
|
||||
} else {
|
||||
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
|
||||
|
||||
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile -- $BuildArguments }
|
|
@ -0,0 +1,72 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo $(bash --version 2>&1 | head -n 1)
|
||||
|
||||
#CUSTOMPARAM=0
|
||||
BUILD_ARGUMENTS=()
|
||||
for i in "$@"; do
|
||||
case $(echo $1 | awk '{print tolower($0)}') in
|
||||
# -custom-param) CUSTOMPARAM=1;;
|
||||
*) BUILD_ARGUMENTS+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
set -eo pipefail
|
||||
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
|
||||
###########################################################################
|
||||
# CONFIGURATION
|
||||
###########################################################################
|
||||
|
||||
BUILD_PROJECT_FILE="$SCRIPT_DIR/build/build/_build.csproj"
|
||||
TEMP_DIRECTORY="$SCRIPT_DIR//.tmp"
|
||||
|
||||
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
|
||||
DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
|
||||
DOTNET_CHANNEL="Current"
|
||||
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
export NUGET_XMLDOC_MODE="skip"
|
||||
|
||||
###########################################################################
|
||||
# EXECUTION
|
||||
###########################################################################
|
||||
|
||||
function FirstJsonValue {
|
||||
perl -nle 'print $1 if m{"'$1'": "([^"\-]+)",?}' <<< ${@:2}
|
||||
}
|
||||
|
||||
# If global.json exists, load expected version
|
||||
if [ -f "$DOTNET_GLOBAL_FILE" ]; then
|
||||
DOTNET_VERSION=$(FirstJsonValue "version" $(cat "$DOTNET_GLOBAL_FILE"))
|
||||
if [ "$DOTNET_VERSION" == "" ]; then
|
||||
unset DOTNET_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
# If dotnet is installed locally, and expected version is not set or installation matches the expected version
|
||||
if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then
|
||||
export DOTNET_EXE="$(command -v dotnet)"
|
||||
else
|
||||
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
|
||||
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
|
||||
|
||||
# Download install script
|
||||
DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
|
||||
mkdir -p "$TEMP_DIRECTORY"
|
||||
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
|
||||
chmod +x "$DOTNET_INSTALL_FILE"
|
||||
|
||||
# Install by channel or version
|
||||
if [ -z ${DOTNET_VERSION+x} ]; then
|
||||
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
|
||||
else
|
||||
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
|
||||
|
||||
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" -- ${BUILD_ARGUMENTS[@]}
|
|
@ -0,0 +1,11 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.0.4</VersionPrefix>
|
||||
<VersionSuffix></VersionSuffix>
|
||||
<Authors>Wiesław Šoltés</Authors>
|
||||
<Company>Wiesław Šoltés</Company>
|
||||
<Copyright>Copyright © Wiesław Šoltés 2018</Copyright>
|
||||
<PackageLicenseUrl>https://github.com/wieslawsoltes/PanAndZoom/blob/master/LICENSE.TXT</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://github.com/wieslawsoltes/PanAndZoom</PackageProjectUrl>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<AvaloniaResource Include="**\*.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</AvaloniaResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,6 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.Runtime.CoreCLR" Version="2.0.8" />
|
||||
<PackageReference Include="Microsoft.NETCore.DotNetHostPolicy" Version="2.1.5" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,6 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' and '$(OS)' == 'Unix' ">
|
||||
<FrameworkPathOverride>/usr/lib/mono/4.6.1-api</FrameworkPathOverride>
|
||||
<FrameworkPathOverride Condition="$([MSBuild]::IsOsPlatform('OSX'))">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.6.1-api</FrameworkPathOverride>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,117 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Nuke.Common;
|
||||
using Nuke.Common.Git;
|
||||
using Nuke.Common.ProjectModel;
|
||||
using Nuke.Common.Tools.DotNet;
|
||||
using static Nuke.Common.EnvironmentInfo;
|
||||
using static Nuke.Common.IO.FileSystemTasks;
|
||||
using static Nuke.Common.IO.PathConstruction;
|
||||
using static Nuke.Common.Tools.DotNet.DotNetTasks;
|
||||
|
||||
class Build : NukeBuild
|
||||
{
|
||||
public static int Main() => Execute<Build>(x => x.Compile);
|
||||
|
||||
[Solution("PanAndZoom.sln")]
|
||||
readonly Solution Solution;
|
||||
|
||||
[GitRepository]
|
||||
readonly GitRepository GitRepository;
|
||||
|
||||
[Parameter("configuration")]
|
||||
public string Configuration { get; set; }
|
||||
|
||||
[Parameter("version-suffix")]
|
||||
public string VersionSuffix { get; set; }
|
||||
|
||||
[Parameter("publish-framework")]
|
||||
public string PublishFramework { get; set; }
|
||||
|
||||
[Parameter("publish-runtime")]
|
||||
public string PublishRuntime { get; set; }
|
||||
|
||||
[Parameter("publish-project")]
|
||||
public string PublishProject { get; set; }
|
||||
|
||||
AbsolutePath SourceDirectory => RootDirectory / "src";
|
||||
|
||||
AbsolutePath TestsDirectory => RootDirectory / "tests";
|
||||
|
||||
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
|
||||
|
||||
protected override void OnBuildInitialized()
|
||||
{
|
||||
Configuration = Configuration ?? "Release";
|
||||
VersionSuffix = VersionSuffix ?? "";
|
||||
}
|
||||
|
||||
Target Clean => _ => _
|
||||
.Executes(() =>
|
||||
{
|
||||
DeleteDirectories(GlobDirectories(SourceDirectory, "**/bin", "**/obj"));
|
||||
DeleteDirectories(GlobDirectories(TestsDirectory, "**/bin", "**/obj"));
|
||||
EnsureCleanDirectory(ArtifactsDirectory);
|
||||
});
|
||||
|
||||
Target Restore => _ => _
|
||||
.DependsOn(Clean)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetRestore(s => s
|
||||
.SetProjectFile(Solution));
|
||||
});
|
||||
|
||||
Target Compile => _ => _
|
||||
.DependsOn(Restore)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetBuild(s => s
|
||||
.SetProjectFile(Solution)
|
||||
.SetConfiguration(Configuration)
|
||||
.SetVersionSuffix(VersionSuffix)
|
||||
.EnableNoRestore());
|
||||
});
|
||||
|
||||
Target Test => _ => _
|
||||
.DependsOn(Compile)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetTest(s => s
|
||||
.SetProjectFile(Solution)
|
||||
.SetConfiguration(Configuration)
|
||||
.SetLogger("trx")
|
||||
.SetResultsDirectory(ArtifactsDirectory / "TestResults")
|
||||
.EnableNoBuild()
|
||||
.EnableNoRestore());
|
||||
});
|
||||
|
||||
Target Pack => _ => _
|
||||
.DependsOn(Test)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetPack(s => s
|
||||
.SetProject(Solution)
|
||||
.SetConfiguration(Configuration)
|
||||
.SetVersionSuffix(VersionSuffix)
|
||||
.SetOutputDirectory(ArtifactsDirectory / "NuGet")
|
||||
.EnableNoBuild()
|
||||
.EnableNoRestore());
|
||||
});
|
||||
|
||||
Target Publish => _ => _
|
||||
.DependsOn(Test)
|
||||
.Requires(() => PublishRuntime)
|
||||
.Requires(() => PublishFramework)
|
||||
.Requires(() => PublishProject)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetPublish(s => s
|
||||
.SetProject(Solution.GetProject(PublishProject))
|
||||
.SetConfiguration(Configuration)
|
||||
.SetVersionSuffix(VersionSuffix)
|
||||
.SetFramework(PublishFramework)
|
||||
.SetRuntime(PublishRuntime)
|
||||
.SetOutput(ArtifactsDirectory / "Publish" / PublishProject + "-" + PublishRuntime));
|
||||
});
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<RootNamespace></RootNamespace>
|
||||
<IsPackable>False</IsPackable>
|
||||
<NoWarn>CS0649;CS0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nuke.Common" Version="0.12.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<NukeMetadata Include="**\*.json" Exclude="bin\**;obj\**" />
|
||||
<NukeExternalFiles Include="**\*.*.ext" Exclude="bin\**;obj\**" />
|
||||
<None Remove="*.ref;*.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -2,29 +2,23 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;osx.10.12-x64</RuntimeIdentifiers>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsPackable>False</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\build\Base.props" />
|
||||
<Import Project="..\..\build\Rx.props" />
|
||||
<Import Project="..\..\build\Avalonia.props" />
|
||||
<Import Project="..\..\build\Avalonia.Desktop.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" Exclude="obj\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="**\*.xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\NETCore.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Rx.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Avalonia.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Avalonia.Desktop.props" />
|
||||
<Import Project="..\..\build\EmbedXaml.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Avalonia.Controls.ViewBox\Avalonia.Controls.ViewBox.csproj" />
|
||||
|
|
|
@ -9,11 +9,11 @@ using System.Windows;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Wiesław Šoltés")]
|
||||
[assembly: AssemblyProduct("WpfDemo")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2016")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None,ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("0.4.0")]
|
||||
[assembly: AssemblyFileVersion("0.4.0")]
|
||||
[assembly: AssemblyInformationalVersion("0.4.0")]
|
||||
[assembly: AssemblyVersion("1.0.4")]
|
||||
[assembly: AssemblyFileVersion("1.0.4")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.4")]
|
||||
|
|
|
@ -1,22 +1,29 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<OutputType>Library</OutputType>
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>Easily add pan and zoom functionality to your Avalonia apps using PanAndZoom control.</Description>
|
||||
<PackageTags>Avalonia;Pan;Zoom;Control;Xaml;Managed;C#"</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\build\Base.props" />
|
||||
<Import Project="..\..\build\Rx.props" />
|
||||
<Import Project="..\..\build\Avalonia.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="**\*.cs" Exclude="obj\**" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Rx.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Avalonia.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\NetFX.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PanAndZoom\PanAndZoom.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright (c) Wiesław Šoltés. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Avalonia.Controls.PanAndZoom")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Avalonia.Controls.PanAndZoom")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
|
@ -1,19 +1,25 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<OutputType>Library</OutputType>
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>ViewBox control for Avalonia apps.</Description>
|
||||
<PackageTags>Avalonia;ViewBox;Control;Xaml;Managed;C#</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\build\Base.props" />
|
||||
<Import Project="..\..\build\Rx.props" />
|
||||
<Import Project="..\..\build\Avalonia.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="**\*.cs" Exclude="obj\**" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Rx.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\Avalonia.props" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\NetFX.props" />
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright (c) Wiesław Šoltés. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("Avalonia.Controls.ViewBox")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Avalonia.Controls.ViewBox")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
|
@ -1,17 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<OutputType>Library</OutputType>
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>Easily add pan and zoom functionality to your Avalonia apps using PanAndZoom control.</Description>
|
||||
<PackageTags>Pan;Zoom;Control;Xaml;Managed;C#</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\build\Base.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="**\*.cs" Exclude="obj\**" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\build\NetFX.props" />
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright (c) Wiesław Šoltés. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("PanAndZoom")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("PanAndZoom")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
|
@ -1,10 +0,0 @@
|
|||
// Copyright (c) Wiesław Šoltés. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyCompany("Wiesław Šoltés")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("1.0.3")]
|
||||
[assembly: AssemblyFileVersion("1.0.3")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.3")]
|
|
@ -4,10 +4,4 @@ using System.Reflection;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
[assembly: AssemblyTitle("Wpf.Controls.PanAndZoom")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Wpf.Controls.PanAndZoom")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
|
|
|
@ -1,13 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45</TargetFrameworks>
|
||||
<TargetFrameworks>net461</TargetFrameworks>
|
||||
<OutputType>Library</OutputType>
|
||||
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>Easily add pan and zoom functionality to your WPF apps using PanAndZoom control.</Description>
|
||||
<PackageTags>WPF;Pan;Zoom;Control;Xaml;Managed;C#</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\..\build\Base.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
|
@ -20,13 +29,13 @@
|
|||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\SharedAssemblyInfo.cs">
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="**\*.cs" Exclude="obj\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PanAndZoom\PanAndZoom.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче