Fix DataProtection after build globbing changes will go in
This commit is contained in:
parent
e8faec59f0
commit
a4118e75aa
|
|
@ -11,27 +11,27 @@ var Configuration_Local = '${E("Configuration")}'
|
||||||
default BASE_DIR_LOCAL='${Directory.GetCurrentDirectory()}'
|
default BASE_DIR_LOCAL='${Directory.GetCurrentDirectory()}'
|
||||||
default TARGET_DIR_LOCAL='${Path.Combine(BASE_DIR_LOCAL, "artifacts")}'
|
default TARGET_DIR_LOCAL='${Path.Combine(BASE_DIR_LOCAL, "artifacts")}'
|
||||||
default BUILD_DIR_LOCAL='${Path.Combine(TARGET_DIR_LOCAL, "build")}'
|
default BUILD_DIR_LOCAL='${Path.Combine(TARGET_DIR_LOCAL, "build")}'
|
||||||
|
default SRC_PROJECT_GLOB_LOCAL="src/*/project.json"
|
||||||
|
default TEST_PROJECT_GLOB_LOCAL="test/*/project.json"
|
||||||
|
|
||||||
#build-compile target='compile' if='Directory.Exists("src")'
|
#build-compile target='compile'
|
||||||
@{
|
@{
|
||||||
|
|
||||||
Directory.CreateDirectory(TARGET_DIR_LOCAL);
|
Directory.CreateDirectory(TARGET_DIR_LOCAL);
|
||||||
|
|
||||||
string commitHash = null;
|
string commitHash = null;
|
||||||
if (AddAssemblyInfo)
|
if (AddAssemblyInfo)
|
||||||
{
|
{
|
||||||
var commitHashFile = Path.Combine(TARGET_DIR_LOCAL, "commit");
|
var commitHashFile = Path.Combine(TARGET_DIR_LOCAL, "commit");
|
||||||
GitCommand("rev-parse HEAD >> " + commitHashFile);
|
GitCommand("rev-parse HEAD >> " + commitHashFile);
|
||||||
commitHash = File.ReadAllLines(commitHashFile)[0];
|
commitHash = File.ReadAllLines(commitHashFile)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
var projectFiles = Files.Include("src/*/project.json").ToList();
|
var srcProjects = Files.Include(SRC_PROJECT_GLOB_LOCAL).ToList();
|
||||||
if (IsLinux)
|
if (IsLinux)
|
||||||
{
|
{
|
||||||
projectFiles.Remove("src/Microsoft.AspNetCore.DataProtection.SystemWeb/project.json");
|
srcProjects.Remove("src/Microsoft.AspNetCore.DataProtection.SystemWeb/project.json");
|
||||||
}
|
}
|
||||||
|
srcProjects.ForEach(projectFile =>
|
||||||
projectFiles.ForEach(projectFile =>
|
|
||||||
{
|
{
|
||||||
if (AddAssemblyInfo)
|
if (AddAssemblyInfo)
|
||||||
{
|
{
|
||||||
|
|
@ -43,17 +43,17 @@ default BUILD_DIR_LOCAL='${Path.Combine(TARGET_DIR_LOCAL, "build")}'
|
||||||
// the consumers would get that file
|
// the consumers would get that file
|
||||||
if (!isSharedProject)
|
if (!isSharedProject)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Embedding commit hash in assembly");
|
Console.WriteLine("Embedding commit hash in assembly");
|
||||||
var projectFolder = Path.GetDirectoryName(projectFile);
|
var projectFolder = Path.GetDirectoryName(projectFile);
|
||||||
var commitHashAttribute = String.Format("[assembly: System.Reflection.AssemblyMetadata(\"CommitHash\", \"{0}\")]", commitHash);
|
var commitHashAttribute = String.Format("[assembly: System.Reflection.AssemblyMetadata(\"CommitHash\", \"{0}\")]", commitHash);
|
||||||
|
|
||||||
var buildInfoFile = Path.Combine(projectFolder, "BuildInfo.generated.cs");
|
var buildInfoFile = Path.Combine(projectFolder, "BuildInfo.generated.cs");
|
||||||
File.WriteAllText(buildInfoFile, commitHashAttribute);
|
File.WriteAllText(buildInfoFile, commitHashAttribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DotnetPack(projectFile, BUILD_DIR_LOCAL, Configuration_Local, "");
|
||||||
DotnetPack(projectFile, BUILD_DIR_LOCAL, Configuration_Local);
|
|
||||||
});
|
});
|
||||||
|
DotnetBuild(TEST_PROJECT_GLOB_LOCAL, Configuration_Local, BuildFramework);
|
||||||
|
|
||||||
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR_LOCAL, "*/" + Configuration_Local + "/*.nupkg")))
|
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR_LOCAL, "*/" + Configuration_Local + "/*.nupkg")))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue