Build tests and samples during regular build
This commit is contained in:
parent
73474132d1
commit
7b0f6e7c2a
|
|
@ -92,24 +92,16 @@ default DNX_TOOLS_FEED = 'https://www.myget.org/F/dnxtools/api/v2'
|
||||||
|
|
||||||
#ci-deep-clean .deep-clean target='clean' if='IsTeamCity'
|
#ci-deep-clean .deep-clean target='clean' if='IsTeamCity'
|
||||||
|
|
||||||
#build-compile target='compile' if='Directory.Exists("src")'
|
#build-compile target='compile' if='!IsBuildV2 && Directory.Exists("src")'
|
||||||
@{
|
@{
|
||||||
if (IsBuildV2)
|
var projectFiles = Files.Include("src/**/project.json").ToList();
|
||||||
|
if (ShouldRunInParallel)
|
||||||
{
|
{
|
||||||
const string buildPattern = "src/**";
|
Parallel.ForEach(projectFiles, projectFile => DnuPack(projectFile, BUILD_DIR, Configuration));
|
||||||
DnuPack(buildPattern, BUILD_DIR, Configuration);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var projectFiles = Files.Include("src/**/project.json").ToList();
|
projectFiles.ForEach(projectFile => DnuPack(projectFile, BUILD_DIR, Configuration));
|
||||||
if (ShouldRunInParallel)
|
|
||||||
{
|
|
||||||
Parallel.ForEach(projectFiles, projectFile => DnuPack(projectFile, BUILD_DIR, Configuration));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
projectFiles.ForEach(projectFile => DnuPack(projectFile, BUILD_DIR, Configuration));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR, "*/*.nupkg")))
|
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR, "*/*.nupkg")))
|
||||||
|
|
@ -118,6 +110,38 @@ default DNX_TOOLS_FEED = 'https://www.myget.org/F/dnxtools/api/v2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#build-compile target='compile' if='IsBuildV2'
|
||||||
|
@{
|
||||||
|
// If the src folder, build and create the packages
|
||||||
|
if (Directory.Exists("src"))
|
||||||
|
{
|
||||||
|
DnuPack("src/**", BUILD_DIR, Configuration);
|
||||||
|
|
||||||
|
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR, "*/*.nupkg")))
|
||||||
|
{
|
||||||
|
File.Copy(nupkg, Path.Combine(BUILD_DIR, Path.GetFileName(nupkg)), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For test and samples only check if they compile
|
||||||
|
var projectsToBuild = new List<string>();
|
||||||
|
if (Directory.Exists("test"))
|
||||||
|
{
|
||||||
|
projectsToBuild.Add("test/**");
|
||||||
|
}
|
||||||
|
if (Directory.Exists("samples"))
|
||||||
|
{
|
||||||
|
projectsToBuild.Add("samples/**");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (projectsToBuild.Any())
|
||||||
|
{
|
||||||
|
DnuBuild(
|
||||||
|
string.Join(";", projectsToBuild),
|
||||||
|
Configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#native-compile target='compile' if='!IsMono && Directory.Exists(Path.Combine(BASE_DIR, "src"))'
|
#native-compile target='compile' if='!IsMono && Directory.Exists(Path.Combine(BASE_DIR, "src"))'
|
||||||
var programFilesX86 = '${Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)}'
|
var programFilesX86 = '${Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)}'
|
||||||
var nativeProjects ='${Files.Include(Path.Combine(BASE_DIR, "src", "**", "*.vcxproj"))}'
|
var nativeProjects ='${Files.Include(Path.Combine(BASE_DIR, "src", "**", "*.vcxproj"))}'
|
||||||
|
|
@ -176,7 +200,7 @@ default DNX_TOOLS_FEED = 'https://www.myget.org/F/dnxtools/api/v2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#build-samples target='test' if='Directory.Exists("samples")'
|
#build-samples target='test' if='!IsBuildV2 && Directory.Exists("samples")'
|
||||||
@{
|
@{
|
||||||
var projectFiles = Files.Include("samples/**/project.json").ToList();
|
var projectFiles = Files.Include("samples/**/project.json").ToList();
|
||||||
if (ShouldRunInParallel)
|
if (ShouldRunInParallel)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue