From 68c1b768055ba1fb7d5fcab11a75ad043b7754aa Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Thu, 12 Dec 2019 12:15:47 -0800 Subject: [PATCH 1/7] init --- .ado/e2e-test.yml | 16 ------------- .ado/templates/build-rnw.yml | 4 ++-- .ado/templates/e2e-test-job.yml | 24 ++++++++----------- .ado/templates/prepare-env.yml | 20 ++++++++++++---- .ado/templates/react-native-init.yml | 3 ++- .ado/variables/msbuild.yml | 1 + .ado/variables/vs2017.yml | 1 + .ado/variables/vs2019.yml | 1 + .ado/windows-vs-pr.yml | 13 +++++----- ...windows-2019-12-11-13-44-04-OneFolder.json | 8 +++++++ .../SampleLibraryCS/SampleLibraryCS.csproj | 1 + vnext/Directory.Build.props | 6 ++--- vnext/Directory.Build.targets | 1 + 13 files changed, 53 insertions(+), 46 deletions(-) delete mode 100644 .ado/e2e-test.yml create mode 100644 change/react-native-windows-2019-12-11-13-44-04-OneFolder.json diff --git a/.ado/e2e-test.yml b/.ado/e2e-test.yml deleted file mode 100644 index 42659e22349..00000000000 --- a/.ado/e2e-test.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file defines the Windows Visual Studio PR build steps used during the CI loop -name: $(Date:yyyyMMdd).$(Rev:.r) - -trigger: none # will disable CI builds entirely - -pr: - - master - -jobs: - - template: templates/e2e-test-job.yml # Template reference - parameters: - name: E2ETest - pool: - vmImage: vs2017-win2016 - BuildPlatform: x64 - UseRNFork: true diff --git a/.ado/templates/build-rnw.yml b/.ado/templates/build-rnw.yml index 052ebb81e6c..200cb64232a 100644 --- a/.ado/templates/build-rnw.yml +++ b/.ado/templates/build-rnw.yml @@ -14,7 +14,7 @@ parameters: yarnBuildCmd: build # Visual Studio Installer - vsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' + vsInstallerUri: $(VsInstallerUri) vsComponents: '' steps: @@ -25,7 +25,6 @@ steps: vsComponents: ${{ parameters.vsComponents }} yarnBuildCmd: ${{ parameters.yarnBuildCmd }} debug: ${{ parameters.debug }} - forceVSDependencies: false - task: NuGetCommand@2 displayName: NuGet restore @@ -51,6 +50,7 @@ steps: /p:PreferredToolArchitecture=${{parameters.preferredToolArchitecture}} /p:PlatformToolset=${{parameters.platformToolset}} ${{parameters.msbuildArguments}} + /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) - task: PublishBuildArtifacts@1 condition: succeededOrFailed() diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 0e876a7ee7c..9d1748ba675 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -1,20 +1,24 @@ # parameters: name: '' - pool: BuildPlatform: x86 # ARM, x86, x64 UseRNFork: true - vsComponents: '' - vsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' - + jobs: - job: ${{ parameters.name }} displayName: E2E Test dependsOn: Setup condition: ne( dependencies.Setup.outputs['checkPayload.shouldSkipPRBuild'], 'True' ) - pool: ${{ parameters.pool }} + pool: + vmImage: windows-2019 # E2ETest can only be executed on windows-2019 or above + variables: # override vs2017.yml variables because windows-vs-pr is still using vs2017.yml + VsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 + ReactNativeWindowsBuildDir: + VmImage: windows-2019 + timeoutInMinutes: 60 # how long to run the job before automatically cancelling cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them + steps: - checkout: self clean: false @@ -23,10 +27,8 @@ jobs: - template: prepare-env.yml parameters: useRnFork: ${{ parameters.UseRNFork }} - vsComponents: ${{ parameters.vsComponents }} + vsComponents: $(VsComponents) yarnBuildCmd: build - vsInstallerUri: ${{ parameters.vsInstallerUri }} - forceVSDependencies: true - task: CmdLine@2 displayName: Install react-native-cli @@ -40,12 +42,6 @@ jobs: restoreSolution: packages/E2ETest/windows/ReactUWPTestApp.sln verbosityRestore: Detailed # Options: quiet, normal, detailed - - task: PowerShell@2 - displayName: Install MUX framework package - inputs: - targetType: "inline" - script: Add-AppxPackage -path $(Build.SourcesDirectory)/packages/E2ETest/windows/packages/Microsoft.UI.Xaml.2.3.191129002/tools/AppX/${{ parameters.BuildPlatform }}/Release/Microsoft.UI.Xaml.2.3.appx - - task: CmdLine@2 displayName: Create bundle inputs: diff --git a/.ado/templates/prepare-env.yml b/.ado/templates/prepare-env.yml index 17be92e3c32..a7f460a62f3 100644 --- a/.ado/templates/prepare-env.yml +++ b/.ado/templates/prepare-env.yml @@ -4,13 +4,25 @@ parameters: useRnFork: true yarnBuildCmd: build debug: false - forceVSDependencies: false # Visual Studio Installer - vsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' + vsInstallerUri: $(VsInstallerUri) vsComponents: '' steps: + - task: PowerShell@2 + displayName: Display env + inputs: + targetType: "inline" + script: gci env:* | sort-object name + + - task: PowerShell@2 + displayName: Display disksize + inputs: + targetType: inline # filePath | inline + script: | + Get-WmiObject Win32_LogicalDisk + - task: UseNode@1 inputs: version: '10.x' @@ -55,10 +67,10 @@ steps: -InstallerUri ${{ parameters.vsInstallerUri }} -Components ${{ parameters.vsComponents }} -Collect:$${{ parameters.debug }} - condition: and(ne('${{parameters.vsComponents}}', ''), or(eq(variables['VmImage'], 'windows-2019'), ${{ parameters.forceVSDependencies }})) + condition: and(ne('${{parameters.vsComponents}}', ''), eq(variables['VmImage'], 'windows-2019')) - task: PowerShell@2 - displayName: List disksize by Get-WmiObject Win32_LogicalDisk + displayName: List disksize after prepare-env inputs: targetType: inline # filePath | inline script: | diff --git a/.ado/templates/react-native-init.yml b/.ado/templates/react-native-init.yml index acfd91a3fd9..13858049543 100644 --- a/.ado/templates/react-native-init.yml +++ b/.ado/templates/react-native-init.yml @@ -5,7 +5,7 @@ parameters: platform: configuration: vsComponents: '' - vsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' + vsInstallerUri: $(VsInstallerUri) steps: - checkout: self # self represents the repo where the initial Pipelines YAML file was found @@ -91,6 +91,7 @@ steps: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) + /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) - task: PublishBuildArtifacts@1 condition: succeededOrFailed() diff --git a/.ado/variables/msbuild.yml b/.ado/variables/msbuild.yml index a535c0d7d37..bd2a5b1eda1 100644 --- a/.ado/variables/msbuild.yml +++ b/.ado/variables/msbuild.yml @@ -4,3 +4,4 @@ variables: MSBuildPlatformToolset: v141 TargetPlatformVersion: 10.0.18362.0 Win10Version: 18362 + VsInstallerUri: 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' \ No newline at end of file diff --git a/.ado/variables/vs2017.yml b/.ado/variables/vs2017.yml index 325667fefb1..df0df594880 100644 --- a/.ado/variables/vs2017.yml +++ b/.ado/variables/vs2017.yml @@ -2,3 +2,4 @@ variables: VmImage: vs2017-win2016 MSBuildVersion: 15.0 GoogleTestAdapterPath: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\drknwe51.xnq' + ReactNativeWindowsBuildDir: $(Agent.HomeDirectory)\RNW diff --git a/.ado/variables/vs2019.yml b/.ado/variables/vs2019.yml index be12a57e389..07e665fdb67 100644 --- a/.ado/variables/vs2019.yml +++ b/.ado/variables/vs2019.yml @@ -3,3 +3,4 @@ variables: VsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 MSBuildVersion: 16.0 GoogleTestAdapterPath: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\pemwd5jw.szc' + ReactNativeWindowsBuildDir: \ No newline at end of file diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index de5704d3f9e..3b194429a98 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -127,6 +127,7 @@ jobs: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) + /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) clean: true # Optional condition: and(succeeded(), eq(variables['UseRNFork'], 'true')) @@ -142,7 +143,7 @@ jobs: command: restore restoreSolution: packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln verbosityRestore: Detailed # Options: quiet, normal, detailed - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines - task: MSBuild@1 displayName: MSBuild - SampleApps @@ -155,15 +156,16 @@ jobs: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) + /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) clean: true # Optional - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines - task: CmdLine@2 displayName: Create SampleApp bundle inputs: script: node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle workingDirectory: packages\microsoft-reactnative-sampleapps - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines - task: CmdLine@2 displayName: Create RNTester bundle @@ -494,6 +496,8 @@ jobs: /p:PlatformToolset=$(MSBuildPlatformToolset) /p:TargetPlatformVersion=$(TargetPlatformVersion) /p:WindowsTargetPlatformVersion=$(TargetPlatformVersion) + /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + #clean: true # Optional #maximumCpuCount: false # Optional #restoreNugetPackages: false # Optional @@ -535,11 +539,8 @@ jobs: - template: templates/e2e-test-job.yml # Template reference parameters: name: E2ETest - pool: - vmImage: windows-2019 BuildPlatform: x64 UseRNFork: true - vsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64, Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 - job: RNWNugetPR displayName: Build and Pack Nuget diff --git a/change/react-native-windows-2019-12-11-13-44-04-OneFolder.json b/change/react-native-windows-2019-12-11-13-44-04-OneFolder.json new file mode 100644 index 00000000000..b75dfdc94b7 --- /dev/null +++ b/change/react-native-windows-2019-12-11-13-44-04-OneFolder.json @@ -0,0 +1,8 @@ +{ + "type": "none", + "comment": "redirect to C on build machine", + "packageName": "react-native-windows", + "email": "licanhua@live.com", + "commit": "7f3bb66b87d8b38f74129d778b4fe3d7245d4a45", + "date": "2019-12-11T21:44:04.212Z" +} \ No newline at end of file diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj index 74d18950824..fec719bdaac 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj @@ -18,6 +18,7 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} false false + 7.1 x86 diff --git a/vnext/Directory.Build.props b/vnext/Directory.Build.props index 243a79d8ba0..d9a7a86ba1c 100644 --- a/vnext/Directory.Build.props +++ b/vnext/Directory.Build.props @@ -17,10 +17,10 @@ $(MSBuildProjectName) - + $(ReactNativeWindowsDir)build - $(ReactNativeWindowsDir)build\$(Platform)\$(Configuration) - $(ReactNativeWindowsDir)build\x86\$(Configuration) + $(ReactNativeWindowsBuildDir)\$(Platform)\$(Configuration) + $(ReactNativeWindowsBuildDir)\x86\$(Configuration) $(ReactNativeWindowsDir)target\$(Platform)\$(Configuration) $(ReactNativeWindowsDir)target\x86\$(Configuration) diff --git a/vnext/Directory.Build.targets b/vnext/Directory.Build.targets index a93bc8eb44d..31770cac930 100644 --- a/vnext/Directory.Build.targets +++ b/vnext/Directory.Build.targets @@ -10,6 +10,7 @@ + From 538a78a33820f63ad98ff818649bc411390f848b Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Thu, 12 Dec 2019 12:20:24 -0800 Subject: [PATCH 2/7] rollback language to default --- .../windows/SampleLibraryCS/SampleLibraryCS.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj index fec719bdaac..74d18950824 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj @@ -18,7 +18,6 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} false false - 7.1 x86 From ad3ab897c74d1c92a1eb529688ff6a1b73021953 Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Thu, 12 Dec 2019 12:23:22 -0800 Subject: [PATCH 3/7] use False --- .ado/windows-vs-pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index 3b194429a98..116d78dcd7c 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -143,7 +143,7 @@ jobs: command: restore restoreSolution: packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln verbosityRestore: Detailed # Options: quiet, normal, detailed - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines - task: MSBuild@1 displayName: MSBuild - SampleApps @@ -158,14 +158,14 @@ jobs: /p:PlatformToolset=$(MSBuildPlatformToolset) /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) clean: true # Optional - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines - task: CmdLine@2 displayName: Create SampleApp bundle inputs: script: node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle workingDirectory: packages\microsoft-reactnative-sampleapps - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), false) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines - task: CmdLine@2 displayName: Create RNTester bundle From f886ae734e85d10c4be90ad11dfd0821da223f61 Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Fri, 13 Dec 2019 10:03:22 -0800 Subject: [PATCH 4/7] Fix by comment and enable SampleApp on pipeline --- .ado/templates/build-rnw.yml | 2 +- .ado/templates/e2e-test-job.yml | 12 ++++-- .ado/templates/react-native-init.yml | 2 +- .ado/variables/vs2017.yml | 2 +- .ado/variables/vs2019.yml | 2 +- .ado/windows-vs-pr.yml | 38 +++++++++++++++---- .../windows/SampleAppCPP/SampleApp.vcxproj | 1 - .../windows/SampleAppCS/SampleAppCS.csproj | 5 +-- .../SampleLibraryCS/SampleLibraryCS.csproj | 1 + vnext/Directory.Build.props | 5 +-- vnext/Directory.Build.targets | 1 - .../AttributedViewManager.cs | 14 +++---- 12 files changed, 55 insertions(+), 30 deletions(-) diff --git a/.ado/templates/build-rnw.yml b/.ado/templates/build-rnw.yml index 200cb64232a..614b6843855 100644 --- a/.ado/templates/build-rnw.yml +++ b/.ado/templates/build-rnw.yml @@ -50,7 +50,7 @@ steps: /p:PreferredToolArchitecture=${{parameters.preferredToolArchitecture}} /p:PlatformToolset=${{parameters.platformToolset}} ${{parameters.msbuildArguments}} - /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + /p:BaseIntDir=$(BaseIntDir) - task: PublishBuildArtifacts@1 condition: succeededOrFailed() diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 9d1748ba675..c6ad1301fbe 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -3,17 +3,21 @@ parameters: name: '' BuildPlatform: x86 # ARM, x86, x64 UseRNFork: true - + jobs: - job: ${{ parameters.name }} displayName: E2E Test dependsOn: Setup condition: ne( dependencies.Setup.outputs['checkPayload.shouldSkipPRBuild'], 'True' ) + + # E2ETest is in the pipeline of windows-vs-pr, but windows-vs-pr is still using vs2017.yml + # E2ETest can only be executed on windows-2019 or above, so force to use windows-2019 image and override vs2017.yml variables + # so pool and variables are hard coded here. pool: - vmImage: windows-2019 # E2ETest can only be executed on windows-2019 or above - variables: # override vs2017.yml variables because windows-vs-pr is still using vs2017.yml + vmImage: windows-2019 + variables: VsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 - ReactNativeWindowsBuildDir: + BaseIntDir: $(BUILD_SOURCESDIRECTORY)\vnext\build VmImage: windows-2019 timeoutInMinutes: 60 # how long to run the job before automatically cancelling diff --git a/.ado/templates/react-native-init.yml b/.ado/templates/react-native-init.yml index 13858049543..d2a60a27cf7 100644 --- a/.ado/templates/react-native-init.yml +++ b/.ado/templates/react-native-init.yml @@ -91,7 +91,7 @@ steps: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) - /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + /p:BaseIntDir=$(BaseIntDir) - task: PublishBuildArtifacts@1 condition: succeededOrFailed() diff --git a/.ado/variables/vs2017.yml b/.ado/variables/vs2017.yml index df0df594880..b4f41037b63 100644 --- a/.ado/variables/vs2017.yml +++ b/.ado/variables/vs2017.yml @@ -2,4 +2,4 @@ variables: VmImage: vs2017-win2016 MSBuildVersion: 15.0 GoogleTestAdapterPath: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\drknwe51.xnq' - ReactNativeWindowsBuildDir: $(Agent.HomeDirectory)\RNW + BaseIntDir: $(Agent.HomeDirectory)\BaseIntDir # redirect to C: \ No newline at end of file diff --git a/.ado/variables/vs2019.yml b/.ado/variables/vs2019.yml index 07e665fdb67..e8df840f8f4 100644 --- a/.ado/variables/vs2019.yml +++ b/.ado/variables/vs2019.yml @@ -3,4 +3,4 @@ variables: VsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 MSBuildVersion: 16.0 GoogleTestAdapterPath: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\pemwd5jw.szc' - ReactNativeWindowsBuildDir: \ No newline at end of file + BaseIntDir: $(BUILD_SOURCESDIRECTORY)\vnext\build \ No newline at end of file diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index 116d78dcd7c..8f80ad3caaa 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -8,7 +8,7 @@ pr: variables: - template: variables/msbuild.yml - - template: variables/vs2017.yml + - template: variables/vs2017.yml # when using vs2019.yml, please remove workaround in e2e-test-job which is forced to use windows-2019 image. jobs: - job: Setup @@ -109,6 +109,11 @@ jobs: vsComponents: $(VsComponents),Microsoft.VisualStudio.Component.VC.v141.ARM yarnBuildCmd: buildci + - task: CmdLine@2 + displayName: Install react-native-cli + inputs: + script: npm install -g react-native-cli + - task: NuGetCommand@2 displayName: NuGet restore - Playground inputs: @@ -127,7 +132,7 @@ jobs: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) - /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + /p:BaseIntDir=$(BaseIntDir) clean: true # Optional condition: and(succeeded(), eq(variables['UseRNFork'], 'true')) @@ -143,7 +148,7 @@ jobs: command: restore restoreSolution: packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln verbosityRestore: Detailed # Options: quiet, normal, detailed - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true')) - task: MSBuild@1 displayName: MSBuild - SampleApps @@ -156,16 +161,35 @@ jobs: msbuildArguments: /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) /p:PlatformToolset=$(MSBuildPlatformToolset) - /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + /p:BaseIntDir=$(BaseIntDir) clean: true # Optional - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), ne(variables['BuildPlatform'], 'x86')) + + # Possible related to https://social.msdn.microsoft.com/Forums/vstudio/en-US/23c8df57-9c50-476c-9f56-1fe058e75a9d/uwp-app-builds-on-local-machine-fails-on-build-agent-systemprivatecorelib-not-found + # use X86 msbuild to avoid ##[error]...Microsoft.AppXPackage.Targets(1248,5): Error MSB3816: Loading assembly "\runtime.win7-x86.microsoft.netcore.runtime.coreclr\1.0.2\runtimes\win7-x86\lib\netstandard1.0\mscorlib.dll" failed. + # System.ArgumentException: A BadImageFormatException has been thrown while parsing the signature. + # This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context. + - task: MSBuild@1 + displayName: MSBuild - SampleApps + inputs: + solution: packages/microsoft-reactnative-sampleapps/windows/SampleApps.sln + msbuildVersion: $(MSBuildVersion) # Optional. Options: latest, 16.0, 15.0, 14.0, 12.0, 4.0 + msbuildArchitecture: x86 # Optional. Options: x86, x64 + platform: $(BuildPlatform) # Optional + configuration: $(BuildConfiguration) # Optional + msbuildArguments: + /p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture) + /p:PlatformToolset=$(MSBuildPlatformToolset) + /p:BaseIntDir=$(BaseIntDir) + clean: true # Optional + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), eq(variables['BuildPlatform'], 'x86')) - task: CmdLine@2 displayName: Create SampleApp bundle inputs: script: node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle workingDirectory: packages\microsoft-reactnative-sampleapps - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), False) # Disabled, out of space issues on CI machines + condition: and(succeeded(), eq(variables['UseRNFork'], 'true')) - task: CmdLine@2 displayName: Create RNTester bundle @@ -496,7 +520,7 @@ jobs: /p:PlatformToolset=$(MSBuildPlatformToolset) /p:TargetPlatformVersion=$(TargetPlatformVersion) /p:WindowsTargetPlatformVersion=$(TargetPlatformVersion) - /p:ReactNativeWindowsBuildDir=$(ReactNativeWindowsBuildDir) + /p:BaseIntDir=$(BaseIntDir) #clean: true # Optional #maximumCpuCount: false # Optional diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleApp.vcxproj b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleApp.vcxproj index af355128329..a25a7a1804d 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleApp.vcxproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCPP/SampleApp.vcxproj @@ -175,7 +175,6 @@ - cd $(SolutionDir).. react-native bundle --platform windows --entry-file index.windows.js --bundle-output windows/SampleAppCpp/Bundle/index.windows.bundle --assets-dest windows/SampleAppCpp/Bundle diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj index f9970ef4dcb..f823229dbed 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj @@ -18,6 +18,7 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} true false + 7.0 true @@ -175,9 +176,7 @@ - cd $(SolutionDir).. - mkdir windows\SampleAppCS\Bundle - react-native bundle --platform windows --entry-file index.windows.js --bundle-output windows/SampleAppCS/Bundle/index.windows.bundle --assets-dest windows/SampleAppCS/Bundle + node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj index 74d18950824..450ccdecdc5 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleLibraryCS/SampleLibraryCS.csproj @@ -18,6 +18,7 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} false false + 7.0 x86 diff --git a/vnext/Directory.Build.props b/vnext/Directory.Build.props index d9a7a86ba1c..dfa8e24d545 100644 --- a/vnext/Directory.Build.props +++ b/vnext/Directory.Build.props @@ -17,10 +17,9 @@ $(MSBuildProjectName) - $(ReactNativeWindowsDir)build - $(ReactNativeWindowsBuildDir)\$(Platform)\$(Configuration) - $(ReactNativeWindowsBuildDir)\x86\$(Configuration) + $(ReactNativeWindowsDir)\$(Platform)\$(Configuration) + $(ReactNativeWindowsDir)\x86\$(Configuration) $(ReactNativeWindowsDir)target\$(Platform)\$(Configuration) $(ReactNativeWindowsDir)target\x86\$(Configuration) diff --git a/vnext/Directory.Build.targets b/vnext/Directory.Build.targets index 31770cac930..a93bc8eb44d 100644 --- a/vnext/Directory.Build.targets +++ b/vnext/Directory.Build.targets @@ -10,7 +10,6 @@ - diff --git a/vnext/Microsoft.ReactNative.SharedManaged/AttributedViewManager.cs b/vnext/Microsoft.ReactNative.SharedManaged/AttributedViewManager.cs index e2e9bddfb83..5f2c4f271a1 100644 --- a/vnext/Microsoft.ReactNative.SharedManaged/AttributedViewManager.cs +++ b/vnext/Microsoft.ReactNative.SharedManaged/AttributedViewManager.cs @@ -390,9 +390,9 @@ private bool TryMakeBubblingEvent(ViewManagerExportedBubblingEventTypeConstantAt return true; } - constantKey = default; - constantValue = default; - memberValue = default; + constantKey = default(string); + constantValue = default(string); + memberValue = default(Delegate); return false; } @@ -445,9 +445,9 @@ private bool TryMakeDirectEvent(ViewManagerExportedDirectEventTypeConstantAttrib return true; } - constantKey = default; - constantValue = default; - memberValue = default; + constantKey = default(string); + constantValue = default(object); + memberValue = default(Delegate); return false; } @@ -466,7 +466,7 @@ private bool TryGetEventDataType(Type eventType, out Type eventDataType) } } - eventDataType = default; + eventDataType = default(Type); return false; } From 18dde2747892e7c1100992956bec66faf31ff31b Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Fri, 13 Dec 2019 11:11:10 -0800 Subject: [PATCH 5/7] update --- .ado/templates/e2e-test-job.yml | 5 ----- .ado/templates/prepare-env.yml | 5 +++++ .ado/windows-vs-pr.yml | 5 ----- .../windows/SampleAppCS/SampleAppCS.csproj | 3 ++- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index c6ad1301fbe..3a79cfaecd4 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -34,11 +34,6 @@ jobs: vsComponents: $(VsComponents) yarnBuildCmd: build - - task: CmdLine@2 - displayName: Install react-native-cli - inputs: - script: npm install -g react-native-cli - - task: NuGetCommand@2 displayName: NuGet restore - ReactUWPTestApp inputs: diff --git a/.ado/templates/prepare-env.yml b/.ado/templates/prepare-env.yml index a7f460a62f3..3d5f1c7f0a5 100644 --- a/.ado/templates/prepare-env.yml +++ b/.ado/templates/prepare-env.yml @@ -49,6 +49,11 @@ steps: script: yarn install condition: and(succeeded(), not('${{parameters.useRnFork}}')) + - task: CmdLine@2 + displayName: Install react-native-cli + inputs: + script: npm install -g react-native-cli + - task: CmdLine@2 displayName: yarn ${{ parameters.yarnBuildCmd }} inputs: diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index 8f80ad3caaa..e7209ad403f 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -109,11 +109,6 @@ jobs: vsComponents: $(VsComponents),Microsoft.VisualStudio.Component.VC.v141.ARM yarnBuildCmd: buildci - - task: CmdLine@2 - displayName: Install react-native-cli - inputs: - script: npm install -g react-native-cli - - task: NuGetCommand@2 displayName: NuGet restore - Playground inputs: diff --git a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj index f823229dbed..38bdb65d840 100644 --- a/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj +++ b/packages/microsoft-reactnative-sampleapps/windows/SampleAppCS/SampleAppCS.csproj @@ -176,7 +176,8 @@ - node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle + cd .. + react-native bundle --platform windows --entry-file index.windows.js --bundle-output windows/SampleAppCS/Bundle/index.windows.bundle --assets-dest windows/SampleAppCS/Bundle From 71e84df2e2b60338e3aec02437f48b39b71633e1 Mon Sep 17 00:00:00 2001 From: CanHua Li Date: Fri, 13 Dec 2019 12:18:50 -0800 Subject: [PATCH 6/7] disable msbuild SampleApp --- .ado/windows-vs-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index e7209ad403f..10c1e175744 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -158,7 +158,7 @@ jobs: /p:PlatformToolset=$(MSBuildPlatformToolset) /p:BaseIntDir=$(BaseIntDir) clean: true # Optional - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), ne(variables['BuildPlatform'], 'x86')) + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), ne(variables['BuildPlatform'], 'x86'), false) # Disabled. issue #3670 Unable to resolve module `warnOnce` # Possible related to https://social.msdn.microsoft.com/Forums/vstudio/en-US/23c8df57-9c50-476c-9f56-1fe058e75a9d/uwp-app-builds-on-local-machine-fails-on-build-agent-systemprivatecorelib-not-found # use X86 msbuild to avoid ##[error]...Microsoft.AppXPackage.Targets(1248,5): Error MSB3816: Loading assembly "\runtime.win7-x86.microsoft.netcore.runtime.coreclr\1.0.2\runtimes\win7-x86\lib\netstandard1.0\mscorlib.dll" failed. @@ -177,7 +177,7 @@ jobs: /p:PlatformToolset=$(MSBuildPlatformToolset) /p:BaseIntDir=$(BaseIntDir) clean: true # Optional - condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), eq(variables['BuildPlatform'], 'x86')) + condition: and(succeeded(), eq(variables['UseRNFork'], 'true'), eq(variables['BuildPlatform'], 'x86'), false) # Disabled. [error]vnext\Microsoft.ReactNative.SharedManaged\JSValue.cs(100,36): Error CS8107: Feature 'readonly references' is not available in C# 7.0. Please use language version 7.2 or greater. - task: CmdLine@2 displayName: Create SampleApp bundle From dc094b171278c8da71a2c794cb9498b2431a8af4 Mon Sep 17 00:00:00 2001 From: Canhua Li Date: Fri, 13 Dec 2019 17:29:06 -0800 Subject: [PATCH 7/7] Apply suggestions from code review --- vnext/Directory.Build.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnext/Directory.Build.props b/vnext/Directory.Build.props index dfa8e24d545..a8c624935eb 100644 --- a/vnext/Directory.Build.props +++ b/vnext/Directory.Build.props @@ -18,8 +18,8 @@ $(MSBuildProjectName) - $(ReactNativeWindowsDir)\$(Platform)\$(Configuration) - $(ReactNativeWindowsDir)\x86\$(Configuration) + $(ReactNativeWindowsDir)build\$(Platform)\$(Configuration) + $(ReactNativeWindowsDir)build\x86\$(Configuration) $(ReactNativeWindowsDir)target\$(Platform)\$(Configuration) $(ReactNativeWindowsDir)target\x86\$(Configuration) @@ -29,4 +29,4 @@ $(IntDir)Generated Files\ - \ No newline at end of file +