Add a target for producing CI builds

This commit is contained in:
Pranav K 2016-06-14 12:08:19 -07:00
Родитель e4f9770d70
Коммит c0d3d9d1ab
3 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -14,14 +14,14 @@ configuration=''
*/}
default configuration = 'Debug'
default pack_options=' ${E("KOREBUILD_DOTNET_PACK_OPTIONS")}'
default pack_options=''
@{
var projectFolder=Path.GetDirectoryName(projectFile);
var projectName=Path.GetFileName(projectFolder);
var projectBin=Path.Combine(projectFolder, "bin");
var dotnetArgs=string.Format("pack{0} {1} --configuration {2} --serviceable", pack_options, projectFolder, configuration);
var dotnetArgs=string.Format("pack{0} {1} --configuration {2}", pack_options, projectFolder, configuration);
Dotnet(dotnetArgs);
CopyFolder(projectBin, Path.Combine(dotnetPackOutputDir, projectName), true);

Просмотреть файл

@ -16,7 +16,7 @@ configuration=''
default configuration = 'Debug'
default IgnoreDotnetTestExitCode = '${E("KOREBUILD_IGNORE_DOTNET_TEST_EXIT_CODE") == "true"}'
default test_options=' ${E("KOREBUILD_DOTNET_TEST_OPTIONS")}'
default test_options=''
@{
var content = File.ReadAllText(projectFile);

Просмотреть файл

@ -40,6 +40,15 @@ default SAMPLES_PROJECT_GLOB = "samples/*/project.json"
}
}
#--for-ci
@{
Configuration = "Release";
E("Configuration", Configuration);
E("KOREBUILD_ADD_ASSEMBLY_INFO", "1");
E("KOREBUILD_DOTNET_PACK_OPTIONS", E("KOREBUILD_DOTNET_PACK_OPTIONS") + " --serviceable");
E("KOREBUILD_VERIFY_NUPKGS", "1");
}
#restore-npm-modules
@{
// Find all dirs that contain a package.json file
@ -158,7 +167,7 @@ default SAMPLES_PROJECT_GLOB = "samples/*/project.json"
{
srcProjects.ForEach(projectFile =>
{
DotnetPack(projectFile, BUILD_DIR, Configuration, " --no-build");
DotnetPack(projectFile, BUILD_DIR, Configuration, E("KOREBUILD_DOTNET_PACK_OPTIONS") + " --no-build");
});
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR, "*/" + Configuration + "/*.nupkg")))
@ -230,7 +239,7 @@ default SAMPLES_PROJECT_GLOB = "samples/*/project.json"
var projectFiles = Files.Include(TEST_PROJECT_GLOB);
foreach (var projectFile in projectFiles)
{
DotnetTest(projectFile, Configuration, " --no-build");
DotnetTest(projectFile, Configuration, E("KOREBUILD_DOTNET_TEST_OPTIONS") + " --no-build");
}
}