Uno.MvvmCross/build.cake

285 строки
8.0 KiB
Plaintext
Исходник Обычный вид История

#tool nuget:?package=GitVersion.CommandLine
2017-08-15 23:04:47 +03:00
#tool nuget:?package=vswhere
2018-01-31 23:04:47 +03:00
#addin nuget:?package=Cake.Incubator&version=1.7.1
#addin nuget:?package=Cake.Git&version=0.16.1
2017-12-12 22:54:57 +03:00
#addin nuget:?package=Polly
using Polly;
2017-01-19 22:18:02 +03:00
2018-01-31 23:04:47 +03:00
var sln = new FilePath("./MvvmCross.sln");
var outputDir = new DirectoryPath("./artifacts");
var nuspecDir = new DirectoryPath("./nuspec");
2017-01-19 22:18:02 +03:00
var target = Argument("target", "Default");
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
var configuration = Argument("configuration", "Release");
2017-01-19 22:18:02 +03:00
var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor;
2017-01-19 22:18:02 +03:00
Task("Clean").Does(() =>
{
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
CleanDirectories(outputDir.FullPath);
EnsureDirectoryExists(outputDir);
2017-01-19 22:18:02 +03:00
});
GitVersion versionInfo = null;
Task("Version").Does(() => {
versionInfo = GitVersion(new GitVersionSettings {
UpdateAssemblyInfo = true,
OutputType = GitVersionOutput.Json
});
2017-01-19 22:18:02 +03:00
Information("GitVersion -> {0}", versionInfo.Dump());
2017-01-19 22:18:02 +03:00
});
Task("UpdateAppVeyorBuildNumber")
.IsDependentOn("Version")
.WithCriteria(() => isRunningOnAppVeyor)
.Does(() =>
{
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
AppVeyor.UpdateBuildVersion(versionInfo.InformationalVersion);
});
FilePath msBuildPath;
Task("ResolveBuildTools")
2018-01-16 00:18:44 +03:00
.WithCriteria(() => IsRunningOnWindows())
.Does(() =>
{
var vsLatest = VSWhereLatest();
msBuildPath = (vsLatest == null)
? null
: vsLatest.CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe");
});
Task("Restore")
.IsDependentOn("ResolveBuildTools")
.Does(() => {
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
MSBuild(sln, settings => settings.WithTarget("Restore"));
2017-01-19 22:18:02 +03:00
});
Task("Build")
.IsDependentOn("ResolveBuildTools")
.IsDependentOn("Clean")
.IsDependentOn("UpdateAppVeyorBuildNumber")
.IsDependentOn("Restore")
.Does(() => {
var settings = new MSBuildSettings
{
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
Configuration = configuration,
ToolPath = msBuildPath,
Verbosity = Verbosity.Minimal,
ArgumentCustomization = args => args.Append("/m")
};
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
settings = settings
.WithProperty("DebugSymbols", "True")
.WithProperty("DebugType", "Embedded")
.WithProperty("Version", versionInfo.LegacySemVer)
.WithProperty("PackageVersion", versionInfo.LegacySemVer)
.WithProperty("InformationalVersion", versionInfo.InformationalVersion)
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
.WithProperty("NoPackageAnalysis", "True");
MSBuild(sln, settings);
2017-01-19 22:18:02 +03:00
});
Task("UnitTest")
.IsDependentOn("Build")
.Does(() =>
{
2018-01-31 23:04:47 +03:00
EnsureDirectoryExists(outputDir + "/Tests/");
2018-01-31 23:04:47 +03:00
var testPaths = GetFiles("./MvvmCross.Tests/*.UnitTest/*.UnitTest.csproj");
2018-01-31 23:26:48 +03:00
var testsFailed = false;
2018-01-31 23:04:47 +03:00
foreach(var project in testPaths)
2018-01-30 23:59:55 +03:00
{
2018-01-31 23:04:47 +03:00
var projectName = project.GetFilenameWithoutExtension();
var testXml = new FilePath(outputDir + "/Tests/" + projectName + ".xml").MakeAbsolute(Context.Environment);
try
{
DotNetCoreTool(project,
"xunit", "-fxversion 2.0.0 --no-build -parallel none -configuration " +
configuration + " -xml \"" + testXml.FullPath + "\"");
}
catch
{
2018-01-31 23:26:48 +03:00
testsFailed = true;
2018-01-31 23:04:47 +03:00
}
}
if (isRunningOnAppVeyor)
{
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
foreach(var testResult in GetFiles(outputDir + "/Tests/*.xml"))
2018-01-30 23:59:55 +03:00
AppVeyor.UploadTestResults(testResult, AppVeyorTestResultsType.XUnit);
}
2018-01-31 23:26:48 +03:00
if (testsFailed)
throw new Exception("Tests failed :(");
2017-01-19 22:18:02 +03:00
});
Task("PublishPackages")
.WithCriteria(() => !BuildSystem.IsLocalBuild)
.WithCriteria(() => IsRepository("mvvmcross/mvvmcross"))
.WithCriteria(() =>
StringComparer.OrdinalIgnoreCase.Equals(versionInfo.BranchName, "develop") ||
IsMasterOrReleases())
.Does (() =>
{
if (StringComparer.OrdinalIgnoreCase.Equals(versionInfo.BranchName, "master") && !IsTagged())
{
Information("Packages will not be published as this release has not been tagged.");
return;
}
// Resolve the API key.
var nugetKeySource = GetNugetKeyAndSource();
var apiKey = nugetKeySource.Item1;
var source = nugetKeySource.Item2;
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
var nugetFiles = GetFiles("MvvmCross*/**/bin/" + configuration + "/**/*.nupkg");
2017-12-12 22:54:57 +03:00
var policy = Policy
.Handle<Exception>()
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
.WaitAndRetry(5, retryAttempt =>
TimeSpan.FromSeconds(Math.Pow(1.5, retryAttempt)));
2017-12-12 22:54:57 +03:00
foreach(var nugetFile in nugetFiles)
{
2017-12-12 22:54:57 +03:00
policy.Execute(() =>
NuGetPush(nugetFile, new NuGetPushSettings {
Source = source,
ApiKey = apiKey
})
);
}
});
2017-06-19 10:50:28 +03:00
Task("UploadAppVeyorArtifact")
.WithCriteria(() => isRunningOnAppVeyor)
.Does(() => {
2017-06-19 10:50:28 +03:00
Information("Artifacts Dir: {0}", outputDir.FullPath);
2017-06-19 10:50:28 +03:00
2017-12-12 23:07:20 +03:00
var uploadSettings = new AppVeyorUploadArtifactsSettings();
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
var artifacts = GetFiles("MvvmCross*/**/bin/" + configuration + "/**/*.nupkg")
+ GetFiles(outputDir.FullPath + "/**/*");
foreach(var file in artifacts) {
Information("Uploading {0}", file.FullPath);
2017-12-12 23:07:20 +03:00
if (file.GetExtension() == "nupkg")
uploadSettings.ArtifactType = AppVeyorUploadArtifactType.NuGetPackage;
else
uploadSettings.ArtifactType = AppVeyorUploadArtifactType.Auto;
AppVeyor.UploadArtifact(file.FullPath, uploadSettings);
}
2017-06-19 10:50:28 +03:00
});
2017-01-19 22:18:02 +03:00
Task("Default")
Update to .NET Standard (#2530) * Move Android support and plugins to new directories * Add new solution file and directory config * Update Android support to sdk style * Remove packages.config from android support * Add new csproj for MvvmCross main project * Add csproj for all projects * Move binding to new folders * Move wpf to its own folder * Move console into its own platform * Move test project into the correct folder * Move platform projects * Move Forms into the right folder * Move code analysis to new folder * Fix some issue's with code in netstandard * Moving files for Accelerometer * Moving files for Plugins - All * Moving files for plugins - Color * Moving files for plugins - Downloadcache * Moving files for plugins - Email * Moving files for plugins - FieldBindings * Moving files for plugins - File * Moving files for plugins - Json * Moving files for plugins - JsonLocalization * Moving files for plugins - Location * Removing Location Fused legacy project * Moving files for plugins - Messenger * Moving files for plugins - MethodBinding * Moving files for plugins - Network * Moving files for plugins - PhoneCall * Moving files for plugins - Resource Loader * Moving files for plugins - ResxLocalization * Moving files for plugins - PictureChooser * Moving files for plugins - Share * Moving files for plugins - Visibility * Moving files for plugins - WebBrowser * Revert "Removing Location Fused legacy project" This reverts commit 9b8b6c96c96bea4537661a30e950a3edb0c35a8e. * Moving Fused location to correct plugin folder * Move ios support into plugin * Fix the uwp version * Remove double binding files * Fixing Android attributes * Fixing Android resources naming * Fixing Forms project * Update build script * Add missing using * Cleanup some dependencies * Fix the android location of plugins * Update dependencies * Remove reference to Microsoft.CSharp * Add CSharp back to main library * Remove MSBuild AndroidResgen stuff, it is handled by MSBuildSDKExtras * Remove Preserve Attribute from Plugins.All * Added PreserveAttribute to Core * Remove checked in tools * Move PreserveAttribute to MvvmCross.Platform namespace * Switch to MvvmCross.Platform.PreserveAttribute * Don't check in Resources.Designer files * Prevent the compiler complaining about duplicate Resource.Designer.cs files * Fix test dll locations * Add NUnitTestAdapter and Test.SDK * NUnit Console Runner does not work with netcoreapp2.0 (dotnet-cli does) * Update gitignore * Added configuration argument * Use InformationalVersion for AppVeyor build * Add version property to build settings * Upload artifacts on PR's too * Squelch warnings about SemVer 2.0
2018-01-15 23:49:39 +03:00
.IsDependentOn("Build")
2018-01-30 23:59:55 +03:00
.IsDependentOn("UnitTest")
.IsDependentOn("PublishPackages")
.IsDependentOn("UploadAppVeyorArtifact")
.Does(() =>
{
});
2017-01-19 22:18:02 +03:00
RunTarget(target);
bool IsMasterOrReleases()
{
if (StringComparer.OrdinalIgnoreCase.Equals(versionInfo.BranchName, "master"))
return true;
if (versionInfo.BranchName.Contains("releases/"))
return true;
return false;
}
bool IsRepository(string repoName)
{
if (isRunningOnAppVeyor)
{
var buildEnvRepoName = AppVeyor.Environment.Repository.Name;
Information("Checking repo name: {0} against build repo name: {1}", repoName, buildEnvRepoName);
return StringComparer.OrdinalIgnoreCase.Equals(repoName, buildEnvRepoName);
}
else
{
try
{
var path = MakeAbsolute(sln).GetDirectory().FullPath;
using (var repo = new LibGit2Sharp.Repository(path))
{
var origin = repo.Network.Remotes.FirstOrDefault(
r => r.Name.ToLowerInvariant() == "origin");
return origin.Url.ToLowerInvariant() ==
"https://github.com/" + repoName.ToLowerInvariant();
}
}
catch(Exception ex)
{
Information("Failed to lookup repository: {0}", ex);
return false;
}
}
}
bool IsTagged()
{
var path = MakeAbsolute(sln).GetDirectory().FullPath;
using (var repo = new LibGit2Sharp.Repository(path))
{
var head = repo.Head;
var headSha = head.Tip.Sha;
var tag = repo.Tags.FirstOrDefault(t => t.Target.Sha == headSha);
if (tag == null)
{
Information("HEAD is not tagged");
return false;
}
Information("HEAD is tagged: {0}", tag.FriendlyName);
return true;
}
}
Tuple<string, string> GetNugetKeyAndSource()
{
var apiKeyKey = string.Empty;
var sourceKey = string.Empty;
if (isRunningOnAppVeyor)
{
apiKeyKey = "NUGET_APIKEY";
sourceKey = "NUGET_SOURCE";
}
else
{
if (StringComparer.OrdinalIgnoreCase.Equals(versionInfo.BranchName, "develop"))
{
apiKeyKey = "NUGET_APIKEY_DEVELOP";
sourceKey = "NUGET_SOURCE_DEVELOP";
}
else if (IsMasterOrReleases())
{
apiKeyKey = "NUGET_APIKEY_MASTER";
sourceKey = "NUGET_SOURCE_MASTER";
}
}
var apiKey = EnvironmentVariable(apiKeyKey);
if (string.IsNullOrEmpty(apiKey))
throw new Exception(string.Format("The {0} environment variable is not defined.", apiKeyKey));
var source = EnvironmentVariable(sourceKey);
if (string.IsNullOrEmpty(source))
throw new Exception(string.Format("The {0} environment variable is not defined.", sourceKey));
return Tuple.Create(apiKey, source);
2017-04-26 10:35:19 +03:00
}