Skip to content

Commit

Permalink
Merge branch 'build-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
damianh committed Jan 2, 2020
2 parents fdf69bd + 231f8c1 commit 0561c6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
Expand Down
4 changes: 4 additions & 0 deletions artifacts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
21 changes: 14 additions & 7 deletions build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using static Bullseye.Targets;
using static SimpleExec.Command;

Expand All @@ -22,14 +23,20 @@ static void Main(string[] args)
{
return;
}
var di = new DirectoryInfo(ArtifactsDir);
foreach (var file in di.GetFiles())
var filesToDelete = Directory
.GetFiles(ArtifactsDir, "*.*", SearchOption.AllDirectories)
.Where(f => !f.EndsWith(".gitignore"));
foreach (var file in filesToDelete)
{
file.Delete();
Console.WriteLine($"Deleting file {file}");
File.SetAttributes(file, FileAttributes.Normal);
File.Delete(file);
}
foreach (var dir in di.GetDirectories())
var directoriesToDelete = Directory.GetDirectories("artifacts");
foreach (var directory in directoriesToDelete)
{
dir.Delete(true);
Console.WriteLine($"Deleting directory {directory}");
Directory.Delete(directory, true);
}
});

Expand All @@ -39,13 +46,13 @@ static void Main(string[] args)
RunTests,
DependsOn(Build),
ForEach("LittleForker.Tests"),
project => Run("dotnet", $"test src/{project}/{project}.csproj -c Release -r ../../{ArtifactsDir} --no-build -l trx;LogFileName={project}.xml --verbosity=normal"));
project => Run("dotnet", $"test src/{project}/{project}.csproj -c Release -r {ArtifactsDir} --no-build -l trx;LogFileName={project}.xml --verbosity=normal"));

Target(
Pack,
DependsOn(Build),
ForEach("LittleForker"),
project => Run("dotnet", $"pack src/{project}/{project}.csproj -c Release -o ../../{ArtifactsDir} --no-build"));
project => Run("dotnet", $"pack src/{project}/{project}.csproj -c Release -o {ArtifactsDir} --no-build"));

Target(Publish, DependsOn(Pack), () =>
{
Expand Down

0 comments on commit 0561c6d

Please sign in to comment.