1 Star 0 Fork 0

孤海飞雁/Official IdentityServer4

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.cake 4.11 KB
一键复制 编辑 原始数据 按行查看 历史
Dominick Baier 提交于 2017-03-13 02:40 +08:00 . update build script
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);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liujian1368928/official-identity-server4.git
[email protected]:liujian1368928/official-identity-server4.git
liujian1368928
official-identity-server4
Official IdentityServer4
aspnetcore1

搜索帮助