代码拉取完成,页面将自动刷新
var target = Argument("target", "Default");
var configuration = Argument<string>("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
var packPath = Directory("./src/IdentityServer4");
var buildArtifacts = Directory("./artifacts/packages");
var isAppVeyor = AppVeyor.IsRunningOnAppVeyor;
var isWindows = IsRunningOnWindows();
var netcore = "netcoreapp1.1";
var netstandard = "netstandard1.4";
///////////////////////////////////////////////////////////////////////////////
// Clean
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories(new DirectoryPath[] { buildArtifacts });
});
///////////////////////////////////////////////////////////////////////////////
// Restore
///////////////////////////////////////////////////////////////////////////////
Task("Restore")
.Does(() =>
{
var settings = new DotNetCoreRestoreSettings
{
Sources = new [] { "https://api.nuget.org/v3/index.json" }
};
var projects = GetFiles("./**/*.csproj");
foreach(var project in projects)
{
DotNetCoreRestore(project.GetDirectory().FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Build
///////////////////////////////////////////////////////////////////////////////
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() =>
{
var settings = new DotNetCoreBuildSettings
{
Configuration = configuration
};
// main build (Windows local and Appveyor)
// build for all targets
if (isWindows)
{
DotNetCoreBuild(Directory("./src/IdentityServer4"), settings);
DotNetCoreBuild(Directory("./test/IdentityServer.IntegrationTests"), settings);
DotNetCoreBuild(Directory("./test/IdentityServer.UnitTests"), settings);
if (!isAppVeyor)
{
DotNetCoreBuild(Directory("./src/Host"), settings);
}
}
// local mac / travis
// don't build for .net framework
else
{
settings.Framework = netstandard;
DotNetCoreBuild(Directory("./src/IdentityServer4"), settings);
settings.Framework = netcore;
DotNetCoreBuild(Directory("./src/Host"), settings);
DotNetCoreBuild(Directory("./test/IdentityServer.IntegrationTests"), settings);
DotNetCoreBuild(Directory("./test/IdentityServer.UnitTests"), settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Test
///////////////////////////////////////////////////////////////////////////////
Task("Test")
.IsDependentOn("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
{
Configuration = configuration
};
if (!isWindows)
{
Information("Not running on Windows - skipping tests for full .NET Framework");
settings.Framework = "netcoreapp1.1";
}
var projects = GetFiles("./test/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTest(project.FullPath, settings);
}
});
///////////////////////////////////////////////////////////////////////////////
// Pack
///////////////////////////////////////////////////////////////////////////////
Task("Pack")
.IsDependentOn("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
if (!isWindows)
{
Information("Not running on Windows - skipping pack");
return;
}
var settings = new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = buildArtifacts,
};
// add build suffix for CI builds
if(isAppVeyor)
{
settings.VersionSuffix = "build" + AppVeyor.Environment.Build.Number.ToString().PadLeft(5,'0');
}
DotNetCorePack(packPath, settings);
});
Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack");
RunTarget(target);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。