From bc33f50c50fbed7fef86a94624d50379ec518996 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 15 Jan 2020 20:36:19 -0800 Subject: [PATCH 1/2] Fix Layout-Headers on CI machines CI machines pass an environment variable as a custom build property to MSBuild in order to change intermediate build directory. Rely on this environment variable if set. --- vnext/Scripts/Tfs/Layout-Headers.ps1 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vnext/Scripts/Tfs/Layout-Headers.ps1 b/vnext/Scripts/Tfs/Layout-Headers.ps1 index ed2d82c06b5..f0b5fda3697 100644 --- a/vnext/Scripts/Tfs/Layout-Headers.ps1 +++ b/vnext/Scripts/Tfs/Layout-Headers.ps1 @@ -5,14 +5,26 @@ param( [string] $SourceRoot = ($PSScriptRoot | Split-Path | Split-Path | Split-Path), [string] $TargetRoot = "$SourceRoot\vnext\target", [System.IO.DirectoryInfo] $ReactWindowsRoot = "$SourceRoot\vnext", - [System.IO.DirectoryInfo] $ReactNativeRoot = "$SourceRoot\vnext\build\" + @(gci "$ReactWindowsRoot\build\" react-native-patched -Recurse -Directory -Name)[0], + [System.IO.DirectoryInfo] $ReactNativeRoot, [string] $FollyVersion = '2019.09.30.00', [System.IO.DirectoryInfo] $FollyRoot = "$SourceRoot\node_modules\.folly\folly-${FollyVersion}", [string[]] $Extensions = ('h', 'hpp', 'def') ) +if (!$ReactNativeRoot) { + $intermediateBuildDir = if ($env:BaseIntDir) { $env:BaseIntDir } else { "$SourceRoot\vnext\build\" } + $relativeRnDir = @(gci $intermediateBuildDir react-native-patched -Recurse -Directory -Name)[0] + + if (!$relativeRnDir) { + throw "Cannot find patched React Native Directory (has a project been built?)" + } + + $ReactNativeRoot = $intermediateBuildDir + $relativeRnDir +} + Write-Host "Source root: [$SourceRoot]" Write-Host "Destination root: [$TargetRoot]" +Write-Host "React Native root: [$ReactNativeRoot]" $patterns = $Extensions| ForEach-Object {"*.$_"} From 90f062151d16983b607ca36de70e7cbb977263af Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 15 Jan 2020 20:42:30 -0800 Subject: [PATCH 2/2] Change files --- .../react-native-windows-2020-01-15-20-42-29-master.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 change/react-native-windows-2020-01-15-20-42-29-master.json diff --git a/change/react-native-windows-2020-01-15-20-42-29-master.json b/change/react-native-windows-2020-01-15-20-42-29-master.json new file mode 100644 index 00000000000..4a1f00ab34f --- /dev/null +++ b/change/react-native-windows-2020-01-15-20-42-29-master.json @@ -0,0 +1,8 @@ +{ + "type": "none", + "comment": "Fix Layout-Headers on CI machines", + "packageName": "react-native-windows", + "email": "nick@nickgerleman.com", + "commit": "bc33f50c50fbed7fef86a94624d50379ec518996", + "date": "2020-01-16T04:42:29.828Z" +} \ No newline at end of file