Skip to content

Commit 3f259a0

Browse files
authored
Merge config infrastructure fixes (#20771)
* ci * fix verify-registries.js to handle deleted configs * fix for merging tasks with multiple configs * ci
1 parent c67526e commit 3f259a0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

BuildConfigGen/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ private static void MainUpdateTask(
554554
ensureUpdateModeVerifier!.DirectoryCreateDirectory(generatedFolder, false);
555555
}
556556

557-
foreach (var config in targetConfigs)
557+
// we need to ensure merges occur first, as the changes may cascade to other configs (e.g. Default), if there are multiple
558+
var targetConfigsWithMergeToBaseOrderedFirst = targetConfigs.OrderBy(x => x.mergeToBase ? 0 : 1);
559+
560+
foreach (var config in targetConfigsWithMergeToBaseOrderedFirst)
558561
{
559562
if (config.useGlobalVersion && !includeLocalPackagesBuildConfig)
560563
{

BuildConfigGen/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"BuildConfigGen": {
44
"commandName": "Project",
5-
"commandLineArgs": "--task \"MavenV3|MavenV4\" --include-local-packages-build-config --write-updates"
5+
"commandLineArgs": "--all-tasks --write-updates"
66
}
77
}
88
}

ci/verify-registries.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
const { run } = require('./ci-util');
22
const { resolve } = require('node:path');
33
const { readFileSync } = require('node:fs');
4+
const { existsSync } = require('fs');
45

56
const cwd = process.cwd();
67
const packageLocks = run(`git --no-pager diff --name-only origin/master`).split('\n').filter(x => x.endsWith('package-lock.json')).map(x => resolve(cwd, x));
78
const incorrectPackageLocks = [];
89

910
for (const packageLock of packageLocks) {
10-
if (readFileSync(packageLock, 'utf8').indexOf('registry.npmjs.org') !== -1) {
11+
if (existsSync(packageLock) && readFileSync(packageLock, 'utf8').indexOf('registry.npmjs.org') !== -1) {
1112
incorrectPackageLocks.push(packageLock);
1213
}
1314
}

0 commit comments

Comments
 (0)