Skip to content

Commit 0561c6d

Browse files
committed
Merge branch 'build-fix'
2 parents fdf69bd + 231f8c1 commit 0561c6d

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ dlldata.c
4545
# .NET Core
4646
project.lock.json
4747
project.fragment.lock.json
48-
artifacts/
4948
**/Properties/launchSettings.json
5049

5150
*_i.c

artifacts/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

build/Program.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Linq;
34
using static Bullseye.Targets;
45
using static SimpleExec.Command;
56

@@ -22,14 +23,20 @@ static void Main(string[] args)
2223
{
2324
return;
2425
}
25-
var di = new DirectoryInfo(ArtifactsDir);
26-
foreach (var file in di.GetFiles())
26+
var filesToDelete = Directory
27+
.GetFiles(ArtifactsDir, "*.*", SearchOption.AllDirectories)
28+
.Where(f => !f.EndsWith(".gitignore"));
29+
foreach (var file in filesToDelete)
2730
{
28-
file.Delete();
31+
Console.WriteLine($"Deleting file {file}");
32+
File.SetAttributes(file, FileAttributes.Normal);
33+
File.Delete(file);
2934
}
30-
foreach (var dir in di.GetDirectories())
35+
var directoriesToDelete = Directory.GetDirectories("artifacts");
36+
foreach (var directory in directoriesToDelete)
3137
{
32-
dir.Delete(true);
38+
Console.WriteLine($"Deleting directory {directory}");
39+
Directory.Delete(directory, true);
3340
}
3441
});
3542

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

4451
Target(
4552
Pack,
4653
DependsOn(Build),
4754
ForEach("LittleForker"),
48-
project => Run("dotnet", $"pack src/{project}/{project}.csproj -c Release -o ../../{ArtifactsDir} --no-build"));
55+
project => Run("dotnet", $"pack src/{project}/{project}.csproj -c Release -o {ArtifactsDir} --no-build"));
4956

5057
Target(Publish, DependsOn(Pack), () =>
5158
{

0 commit comments

Comments
 (0)