Skip to content

Commit 5005dc0

Browse files
frankcaliseanupriya13Copilot
authored
fix(cli): ignore msbuild binlog files (#14621)
* fix(vnext-templates): update gitignore for MS Build logs * fix(rnw-msbuildtools): default to windows dir for MS Build logs * Change files * Update vnext/templates/cpp-lib/windows/_gitignore Co-authored-by: Copilot <[email protected]> * Update _gitignore --------- Co-authored-by: Anupriya Verma <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent ee27eae commit 5005dc0

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix(cli): ignore msbuild binglog files",
4+
"packageName": "@react-native-windows/cli",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix(vnext-templates): update gitignore for MS Build logs",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/@react-native-windows/cli/src/utils/msbuildtools.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import fs from '@react-native-windows/fs';
99
import path from 'path';
1010
import child_process from 'child_process';
1111
import chalk from 'chalk';
12-
import os from 'os';
1312
import shell from 'shelljs';
1413
import Version from './version';
1514
import * as checkRequirements from './checkRequirements';
@@ -93,16 +92,16 @@ export default class MSBuildTools {
9392
newInfo(`Build platform: ${buildArch}`);
9493

9594
const verbosityOption = verbose ? 'normal' : 'minimal';
95+
const defaultLogDirectory = path.dirname(slnFile);
9696
const logPrefix = path.join(
97-
buildLogDirectory || os.tmpdir(),
97+
buildLogDirectory || defaultLogDirectory,
9898
`msbuild_${process.pid}_${target}`,
9999
);
100100

101101
const errorLog = logPrefix + '.err';
102102
const warnLog = logPrefix + '.wrn';
103103

104-
const localBinLog = target === 'build' ? '' : ':deploy.binlog';
105-
const binlog = buildLogDirectory ? `:${logPrefix}.binlog` : localBinLog;
104+
const binlog = `:${logPrefix}.binlog`;
106105

107106
const args = [
108107
`/clp:NoSummary;NoItemAndPropertyList;Verbosity=${verbosityOption}`,

vnext/templates/cpp-app/windows/_gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ Ankh.NoLoad
3939

4040
#Files generated by the VS build
4141
**/Generated Files/**
42+
43+
#Files generated by MS build
44+
*.binlog
45+
*.err
46+
*.wrn

vnext/templates/cpp-lib/windows/_gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ Ankh.NoLoad
3939

4040
#Files generated by the VS build
4141
**/Generated Files/**
42+
43+
#Files generated by MS build
44+
*.binlog
45+
*.err
46+
*.wrn

0 commit comments

Comments
 (0)