Skip to content

Commit

Permalink
Updated SDK version and removed the hardcoded version when reading fr…
Browse files Browse the repository at this point in the history
…om JSON file (#3372)
  • Loading branch information
kartheekp-ms authored and heng-liu committed Jun 12, 2020
1 parent ebf0ad1 commit 8c69016
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build/config.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<!-- when LockSDKVersion is false, it will ignore the properties and just use the latest version for the channel specified in CliVersionForBuilding for building, CliBranchForTesting for testing -->
<LockSDKVersion>true</LockSDKVersion>
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'false'"></OverrideCliBranchForTesting>
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'true'">master 5.0.100-alpha1-015516</OverrideCliBranchForTesting>
<OverrideCliBranchForTesting Condition="'$(LockSDKVersion)' == 'true'">master</OverrideCliBranchForTesting>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'false'">master</CliVersionForBuilding>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'true'">"master 5.0.100-alpha1-015516"</CliVersionForBuilding>
<CliVersionForBuilding Condition="'$(LockSDKVersion)' == 'true'">"master 5.0.100-preview.3.20216.6"</CliVersionForBuilding>
<CliBranchForTesting Condition="'$(OverrideCliBranchForTesting)' != ''">$(OverrideCliBranchForTesting)</CliBranchForTesting>
<CliBranchForTesting Condition="'$(OverrideCliBranchForTesting)' == ''">master</CliBranchForTesting>
<CliTargetBranches Condition="'$(OverrideCliTargetBranches)' != ''">$(OverrideCliTargetBranches)</CliTargetBranches>
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "5.0.100-alpha1"
}
}
"sdk": {
"version": "5.0.100-preview.3.20216.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ private void CopyNewlyAddedDlls(string[] assemblyNames, string copyFromPath, str

private void PatchDepsJsonWithNewlyAddedDlls(string[] assemblyNames, string[] filePaths)
{
string nugetBuildTasksName = "NuGet.Build.Tasks/5.3.0-rtm.6251";
foreach (string assemblyName in assemblyNames)
{
foreach (string filePath in filePaths)
Expand All @@ -496,7 +495,10 @@ private void PatchDepsJsonWithNewlyAddedDlls(string[] assemblyNames, string[] fi

JObject netcoreapp50 = targets.GetJObjectProperty<JObject>(".NETCoreApp,Version=v5.0");

JObject nugetBuildTasks = netcoreapp50.GetJObjectProperty<JObject>(nugetBuildTasksName);
JProperty nugetBuildTasksProperty = netcoreapp50.Properties().
FirstOrDefault(prop => prop.Name.StartsWith("NuGet.Build.Tasks/", StringComparison.OrdinalIgnoreCase));

JObject nugetBuildTasks = nugetBuildTasksProperty.Value.FromJToken<JObject>();

JObject runtime = nugetBuildTasks.GetJObjectProperty<JObject>("runtime");

Expand All @@ -512,7 +514,7 @@ private void PatchDepsJsonWithNewlyAddedDlls(string[] assemblyNames, string[] fi
);
runtime.Add(jproperty);
nugetBuildTasks["runtime"] = runtime;
netcoreapp50[nugetBuildTasksName] = nugetBuildTasks;
netcoreapp50[nugetBuildTasksProperty.Name] = nugetBuildTasks;
targets[".NETCoreApp,Version=v5.0"] = netcoreapp50;
jsonFile["targets"] = targets;
SaveJson(jsonFile, filePath);
Expand Down

0 comments on commit 8c69016

Please sign in to comment.