Skip to content

Commit

Permalink
Fixed package building
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Mar 22, 2023
1 parent a3d27c6 commit c1b5dba
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
54 changes: 35 additions & 19 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ var BIN_DIR = PROJECT_DIR + "bin/" + configuration + "/";
var IMAGE_DIR = PROJECT_DIR + "images/";
var NUNITFRAMWORKTESTSBIN = PROJECT_DIR + "src/NUnitFramework/tests/bin/" + configuration + "/";
var NUNITLITETESTSBIN = PROJECT_DIR + "src/NUnitFramework/nunitlite.tests/bin/" + configuration + "/";
var NUNITFRAMEWORKBIN = PROJECT_DIR + "src/NUnitFramework/framework/bin/" + configuration + "/";
var NUNITLITEBIN = PROJECT_DIR + "src/NUnitFramework/nunitlite/bin/" + configuration + "/";
var NUNITLITERUNNERBIN = PROJECT_DIR + "src/NUnitFramework/nunitlite-runner/bin/" + configuration + "/";

var SOLUTION_FILE = "./nunit.sln";

Expand Down Expand Up @@ -122,10 +125,12 @@ Setup(context =>
//////////////////////////////////////////////////////////////////////

Task("Clean")
.Description("Deletes all files in the BIN directory")
.Description("Deletes all files in the BIN directories")
.Does(() =>
{
CleanDirectory(BIN_DIR);
CleanDirectory(NUNITFRAMEWORKBIN);
CleanDirectory(NUNITLITEBIN);
CleanDirectory(NUNITLITERUNNERBIN);
});

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -260,30 +265,41 @@ Task("CreateImage")
var imageBinDir = CurrentImageDir + "bin/";

CreateDirectory(imageBinDir);
Information("Created directory " + imageBinDir);

foreach (var runtime in LibraryFrameworks)
Information("Created imagedirectory at:" + imageBinDir);
var directories = new String[]
{
NUNITFRAMEWORKBIN,
NUNITLITEBIN
};
foreach (var dir in directories)
{
var targetDir = imageBinDir + Directory(runtime);
var sourceDir = BIN_DIR + Directory(runtime);
CreateDirectory(targetDir);
foreach (FilePath file in FrameworkFiles)
foreach (var runtime in LibraryFrameworks)
{
var sourcePath = sourceDir + "/" + file;
if (FileExists(sourcePath))
CopyFileToDirectory(sourcePath, targetDir);
var targetDir = imageBinDir + Directory(runtime);
var sourceDir = dir + Directory(runtime);
CreateDirectory(targetDir);
Information("Created directory " + targetDir);
foreach (FilePath file in FrameworkFiles)
{
var sourcePath = sourceDir + "/" + file;
if (FileExists(sourcePath))
CopyFileToDirectory(sourcePath, targetDir);
}
Information("Files copied from " + sourceDir + " to " + targetDir);
var schemaPath = sourceDir + "/Schemas";
if (DirectoryExists(schemaPath))
CopyDirectory(sourceDir, targetDir);
}
var schemaPath = sourceDir + "/Schemas";
if (DirectoryExists(schemaPath))
CopyDirectory(sourceDir, targetDir);
}

}

foreach (var dir in NetCoreTests)
{
var targetDir = imageBinDir + Directory(dir);
var sourceDir = BIN_DIR + Directory(dir);
var sourceDir = NUNITLITERUNNERBIN + Directory(dir);
Information("Copying " + sourceDir + " to " + targetDir);
CopyDirectory(sourceDir, targetDir);
}
}
CopyDirectory(NUNITLITERUNNERBIN + Directory("net462"),imageBinDir+Directory("net462"));
});

Task("PackageFramework")
Expand Down
7 changes: 4 additions & 3 deletions nunit.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30709.132
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "src\NUnitFramework\framework\nunit.framework.csproj", "{B7753E96-F76B-4E9B-9071-47B16DB90FD6}"
EndProject
Expand Down Expand Up @@ -44,6 +44,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "framework", "framework", "{CE68713C-2E19-43E8-9333-6ED817110D52}"
ProjectSection(SolutionItems) = preProject
nuget\framework\nunit.nuspec = nuget\framework\nunit.nuspec
nuget\framework\NUnit.props = nuget\framework\NUnit.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nunitlite", "nunitlite", "{8D43A220-7FE8-4214-BBB4-08568B88C7AA}"
Expand All @@ -53,7 +54,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nunitlite", "nunitlite", "{
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "nunit.testdata.fsharp", "src\NUnitFramework\testdata.fsharp\nunit.testdata.fsharp.fsproj", "{9DF6B262-70E2-44E3-A436-3B65C7FD88DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.benchmarks", "src\NUnitFramework\benchmarks\nunit.framework.benchmarks\nunit.framework.benchmarks.csproj", "{D0D08E09-8FF4-487D-AE61-C9CCCCA8CBB0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework.benchmarks", "src\NUnitFramework\benchmarks\nunit.framework.benchmarks\nunit.framework.benchmarks.csproj", "{D0D08E09-8FF4-487D-AE61-C9CCCCA8CBB0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit c1b5dba

Please sign in to comment.