@nx/dotnet 23.0.0-beta.17 → 23.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/analyzer-client.d.ts +1 -1
- package/dist/analyzer/analyzer-client.d.ts.map +1 -1
- package/dist/analyzer/analyzer-client.js +14 -12
- package/dist/lib/MsbuildAnalyzer.deps.json +2 -2
- package/dist/lib/MsbuildAnalyzer.dll +0 -0
- package/dist/lib/MsbuildAnalyzer.pdb +0 -0
- package/dist/plugins/create-nodes.d.ts.map +1 -1
- package/dist/plugins/create-nodes.js +13 -2
- package/package.json +3 -3
|
@@ -27,7 +27,7 @@ export interface DotNetAnalyzerOptions {
|
|
|
27
27
|
* Results are cached based on the content hash of all project files.
|
|
28
28
|
* This should be called by createNodes to populate the cache.
|
|
29
29
|
*/
|
|
30
|
-
export declare function analyzeProjects(
|
|
30
|
+
export declare function analyzeProjects(files: string[], options?: DotNetAnalyzerOptions): Promise<AnalysisResult>;
|
|
31
31
|
/**
|
|
32
32
|
* Read the cached analysis results without running the analyzer.
|
|
33
33
|
* This should be called by createDependencies, which always runs after createNodes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer-client.d.ts","sourceRoot":"","sources":["../../src/analyzer/analyzer-client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAMzE,MAAM,WAAW,qBAAqB;IAEpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAElD,gBAAgB,EAAE,MAAM,CACtB,MAAM,EACN;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAC7C,CAAC;CACH;AACD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC;CACd;AACD,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,mBAAmB,CAAC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EG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,GACrB,MAAM,IAAI,mBAAmB,CAE/B;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,GACrB,MAAM,IAAI,qBAAqB,CAEjC"}
|
|
@@ -30,21 +30,22 @@ function getAnalyzerPath() {
|
|
|
30
30
|
return path;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
throw new Error(`msbuild-analyzer not found at any expected location. Please build it first with: nx run dotnet:
|
|
33
|
+
throw new Error(`msbuild-analyzer not found at any expected location. Please build it first with: nx run dotnet:copy-assets`);
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Hash every file that affects MSBuild evaluation — project files plus the Directory.*
|
|
37
|
+
* matches surfaced by the createNodesV2 glob. The analyzer partitions the same list on
|
|
38
|
+
* its side, so we don't classify it here.
|
|
37
39
|
*/
|
|
38
|
-
async function calculateProjectFilesHash(
|
|
39
|
-
|
|
40
|
-
return hash;
|
|
40
|
+
async function calculateProjectFilesHash(files) {
|
|
41
|
+
return await (0, workspace_context_1.hashWithWorkspaceContext)(devkit_1.workspaceRoot, files);
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* Run the msbuild-analyzer and return the results.
|
|
44
45
|
* Uses stdin for large file lists to avoid ARG_MAX issues.
|
|
45
46
|
*/
|
|
46
|
-
function runAnalyzer(
|
|
47
|
-
if (
|
|
47
|
+
function runAnalyzer(files, options) {
|
|
48
|
+
if (files.length === 0) {
|
|
48
49
|
return { nodesByFile: {}, referencesByRoot: {} };
|
|
49
50
|
}
|
|
50
51
|
const analyzerPath = getAnalyzerPath();
|
|
@@ -82,8 +83,9 @@ function runAnalyzer(projectFiles, options) {
|
|
|
82
83
|
if (options) {
|
|
83
84
|
args.push(JSON.stringify(options));
|
|
84
85
|
}
|
|
85
|
-
// Use stdin mode for large file lists to avoid ARG_MAX issues
|
|
86
|
-
|
|
86
|
+
// Use stdin mode for large file lists to avoid ARG_MAX issues. The analyzer
|
|
87
|
+
// partitions paths by filename, so we just stream everything in one block.
|
|
88
|
+
const input = files.join('\n');
|
|
87
89
|
const result = (0, node_child_process_1.spawnSync)('dotnet', args, {
|
|
88
90
|
input,
|
|
89
91
|
encoding: 'utf-8',
|
|
@@ -118,8 +120,8 @@ function runAnalyzer(projectFiles, options) {
|
|
|
118
120
|
* Results are cached based on the content hash of all project files.
|
|
119
121
|
* This should be called by createNodes to populate the cache.
|
|
120
122
|
*/
|
|
121
|
-
async function analyzeProjects(
|
|
122
|
-
const filesHash = await calculateProjectFilesHash(
|
|
123
|
+
async function analyzeProjects(files, options) {
|
|
124
|
+
const filesHash = await calculateProjectFilesHash(files);
|
|
123
125
|
// Return cached results if the hash matches
|
|
124
126
|
if (cache &&
|
|
125
127
|
cache.hash === filesHash &&
|
|
@@ -142,7 +144,7 @@ async function analyzeProjects(projectFiles, options) {
|
|
|
142
144
|
}
|
|
143
145
|
// Run the analyzer
|
|
144
146
|
try {
|
|
145
|
-
const result = runAnalyzer(
|
|
147
|
+
const result = runAnalyzer(files, options);
|
|
146
148
|
// Update local cache
|
|
147
149
|
cache = {
|
|
148
150
|
hash: filesHash,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"compilationOptions": {},
|
|
7
7
|
"targets": {
|
|
8
8
|
".NETCoreApp,Version=v8.0": {
|
|
9
|
-
"MsbuildAnalyzer/
|
|
9
|
+
"MsbuildAnalyzer/23.0.0-beta.19": {
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"Microsoft.Build": "17.0.0",
|
|
12
12
|
"Microsoft.Build.Framework": "17.0.0",
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
"libraries": {
|
|
225
|
-
"MsbuildAnalyzer/
|
|
225
|
+
"MsbuildAnalyzer/23.0.0-beta.19": {
|
|
226
226
|
"type": "project",
|
|
227
227
|
"serviceable": false,
|
|
228
228
|
"sha512": ""
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-nodes.d.ts","sourceRoot":"","sources":["../../src/plugins/create-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAOpB,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IACvE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,IAAI,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC9C;;;OAGG;IACH,IAAI,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,GAAG,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"create-nodes.d.ts","sourceRoot":"","sources":["../../src/plugins/create-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAOpB,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IACvE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,IAAI,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC9C;;;OAGG;IACH,IAAI,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;IAC5C;;;OAGG;IACH,GAAG,CAAC,EAAE,2BAA2B,GAAG,KAAK,CAAC;CAC3C;AAqFD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CA6E5D,CAAC"}
|
|
@@ -4,7 +4,15 @@ exports.createNodesV2 = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const analyzer_client_1 = require("../analyzer/analyzer-client");
|
|
6
6
|
const project_configuration_utils_1 = require("nx/src/project-graph/utils/project-configuration-utils");
|
|
7
|
-
|
|
7
|
+
// MSBuild auto-imports Directory.Build.props/.targets from each ancestor of a project file,
|
|
8
|
+
// reads Directory.Build.rsp from ancestors during CLI builds, applies Directory.Solution.*
|
|
9
|
+
// when building a .sln, and reads Directory.Packages.props from the nearest ancestor when
|
|
10
|
+
// Central Package Management is in use. Matching them here causes createNodesV2 to re-run
|
|
11
|
+
// (and the analyzer's cache to invalidate) when any of them change, and gives us the file
|
|
12
|
+
// list to hand to the analyzer so it can declare per-project ancestor inputs.
|
|
13
|
+
// The analyzer partitions matched paths into project vs directory files by filename, so we
|
|
14
|
+
// don't have to repeat that classification on this side.
|
|
15
|
+
const dotnetProjectGlob = '**/{*.{csproj,fsproj,vbproj},Directory.Build.{props,targets,rsp},Directory.Solution.{props,targets},Directory.Packages.props}';
|
|
8
16
|
/**
|
|
9
17
|
* Merge user-specified target configurations with the generated targets from the analyzer
|
|
10
18
|
*/
|
|
@@ -91,9 +99,12 @@ exports.createNodesV2 = [
|
|
|
91
99
|
return configFilePaths.map((configFile) => {
|
|
92
100
|
const node = nodesByFile[configFile];
|
|
93
101
|
if (!node) {
|
|
102
|
+
// Directory.Build.* / Directory.Solution.* files contribute no projects of
|
|
103
|
+
// their own; returning an empty config is the conventional "skip" response.
|
|
94
104
|
return [configFile, {}];
|
|
95
105
|
}
|
|
96
|
-
// Merge user-specified target configurations with generated targets
|
|
106
|
+
// Merge user-specified target configurations with generated targets. The analyzer
|
|
107
|
+
// has already written the Directory.* inputs onto each cacheable target's Inputs.
|
|
97
108
|
const mergedNode = mergeUserTargetConfigurations(node, normalizedOptions);
|
|
98
109
|
return [
|
|
99
110
|
configFile,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/dotnet",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for .NET containing graph support for working with .NET projects in an Nx workspace.",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"!dist/tsconfig.lib.tsbuildinfo"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@nx/devkit": "23.0.0-beta.
|
|
53
|
+
"@nx/devkit": "23.0.0-beta.19",
|
|
54
54
|
"tslib": "^2.3.0",
|
|
55
55
|
"ignore": "^7.0.5"
|
|
56
56
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/node": "^24.11.0",
|
|
60
60
|
"jest": "30.3.0",
|
|
61
61
|
"memfs": "^4.9.2",
|
|
62
|
-
"nx": "23.0.0-beta.
|
|
62
|
+
"nx": "23.0.0-beta.19",
|
|
63
63
|
"ts-jest": "^29.4.0",
|
|
64
64
|
"typescript": "~5.9.2"
|
|
65
65
|
},
|