|
11 | 11 |
|
12 | 12 | <!-- disable by default on unsupported platforms --> |
13 | 13 | <InstallChromeForTests Condition="'$(InstallChromeForTests)' == '' and '$(ChromeOSIdentifier)' == ''">false</InstallChromeForTests> |
| 14 | + <InstallV8ForTests Condition="'$(InstallV8ForTests)' == ''">false</InstallV8ForTests> |
14 | 15 |
|
15 | 16 | <FirefoxDir>$(ArtifactsBinDir)firefox\</FirefoxDir> |
16 | 17 | <FirefoxStampFile>$([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(FirefoxRevision).stamp'))</FirefoxStampFile> |
17 | 18 | <_BrowserStampDir>$(ArtifactsBinDir)\</_BrowserStampDir> |
| 19 | + |
| 20 | + <WasmProvisionAfterTarget Condition="'$(WasmProvisionAfterTarget)' == ''">Build</WasmProvisionAfterTarget> |
18 | 21 | </PropertyGroup> |
19 | 22 |
|
20 | 23 | <Import Project="$(MSBuildThisFileDirectory)ChromeVersions.props" /> |
|
38 | 41 |
|
39 | 42 | <ChromeUrl>$(linux_ChromeBaseSnapshotUrl)/chrome-linux.zip</ChromeUrl> |
40 | 43 | <ChromeDriverUrl>$(linux_ChromeBaseSnapshotUrl)/chromedriver_linux64.zip</ChromeDriverUrl> |
| 44 | + |
| 45 | + <V8Version>$(linux_V8Version)</V8Version> |
| 46 | + <V8DirName>v8-$(linux_V8Version)</V8DirName> |
| 47 | + <V8BinaryName>$(V8DirName).sh</V8BinaryName> |
| 48 | + <_V8PlatformId>linux64</_V8PlatformId> |
41 | 49 | </PropertyGroup> |
42 | 50 |
|
43 | 51 | <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))"> |
|
53 | 61 |
|
54 | 62 | <ChromeUrl>$(win_ChromeBaseSnapshotUrl)/chrome-win.zip</ChromeUrl> |
55 | 63 | <ChromeDriverUrl>$(win_ChromeBaseSnapshotUrl)/chromedriver_win32.zip</ChromeDriverUrl> |
| 64 | + |
| 65 | + <V8Version>$(win_V8Version)</V8Version> |
| 66 | + <V8DirName>v8-$(win_V8Version)</V8DirName> |
| 67 | + <V8BinaryName>$(V8DirName).cmd</V8BinaryName> |
| 68 | + <_V8PlatformId>win32</_V8PlatformId> |
56 | 69 | </PropertyGroup> |
57 | 70 |
|
58 | 71 | <PropertyGroup Condition="'$(ChromeVersion)' != ''"> |
|
65 | 78 | <ChromeDriverBinaryPath>$([MSBuild]::NormalizePath($(ChromeDriverDir), $(ChromeDriverDirName), $(ChromeDriverBinaryName)))</ChromeDriverBinaryPath> |
66 | 79 | </PropertyGroup> |
67 | 80 |
|
| 81 | + <PropertyGroup Condition="'$(V8Version)' != ''"> |
| 82 | + <V8Dir>$(ArtifactsBinDir)$(V8DirName)\</V8Dir> |
| 83 | + <V8StampFile>$([MSBuild]::NormalizePath('$(V8Dir)', '.install-$(V8Version).stamp'))</V8StampFile> |
| 84 | + <V8BinaryPath>$([MSBuild]::NormalizePath($(V8Dir), $(V8BinaryName)))</V8BinaryPath> |
| 85 | + </PropertyGroup> |
| 86 | + |
68 | 87 | <PropertyGroup Condition="'$(BrowserHost)' != 'windows'"> |
69 | 88 | <FirefoxRevision>108.0.1</FirefoxRevision> |
70 | 89 | <FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(FirefoxRevision)/linux-x86_64/en-US/firefox-$(FirefoxRevision).tar.bz2</FirefoxUrl> |
71 | 90 | <FirefoxBinaryName>firefox</FirefoxBinaryName> |
72 | 91 | </PropertyGroup> |
73 | 92 |
|
74 | 93 | <Target Name="DownloadAndInstallChrome" |
75 | | - AfterTargets="Build" |
| 94 | + AfterTargets="$(WasmProvisionAfterTarget)" |
76 | 95 | Condition="(!Exists($(ChromeStampFile)) or !Exists($(ChromeBinaryPath))) and '$(InstallChromeForTests)' == 'true'"> |
77 | 96 |
|
| 97 | + <Error Condition="!$([MSBuild]::IsOSPlatform('linux')) and !$([MSBuild]::IsOSPlatform('windows'))" |
| 98 | + Text="Chrome provisioning only supported on Linux, and windows." /> |
78 | 99 | <Error Condition="'$(ChromeVersion)' == ''" |
79 | 100 | Text="No %24(ChromeVersion) set. This can be set in eng/testing/ChromeVersions.props" /> |
80 | 101 |
|
|
87 | 108 | <Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" /> |
88 | 109 | </DownloadFile> |
89 | 110 | <Unzip SourceFiles="$(_DownloadedFile)" DestinationFolder="$(ChromeDir)" /> |
| 111 | + <Delete Files="$(_DownloadedFile)" /> |
90 | 112 |
|
91 | 113 | <Error Text="Cannot find chrome at $(ChromeBinaryPath) in the downloaded copy" |
92 | 114 | Condition="!Exists($(ChromeBinaryPath))" /> |
|
97 | 119 | </Target> |
98 | 120 |
|
99 | 121 | <Target Name="DownloadAndInstallChromeDriver" |
100 | | - AfterTargets="Build" |
| 122 | + AfterTargets="$(WasmProvisionAfterTarget)" |
101 | 123 | Condition="(!Exists($(ChromeDriverStampFile)) or !Exists($(ChromeDriverBinaryPath))) and '$(InstallChromeForTests)' == 'true'"> |
102 | 124 |
|
| 125 | + <Error Condition="!$([MSBuild]::IsOSPlatform('linux')) and !$([MSBuild]::IsOSPlatform('windows'))" |
| 126 | + Text="ChromeDriver provisioning only supported on Linux, and windows." /> |
103 | 127 | <Error Condition="'$(ChromeVersion)' == ''" |
104 | 128 | Text="No %24(ChromeVersion) set. This can be set in eng/testing/ChromeVersions.props" /> |
105 | 129 |
|
|
121 | 145 | <Touch Files="$(ChromeDriverStampFile)" AlwaysCreate="true" /> |
122 | 146 | </Target> |
123 | 147 |
|
| 148 | + <Target Name="DownloadAndInstallV8" |
| 149 | + AfterTargets="$(WasmProvisionAfterTarget)" |
| 150 | + Condition="(!Exists($(V8StampFile)) or !Exists($(V8BinaryPath))) and '$(InstallV8ForTests)' == 'true'"> |
| 151 | + |
| 152 | + <Error Condition="!$([MSBuild]::IsOSPlatform('linux')) and !$([MSBuild]::IsOSPlatform('windows'))" |
| 153 | + Text="V8 provisioning only supported on Linux, and windows." /> |
| 154 | + <Error Condition="'$(V8Version)' == ''" Text="%24(V8Version) not set" /> |
| 155 | + <Error Condition="'$(_V8PlatformId)' == ''" Text="%24(_V8PlatformId) not set, needed for constructing the snapshot url." /> |
| 156 | + |
| 157 | + <PropertyGroup> |
| 158 | + <_V8SnapshotUrl>https://storage.googleapis.com/chromium-v8/official/canary/v8-$(_V8PlatformId)-rel-$(V8Version).zip</_V8SnapshotUrl> |
| 159 | + |
| 160 | + <_V8Script Condition="$([MSBuild]::IsOSPlatform('linux'))">#!/usr/bin/env bash |
| 161 | +export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
| 162 | +"$__SCRIPT_DIR/d8" --snapshot_blob="$__SCRIPT_DIR/snapshot_blob.bin" "$@" |
| 163 | + </_V8Script> |
| 164 | + <_V8Script Condition="$([MSBuild]::IsOSPlatform('windows'))">@echo off |
| 165 | +"%~dp0\d8.exe --snapshot_blob="%~dp0\snapshot_blob.bin" %* |
| 166 | + </_V8Script> |
| 167 | + </PropertyGroup> |
| 168 | + |
| 169 | + <DownloadFile SourceUrl="$(_V8SnapshotUrl)" DestinationFolder="$(V8Dir)" SkipUnchangedFiles="true"> |
| 170 | + <Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" /> |
| 171 | + </DownloadFile> |
| 172 | + |
| 173 | + <Unzip SourceFiles="$(_DownloadedFile)" DestinationFolder="$(V8Dir)" /> |
| 174 | + |
| 175 | + <WriteLinesToFile Lines="$(_V8Script)" File="$(V8BinaryPath)" Overwrite="true" /> |
| 176 | + <Exec Command="chmod +x $(V8BinaryPath) $(V8Dir)/d8" Condition="$([MSBuild]::IsOSPlatform('linux'))" /> |
| 177 | + |
| 178 | + <Touch Files="$(V8StampFile)" AlwaysCreate="true" /> |
| 179 | + </Target> |
| 180 | + |
124 | 181 | <Target Name="DownloadAndInstallFirefox" |
125 | | - AfterTargets="Build" |
| 182 | + AfterTargets="$(WasmProvisionAfterTarget)" |
126 | 183 | Condition="!Exists($(FirefoxStampFile)) and '$(InstallFirefoxForTests)' == 'true' and !$([MSBuild]::IsOSPlatform('windows'))"> |
127 | 184 | <ItemGroup> |
128 | 185 | <_StampFile Include="$(_BrowserStampDir).install-firefox*.stamp" /> |
|
0 commit comments