diff --git a/change/@react-native-windows-cli-4acf7ba6-83e8-4d2f-9200-62e6262440de.json b/change/@react-native-windows-cli-4acf7ba6-83e8-4d2f-9200-62e6262440de.json new file mode 100644 index 00000000000..04985674f85 --- /dev/null +++ b/change/@react-native-windows-cli-4acf7ba6-83e8-4d2f-9200-62e6262440de.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix(cli): ignore msbuild binglog files", + "packageName": "@react-native-windows/cli", + "email": "fcalise@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-0d3127be-c934-43d7-80b6-09ca4f7cbea6.json b/change/react-native-windows-0d3127be-c934-43d7-80b6-09ca4f7cbea6.json new file mode 100644 index 00000000000..5000b8eb1e1 --- /dev/null +++ b/change/react-native-windows-0d3127be-c934-43d7-80b6-09ca4f7cbea6.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix(vnext-templates): update gitignore for MS Build logs", + "packageName": "react-native-windows", + "email": "fcalise@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/@react-native-windows/cli/src/utils/msbuildtools.ts b/packages/@react-native-windows/cli/src/utils/msbuildtools.ts index b7c5a7a6857..b4cae081f1f 100644 --- a/packages/@react-native-windows/cli/src/utils/msbuildtools.ts +++ b/packages/@react-native-windows/cli/src/utils/msbuildtools.ts @@ -9,7 +9,6 @@ import fs from '@react-native-windows/fs'; import path from 'path'; import child_process from 'child_process'; import chalk from 'chalk'; -import os from 'os'; import shell from 'shelljs'; import Version from './version'; import * as checkRequirements from './checkRequirements'; @@ -93,16 +92,16 @@ export default class MSBuildTools { newInfo(`Build platform: ${buildArch}`); const verbosityOption = verbose ? 'normal' : 'minimal'; + const defaultLogDirectory = path.dirname(slnFile); const logPrefix = path.join( - buildLogDirectory || os.tmpdir(), + buildLogDirectory || defaultLogDirectory, `msbuild_${process.pid}_${target}`, ); const errorLog = logPrefix + '.err'; const warnLog = logPrefix + '.wrn'; - const localBinLog = target === 'build' ? '' : ':deploy.binlog'; - const binlog = buildLogDirectory ? `:${logPrefix}.binlog` : localBinLog; + const binlog = `:${logPrefix}.binlog`; const args = [ `/clp:NoSummary;NoItemAndPropertyList;Verbosity=${verbosityOption}`, diff --git a/vnext/templates/cpp-app/windows/_gitignore b/vnext/templates/cpp-app/windows/_gitignore index 5bc72a4416d..05bf397e485 100644 --- a/vnext/templates/cpp-app/windows/_gitignore +++ b/vnext/templates/cpp-app/windows/_gitignore @@ -39,3 +39,8 @@ Ankh.NoLoad #Files generated by the VS build **/Generated Files/** + +#Files genereated by MS build +*.binlog +*.err +*.wrn diff --git a/vnext/templates/cpp-lib/windows/_gitignore b/vnext/templates/cpp-lib/windows/_gitignore index 5bc72a4416d..05bf397e485 100644 --- a/vnext/templates/cpp-lib/windows/_gitignore +++ b/vnext/templates/cpp-lib/windows/_gitignore @@ -39,3 +39,8 @@ Ankh.NoLoad #Files generated by the VS build **/Generated Files/** + +#Files genereated by MS build +*.binlog +*.err +*.wrn