@nx/dotnet 23.3.0-pr.36958.5270397 → 23.3.0-pr.37068.f95e11e
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 +0 -1
- package/dist/analyzer/analyzer-client.d.ts.map +1 -1
- package/dist/analyzer/analyzer-client.js +8 -29
- package/dist/lib/MsbuildAnalyzer.dll +0 -0
- package/dist/lib/MsbuildAnalyzer.pdb +0 -0
- package/dist/lib/MsbuildAnalyzer.runtimeconfig.json +0 -1
- package/dist/plugins/create-nodes.js +9 -9
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer-client.d.ts","sourceRoot":"","sources":["../../src/analyzer/analyzer-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAmBpB,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAIvE;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED,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;
|
|
1
|
+
{"version":3,"file":"analyzer-client.d.ts","sourceRoot":"","sources":["../../src/analyzer/analyzer-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAmBpB,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAIvE;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAK5C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED,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;AAEzE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA4MD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,cAAc,CAAC,CA+DzB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,CASzD;AAED;;GAEG;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"}
|
|
@@ -66,22 +66,6 @@ function getAnalyzerPath() {
|
|
|
66
66
|
async function calculateProjectFilesHash(files) {
|
|
67
67
|
return await (0, internal_1.hashWithWorkspaceContext)(devkit_1.workspaceRoot, files);
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Hash of the files a previous evaluation reported reading. Empty when the
|
|
71
|
-
* result carries none, so a result from an older analyzer never matches and
|
|
72
|
-
* is re-run once.
|
|
73
|
-
*/
|
|
74
|
-
async function calculateEvaluationInputsHash(result) {
|
|
75
|
-
const inputs = result.evaluationInputs ?? [];
|
|
76
|
-
return inputs.length === 0
|
|
77
|
-
? ''
|
|
78
|
-
: await (0, internal_1.hashWithWorkspaceContext)(devkit_1.workspaceRoot, inputs);
|
|
79
|
-
}
|
|
80
|
-
async function isStillValid(entry) {
|
|
81
|
-
return (entry?.result !== undefined &&
|
|
82
|
-
isAnalysisSuccessResult(entry.result) &&
|
|
83
|
-
entry.inputsHash === (await calculateEvaluationInputsHash(entry.result)));
|
|
84
|
-
}
|
|
85
69
|
/**
|
|
86
70
|
* Run the msbuild-analyzer and return the results.
|
|
87
71
|
* Uses stdin for large file lists to avoid ARG_MAX issues.
|
|
@@ -226,40 +210,36 @@ async function runAnalyzer(files, options) {
|
|
|
226
210
|
*/
|
|
227
211
|
async function analyzeProjects(files, options) {
|
|
228
212
|
const filesHash = await calculateProjectFilesHash(files);
|
|
229
|
-
// Return cached results if the
|
|
230
|
-
// previous evaluation imported are both unchanged.
|
|
213
|
+
// Return cached results if the hash matches
|
|
231
214
|
if (cache &&
|
|
232
215
|
cache.hash === filesHash &&
|
|
233
216
|
// NOTE: We don't read from the cache here if it's an error result,
|
|
234
217
|
// to allow retrying analysis in case of transient errors or errors fixed
|
|
235
218
|
// that may not be reflected in the hash (like setting an env var).
|
|
236
|
-
isAnalysisSuccessResult(cache.result)
|
|
237
|
-
(await isStillValid({ result: cache.result, inputsHash: cache.inputsHash }))) {
|
|
219
|
+
isAnalysisSuccessResult(cache.result)) {
|
|
238
220
|
return cache.result;
|
|
239
221
|
}
|
|
240
222
|
const optionsHash = (0, internal_1.hashObject)(options);
|
|
241
223
|
const analyzerCache = new internal_1.PluginCache((0, node_path_1.join)(internal_1.workspaceDataDirectory, `dotnet-${optionsHash}.hash`));
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
224
|
+
const cachedResult = analyzerCache.get(filesHash);
|
|
225
|
+
if (cachedResult) {
|
|
226
|
+
// Update cache
|
|
244
227
|
cache = {
|
|
245
228
|
hash: filesHash,
|
|
246
|
-
|
|
247
|
-
result: persisted.result,
|
|
229
|
+
result: cachedResult,
|
|
248
230
|
};
|
|
249
|
-
return
|
|
231
|
+
return cachedResult;
|
|
250
232
|
}
|
|
251
233
|
// Run the analyzer
|
|
252
234
|
try {
|
|
253
235
|
const result = await runAnalyzer(files, options);
|
|
254
|
-
const inputsHash = await calculateEvaluationInputsHash(result);
|
|
255
236
|
// Update local cache
|
|
256
237
|
cache = {
|
|
257
238
|
hash: filesHash,
|
|
258
|
-
inputsHash,
|
|
259
239
|
result,
|
|
260
240
|
};
|
|
261
241
|
// Update persistent cache
|
|
262
|
-
analyzerCache.set(filesHash,
|
|
242
|
+
analyzerCache.set(filesHash, result);
|
|
263
243
|
analyzerCache.writeToDisk();
|
|
264
244
|
return result;
|
|
265
245
|
}
|
|
@@ -278,7 +258,6 @@ async function analyzeProjects(files, options) {
|
|
|
278
258
|
if (err.message !== exports.ANALYZER_CANCELLED_MESSAGE) {
|
|
279
259
|
cache = {
|
|
280
260
|
hash: filesHash,
|
|
281
|
-
inputsHash: '',
|
|
282
261
|
result: errorResult,
|
|
283
262
|
};
|
|
284
263
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -4,15 +4,15 @@ exports.createNodesV2 = exports.createNodes = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const analyzer_client_1 = require("../analyzer/analyzer-client");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
const dotnetProjectGlob = '**/{*.{csproj,fsproj,vbproj,props,targets},Directory.
|
|
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}';
|
|
16
16
|
/**
|
|
17
17
|
* Merge user-specified target configurations with the generated targets from the analyzer
|
|
18
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/dotnet",
|
|
3
|
-
"version": "23.3.0-pr.
|
|
3
|
+
"version": "23.3.0-pr.37068.f95e11e",
|
|
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": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"tslib": "^2.3.0",
|
|
51
51
|
"ignore": "^7.0.5",
|
|
52
|
-
"@nx/devkit": "23.3.0-pr.
|
|
52
|
+
"@nx/devkit": "23.3.0-pr.37068.f95e11e"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/jest": "30.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"memfs": "^4.9.2",
|
|
59
59
|
"ts-jest": "^29.4.7",
|
|
60
60
|
"typescript": "~6.0.3",
|
|
61
|
-
"nx": "23.3.0-pr.
|
|
61
|
+
"nx": "23.3.0-pr.37068.f95e11e"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|