Skip to content

Commit

Permalink
Migrate to cross-platform msbuild targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko authored and titusfortner committed Jan 18, 2024
1 parent 68d40f5 commit bfcb242
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 75 deletions.
85 changes: 42 additions & 43 deletions dotnet/src/webdriver/WebDriver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,57 +44,18 @@

<ItemGroup>
<InternalsVisibleTo Include="WebDriver.Common.Tests" />

<Compile Remove="cdp\**" />
<Compile Remove="obj\**" />
<EmbeddedResource Remove="cdp\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="cdp\**" />
<None Remove="obj\**" />
</ItemGroup>

<ItemGroup>
<None Remove="Settings.StyleCop" />
<None Remove="WebDriver.ruleset" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\..\bazel-bin\dotnet\src\webdriver\cdp\**\*.cs" LinkBase="DevTools\generated" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="$(ProjectDir)..\..\..\third_party\js\selenium\webdriver.json">
<Visible>False</Visible>
<LogicalName>webdriver_prefs.json</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\webdriver\atoms\get-attribute.js">
<Visible>False</Visible>
<LogicalName>get-attribute.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\atoms\fragments\is-displayed.js">
<Visible>False</Visible>
<LogicalName>is-displayed.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\atoms\fragments\find-elements.js">
<Visible>False</Visible>
<LogicalName>find-elements.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\javascript\cdp-support\mutation-listener.js">
<Visible>False</Visible>
<LogicalName>mutation-listener.js</LogicalName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Remote\JsonConverters\" />
</ItemGroup>

<PropertyGroup>
<BaseSeleniumManagerPath>..\..\..\bazel-bin\dotnet\src\webdriver\manager</BaseSeleniumManagerPath>
<BaseImagePath>..\..\..\bazel-bin\dotnet\src\webdriver\images</BaseImagePath>
</PropertyGroup>

Expand All @@ -109,12 +70,50 @@
<None Include="$(BaseSeleniumManagerPath)\windows\selenium-manager.exe" Pack="true" PackagePath="manager\windows" Visible="false" />
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
<Exec Command="call $(ProjectDir)WebDriver.csproj.prebuild.cmd $(ProjectDir)" />
<Target Name="GenerateSeleniumManagerBinaries" BeforeTargets="PrepareForBuild">
<Exec Command="bazel build //dotnet/src/webdriver:manager-linux //dotnet/src/webdriver:manager-windows //dotnet/src/webdriver:manager-macos"
WorkingDirectory="..\..\.." />

<PropertyGroup>
<BaseSeleniumManagerPath>..\..\..\bazel-bin\dotnet\src\webdriver\manager</BaseSeleniumManagerPath>
</PropertyGroup>
</Target>

<Target Name="PreBuildNonWindows" BeforeTargets="PreBuildEvent" Condition="'$(OS)' != 'Windows_NT'">
<Exec Command="$(ProjectDir)WebDriver.csproj.prebuild.sh $(ProjectDir)" />
<Target Name="GenerateAtoms" BeforeTargets="PrepareForBuild">
<Exec Command="bazel build //javascript/webdriver/atoms:get-attribute.js //javascript/atoms/fragments:is-displayed.js //javascript/atoms/fragments:find-elements.js"
WorkingDirectory="..\..\.." />

<ItemGroup>
<EmbeddedResource Include="$(ProjectDir)..\..\..\third_party\js\selenium\webdriver.json">
<Visible>False</Visible>
<LogicalName>webdriver_prefs.json</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\webdriver\atoms\get-attribute.js">
<Visible>False</Visible>
<LogicalName>get-attribute.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\atoms\fragments\is-displayed.js">
<Visible>False</Visible>
<LogicalName>is-displayed.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\bazel-bin\javascript\atoms\fragments\find-elements.js">
<Visible>False</Visible>
<LogicalName>find-elements.js</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\..\javascript\cdp-support\mutation-listener.js">
<Visible>False</Visible>
<LogicalName>mutation-listener.js</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Target>

<Target Name="GenerateCdp" BeforeTargets="PrepareForBuild">
<Exec Command="bazel build //dotnet/src/webdriver/cdp:generate-v85 //dotnet/src/webdriver/cdp:generate-v118 //dotnet/src/webdriver/cdp:generate-v119 //dotnet/src/webdriver/cdp:generate-v120"
WorkingDirectory="..\..\.." />

<ItemGroup>
<Compile Include="..\..\..\bazel-bin\dotnet\src\webdriver\cdp\**\*.cs" LinkBase="DevTools\generated" />
</ItemGroup>
</Target>

</Project>
16 changes: 0 additions & 16 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd

This file was deleted.

16 changes: 0 additions & 16 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.sh

This file was deleted.

0 comments on commit bfcb242

Please sign in to comment.