Merge pull request #3241 from eerhardt/UpdateCoreFX
Enhance update-dependencies
This commit is contained in:
commit
8e1b587d34
15 changed files with 111 additions and 89 deletions
|
@ -51,7 +51,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Files", "s
|
|||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet.Tests", "test\dotnet.Tests\dotnet.Tests.xproj", "{CB710268-4A82-48E4-9531-FAF1C8F78F4B}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{88278B81-7649-45DC-8A6A-D3A645C5AFC3}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build_projects", "build_projects", "{88278B81-7649-45DC-8A6A-D3A645C5AFC3}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-compile.UnitTests", "test\dotnet-compile.UnitTests\dotnet-compile.UnitTests.xproj", "{920B71D8-62DA-4F5E-8A26-926C113F1D97}"
|
||||
EndProject
|
||||
|
@ -75,8 +75,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-test.UnitTests", "te
|
|||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-test.Tests", "test\dotnet-test.Tests\dotnet-test.Tests.xproj", "{60C33D0A-A5D8-4AB0-9956-1F804654DF05}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "update-dependencies", "scripts\update-dependencies\update-dependencies.xproj", "{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Cli.Utils.Tests", "test\Microsoft.DotNet.Cli.Utils.Tests\Microsoft.DotNet.Cli.Utils.Tests.xproj", "{09C52F96-EFDD-4448-95EC-6D362DD60BAA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestingAbstractions", "TestingAbstractions", "{EB0F5F8C-0991-49AC-B188-A9869476C7DF}"
|
||||
|
@ -113,6 +111,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Cli.Build.
|
|||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "shared-build-targets-utils", "build_projects\shared-build-targets-utils\shared-build-targets-utils.xproj", "{B768BD29-12BF-4C7C-B093-03193FE244D1}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "update-dependencies", "build_projects\update-dependencies\update-dependencies.xproj", "{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -557,22 +557,6 @@ Global
|
|||
{60C33D0A-A5D8-4AB0-9956-1F804654DF05}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{60C33D0A-A5D8-4AB0-9956-1F804654DF05}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{60C33D0A-A5D8-4AB0-9956-1F804654DF05}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|x64.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
|
@ -813,6 +797,22 @@ Global
|
|||
{B768BD29-12BF-4C7C-B093-03193FE244D1}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{B768BD29-12BF-4C7C-B093-03193FE244D1}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{B768BD29-12BF-4C7C-B093-03193FE244D1}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.MinSizeRel|x64.Build.0 = Debug|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -847,7 +847,6 @@ Global
|
|||
{0724ED7C-56E3-4604-9970-25E600611383} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||
{857274AC-E741-4266-A7FD-14DEE0C1CC96} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{60C33D0A-A5D8-4AB0-9956-1F804654DF05} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
{09C52F96-EFDD-4448-95EC-6D362DD60BAA} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{EB0F5F8C-0991-49AC-B188-A9869476C7DF} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{0A37AB59-BDB5-4957-9BB8-D965F9A67A5B} = {EB0F5F8C-0991-49AC-B188-A9869476C7DF}
|
||||
|
@ -866,5 +865,6 @@ Global
|
|||
{D7B9695D-23EB-4EA8-B8AB-707A0092E1D5} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
{49BEB486-AB5A-4416-91EA-8CD34ABB0C9D} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
{B768BD29-12BF-4C7C-B093-03193FE244D1} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"System.Reflection.TypeExtensions": "4.1.0-rc3-24123-01"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard1.6": {
|
||||
"netstandard1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
|||
# Restore the build scripts
|
||||
Write-Host "Restoring Build Script projects..."
|
||||
pushd "$PSScriptRoot\.."
|
||||
dotnet restore --infer-runtimes
|
||||
dotnet restore
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
|
||||
popd
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ fi
|
|||
echo "Restoring Build Script projects..."
|
||||
(
|
||||
cd "$DIR/.."
|
||||
dotnet restore --infer-runtimes
|
||||
dotnet restore
|
||||
)
|
||||
|
||||
# Build the builder
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Scripts
|
|||
///
|
||||
/// The following Environment Variables can optionally be specified:
|
||||
///
|
||||
/// COREFX_VERSION_URL - The Url to get the current CoreFx version. (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/master/Latest.txt")
|
||||
/// COREFX_VERSION_URL - The Url to get the current CoreFx package versions. (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/release/1.0.0/Latest_Packages.txt")
|
||||
/// GITHUB_ORIGIN_OWNER - The owner of the GitHub fork to push the commit and create the PR from. (ex. "dotnet-bot")
|
||||
/// GITHUB_UPSTREAM_OWNER - The owner of the GitHub base repo to create the PR to. (ex. "dotnet")
|
||||
/// GITHUB_PROJECT - The repo name under the ORIGIN and UPSTREAM owners. (ex. "cli")
|
||||
|
@ -33,7 +33,7 @@ namespace Microsoft.DotNet.Scripts
|
|||
private Lazy<string> _email = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_EMAIL"));
|
||||
private Lazy<string> _password = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PASSWORD"));
|
||||
|
||||
private Lazy<string> _coreFxVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("COREFX_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/master/Latest.txt"));
|
||||
private Lazy<string> _coreFxVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("COREFX_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info/dotnet/corefx/release/1.0.0/Latest_Packages.txt"));
|
||||
private Lazy<string> _gitHubOriginOwner;
|
||||
private Lazy<string> _gitHubUpstreamOwner = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet"));
|
||||
private Lazy<string> _gitHubProject = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli"));
|
|
@ -1,15 +1,23 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NuGet.Versioning;
|
||||
|
||||
namespace Microsoft.DotNet.Scripts
|
||||
{
|
||||
public class DependencyInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string IdPattern { get; set; }
|
||||
public string IdExclusionPattern { get; set; }
|
||||
public List<PackageInfo> NewVersions { get; set; }
|
||||
public string NewReleaseVersion { get; set; }
|
||||
|
||||
public bool IsUpdated { get; set; }
|
||||
}
|
||||
|
||||
public class PackageInfo
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public NuGetVersion Version { get; set; }
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
|||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
@ -28,24 +29,51 @@ namespace Microsoft.DotNet.Scripts
|
|||
[Target]
|
||||
public static BuildTargetResult GetDependencies(BuildTargetContext c)
|
||||
{
|
||||
string coreFxLkgVersion = s_client.GetStringAsync(Config.Instance.CoreFxVersionUrl).Result;
|
||||
coreFxLkgVersion = coreFxLkgVersion.Trim();
|
||||
|
||||
const string coreFxIdPattern = @"^(?i)((System\..*)|(NETStandard\.Library)|(Microsoft\.CSharp)|(Microsoft\.NETCore.*)|(Microsoft\.TargetingPack\.Private\.(CoreCLR|NETNative))|(Microsoft\.Win32\..*)|(Microsoft\.VisualBasic))$";
|
||||
const string coreFxIdExclusionPattern = @"System.CommandLine|Microsoft.NETCore.App";
|
||||
|
||||
List<DependencyInfo> dependencyInfos = c.GetDependencyInfos();
|
||||
dependencyInfos.Add(new DependencyInfo()
|
||||
{
|
||||
Name = "CoreFx",
|
||||
IdPattern = coreFxIdPattern,
|
||||
IdExclusionPattern = coreFxIdExclusionPattern,
|
||||
NewReleaseVersion = coreFxLkgVersion
|
||||
});
|
||||
|
||||
dependencyInfos.Add(CreateDependencyInfo("CoreFx", Config.Instance.CoreFxVersionUrl).Result);
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
private static async Task<DependencyInfo> CreateDependencyInfo(string name, string packageVersionsUrl)
|
||||
{
|
||||
List<PackageInfo> newPackageVersions = new List<PackageInfo>();
|
||||
|
||||
using (Stream versionsStream = await s_client.GetStreamAsync(packageVersionsUrl))
|
||||
using (StreamReader reader = new StreamReader(versionsStream))
|
||||
{
|
||||
string currentLine;
|
||||
while ((currentLine = await reader.ReadLineAsync()) != null)
|
||||
{
|
||||
int spaceIndex = currentLine.IndexOf(' ');
|
||||
|
||||
newPackageVersions.Add(new PackageInfo()
|
||||
{
|
||||
Id = currentLine.Substring(0, spaceIndex),
|
||||
Version = new NuGetVersion(currentLine.Substring(spaceIndex + 1))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
string newReleaseVersion = newPackageVersions
|
||||
.Where(p => p.Version.IsPrerelease)
|
||||
.Select(p => p.Version.Release)
|
||||
.FirstOrDefault()
|
||||
??
|
||||
// if there are no prerelease versions, just grab the first version
|
||||
newPackageVersions
|
||||
.Select(p => p.Version.ToNormalizedString())
|
||||
.FirstOrDefault();
|
||||
|
||||
return new DependencyInfo()
|
||||
{
|
||||
Name = name,
|
||||
NewVersions = newPackageVersions,
|
||||
NewReleaseVersion = newReleaseVersion
|
||||
};
|
||||
}
|
||||
|
||||
[Target(nameof(ReplaceProjectJson), nameof(ReplaceCrossGen))]
|
||||
public static BuildTargetResult ReplaceVersions(BuildTargetContext c) => c.Success();
|
||||
|
||||
|
@ -57,9 +85,12 @@ namespace Microsoft.DotNet.Scripts
|
|||
{
|
||||
List<DependencyInfo> dependencyInfos = c.GetDependencyInfos();
|
||||
|
||||
const string noUpdateFileName = ".noautoupdate";
|
||||
|
||||
IEnumerable<string> projectJsonFiles = Enumerable.Union(
|
||||
Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories),
|
||||
Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.pretemplate", SearchOption.AllDirectories));
|
||||
Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.pretemplate", SearchOption.AllDirectories))
|
||||
.Where(p => !File.Exists(Path.Combine(Path.GetDirectoryName(p), noUpdateFileName)));
|
||||
|
||||
JObject projectRoot;
|
||||
foreach (string projectJsonFile in projectJsonFiles)
|
||||
|
@ -103,52 +134,23 @@ namespace Microsoft.DotNet.Scripts
|
|||
string id = dependencyProperty.Name;
|
||||
foreach (DependencyInfo dependencyInfo in dependencyInfos)
|
||||
{
|
||||
if (Regex.IsMatch(id, dependencyInfo.IdPattern))
|
||||
foreach (PackageInfo packageInfo in dependencyInfo.NewVersions)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dependencyInfo.IdExclusionPattern) || !Regex.IsMatch(id, dependencyInfo.IdExclusionPattern))
|
||||
if (id == packageInfo.Id)
|
||||
{
|
||||
string version;
|
||||
if (dependencyProperty.Value is JObject)
|
||||
{
|
||||
version = dependencyProperty.Value["version"].Value<string>();
|
||||
}
|
||||
else if (dependencyProperty.Value is JValue)
|
||||
{
|
||||
version = dependencyProperty.Value.ToString();
|
||||
dependencyProperty.Value["version"] = packageInfo.Version.ToNormalizedString();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Invalid package project.json version {dependencyProperty}");
|
||||
dependencyProperty.Value = packageInfo.Version.ToNormalizedString();
|
||||
}
|
||||
|
||||
VersionRange dependencyVersionRange = VersionRange.Parse(version);
|
||||
NuGetVersion dependencyVersion = dependencyVersionRange.MinVersion;
|
||||
// mark the DependencyInfo as updated so we can tell which dependencies were updated
|
||||
dependencyInfo.IsUpdated = true;
|
||||
|
||||
string newReleaseVersion = dependencyInfo.NewReleaseVersion;
|
||||
|
||||
if (!string.IsNullOrEmpty(dependencyVersion.Release) && dependencyVersion.Release != newReleaseVersion)
|
||||
{
|
||||
string newVersion = new NuGetVersion(
|
||||
dependencyVersion.Major,
|
||||
dependencyVersion.Minor,
|
||||
dependencyVersion.Patch,
|
||||
newReleaseVersion,
|
||||
dependencyVersion.Metadata).ToNormalizedString();
|
||||
|
||||
if (dependencyProperty.Value is JObject)
|
||||
{
|
||||
dependencyProperty.Value["version"] = newVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
dependencyProperty.Value = newVersion;
|
||||
}
|
||||
|
||||
// mark the DependencyInfo as updated so we can tell which dependencies were updated
|
||||
dependencyInfo.IsUpdated = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,5 +24,15 @@
|
|||
"portable-net45+win"
|
||||
]
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win7-x64": { },
|
||||
"win7-x86": { },
|
||||
"osx.10.10-x64": { },
|
||||
"osx.10.11-x64": { },
|
||||
"ubuntu.14.04-x64": { },
|
||||
"centos.7-x64": { },
|
||||
"rhel.7.2-x64": { },
|
||||
"debian.8-x64": { }
|
||||
}
|
||||
}
|
|
@ -17,35 +17,37 @@ if($Help)
|
|||
exit 0
|
||||
}
|
||||
|
||||
$RepoRoot = "$PSScriptRoot\..\.."
|
||||
$AppPath = "$PSScriptRoot"
|
||||
|
||||
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
|
||||
if (!$env:DOTNET_INSTALL_DIR)
|
||||
{
|
||||
$env:DOTNET_INSTALL_DIR="$PSScriptRoot\..\.dotnet_stage0\Windows\$Architecture"
|
||||
$env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\Windows\$Architecture"
|
||||
}
|
||||
|
||||
# Install a stage 0
|
||||
Write-Host "Installing .NET Core CLI Stage 0"
|
||||
& "$PSScriptRoot\obtain\dotnet-install.ps1" -Architecture x64
|
||||
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Architecture x64
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
|
||||
|
||||
# Put the stage0 on the path
|
||||
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
||||
|
||||
$appPath = "$PSScriptRoot\update-dependencies"
|
||||
|
||||
# Restore the build scripts
|
||||
Write-Host "Restoring Build Script projects..."
|
||||
pushd $PSScriptRoot
|
||||
dotnet restore --infer-runtimes
|
||||
# Restore the build_projects
|
||||
Write-Host "Restoring Build projects..."
|
||||
pushd "$RepoRoot\build_projects"
|
||||
dotnet restore
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
|
||||
popd
|
||||
|
||||
# Publish the app
|
||||
Write-Host "Compiling App $appPath..."
|
||||
dotnet publish "$appPath" -o "$appPath\bin" --framework netcoreapp1.0
|
||||
Write-Host "Compiling App..."
|
||||
dotnet publish "$AppPath" -o "$AppPath\bin" --framework netcoreapp1.0
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" }
|
||||
|
||||
# Run the app
|
||||
Write-Host "Invoking App $appPath..."
|
||||
Write-Host "Invoking App $AppPath..."
|
||||
Write-Host " Configuration: $env:CONFIGURATION"
|
||||
& "$appPath\bin\update-dependencies.exe" @Targets
|
||||
& "$AppPath\bin\update-dependencies.exe" @Targets
|
||||
if($LASTEXITCODE -ne 0) { throw "Build failed" }
|
Loading…
Reference in a new issue