Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions dotnet/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"paket"
],
"rollForward": false
},
"aver": {
"version": "1.0.2",
"commands": [
"aver"
],
"rollForward": false
}
}
}
}
574 changes: 574 additions & 0 deletions dotnet/.paket/Paket.Restore.targets

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- Paket manages transitive dependencies explicitly; suppress .NET 10+ package pruning warnings -->
<NoWarn>$(NoWarn);NU1510</NoWarn>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion dotnet/paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
group nuget
framework: net462,net8.0,netstandard2.0
framework: net462,net8.0,net10.0,netstandard2.0
strategy: min
source https://api.nuget.org/v3/index.json

nuget BenderProxy 1.1.2
nuget Microsoft.Bcl.AsyncInterfaces 8.0.0
nuget CommandLineParser 2.8.0
nuget Handlebars.Net 1.11.5
nuget Humanizer.Core 2.8.26
Expand Down
138 changes: 69 additions & 69 deletions dotnet/paket.lock

Large diffs are not rendered by default.

49 changes: 35 additions & 14 deletions dotnet/private/dotnet_format.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,31 @@ DOTNET="$RUNFILES_DIR/{dotnet}"
# Find the workspace root
WORKSPACE_ROOT="${{BUILD_WORKSPACE_DIRECTORY:-$RUNFILES_DIR/_main}}"
DOTNET_DIR="$WORKSPACE_ROOT/dotnet"
SOLUTION="$DOTNET_DIR/Selenium.slnx"
SOLUTION="$DOTNET_DIR/{solution}"

if [[ ! -f "$SOLUTION" ]]; then
echo "ERROR: Could not find $SOLUTION" >&2
exit 1
fi

cd "$DOTNET_DIR"

# Bazel-bundled SDK ref packs lack prune metadata; opt out of NETSDK1226.
export AllowMissingPrunePackageData=true

if [[ ! -f "$SOLUTION" ]]; then
echo "ERROR: Could not find $SOLUTION" >&2
exit 1
fi
echo "Restoring dotnet tools..."
"$DOTNET" tool restore

echo "Running dotnet format $@ on Selenium.slnx..."
"$DOTNET" format "$@" "$SOLUTION" || exit 1
echo "Restoring packages..."
"$DOTNET" tool run paket restore

echo "Running dotnet format $@ on {solution}..."
"$DOTNET" format "$@" --no-restore "$SOLUTION"

echo "Done."
""".format(
dotnet = dotnet_runfiles_path,
solution = ctx.attr.solution,
)

script = ctx.actions.declare_file(ctx.label.name + ".sh")
Expand All @@ -93,24 +100,34 @@ if defined BUILD_WORKSPACE_DIRECTORY (
set WORKSPACE_ROOT=%RUNFILES_DIR%\\_main
)
set DOTNET_DIR=%WORKSPACE_ROOT%\\dotnet
set SOLUTION=%DOTNET_DIR%\\Selenium.slnx
set SOLUTION=%DOTNET_DIR%\\{solution}

if not exist "%SOLUTION%" (
echo ERROR: Could not find %SOLUTION% 1>&2
exit /b 1
)

cd /d "%DOTNET_DIR%"

rem Bazel-bundled SDK ref packs lack prune metadata; opt out of NETSDK1226.
set AllowMissingPrunePackageData=true

if not exist "%SOLUTION%" (
echo ERROR: Could not find %SOLUTION% 1>&2
exit /b 1
)
echo Restoring dotnet tools...
"%DOTNET%" tool restore
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

echo Running dotnet format %* on Selenium.slnx...
"%DOTNET%" format %* "%SOLUTION%" || exit /b 1
echo Restoring packages...
"%DOTNET%" tool run paket restore
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

echo Running dotnet format %* on {solution}...
"%DOTNET%" format %* --no-restore "%SOLUTION%"
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

echo Done.
""".format(
dotnet_path = dotnet_runfiles_path,
solution = ctx.attr.solution,
)

script = ctx.actions.declare_file(ctx.label.name + ".bat")
Expand All @@ -124,6 +141,10 @@ echo Done.
dotnet_format = rule(
implementation = _dotnet_format_impl,
attrs = {
"solution": attr.string(
doc = "Solution file to format, relative to the dotnet directory.",
default = "Selenium.slnx",
),
"_windows_constraint": attr.label(
default = "@platforms//os:windows",
),
Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/support/Selenium.Support.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@
<Compile Include="$(CsprojIncludePath)\Properties\ArgumentNullExceptionExtensions.cs" Link="Properties\ArgumentNullExceptionExtensions.cs" />
</ItemGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />

</Project>
2 changes: 2 additions & 0 deletions dotnet/src/support/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group nuget

9 changes: 2 additions & 7 deletions dotnet/src/webdriver/Selenium.WebDriver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>-->

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.6" />
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />
</ItemGroup>

<Target Name="GenerateBazelArtifacts" BeforeTargets="CoreCompile">
<Exec Command="bazel build //dotnet/src/webdriver:manager-linux //dotnet/src/webdriver:manager-windows //dotnet/src/webdriver:manager-macos //dotnet/src/webdriver:resource-utilities //dotnet/src/webdriver/DevTools/..." WorkingDirectory="../../.." />

Expand Down Expand Up @@ -94,4 +87,6 @@
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />
Comment thread
qodo-code-review[bot] marked this conversation as resolved.

</Project>
5 changes: 5 additions & 0 deletions dotnet/src/webdriver/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
group nuget
Microsoft.Bcl.AsyncInterfaces framework: net462, netstandard2.0
System.Collections.Immutable framework: net462, netstandard2.0
System.Text.Json framework: net462, netstandard2.0
System.Threading.Channels framework: net462, netstandard2.0
8 changes: 2 additions & 6 deletions dotnet/test/remote/Selenium.WebDriver.Remote.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
<EnableNUnitRunner>true</EnableNUnitRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\webdriver\Selenium.WebDriver.Tests.csproj" />
</ItemGroup>
Expand All @@ -26,4 +20,6 @@
</None>
</ItemGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />

</Project>
4 changes: 4 additions & 0 deletions dotnet/test/remote/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
group nuget
NUnit
NUnit.Analyzers
NUnit3TestAdapter
10 changes: 2 additions & 8 deletions dotnet/test/support/Selenium.Support.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@
<EnableNUnitRunner>true</EnableNUnitRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\support\Selenium.Support.csproj" />
<ProjectReference Include="..\webdriver\Selenium.WebDriver.Tests.csproj" />
<ProjectReference Include="..\testing.webserver\Selenium.Testing.WebServer.csproj" />
</ItemGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />

</Project>
6 changes: 6 additions & 0 deletions dotnet/test/support/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
group nuget
Microsoft.Bcl.AsyncInterfaces
Moq
NUnit
NUnit.Analyzers
NUnit3TestAdapter
11 changes: 2 additions & 9 deletions dotnet/test/webdriver/Selenium.WebDriver.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
<EnableNUnitRunner>true</EnableNUnitRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenderProxy" Version="1.1.2" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.13.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="Runfiles" Version="0.14.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\webdriver\Selenium.WebDriver.csproj" />
<ProjectReference Include="..\testing.webserver\Selenium.Testing.WebServer.csproj" />
Expand All @@ -35,4 +26,6 @@
</None>
</ItemGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />

</Project>
7 changes: 7 additions & 0 deletions dotnet/test/webdriver/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
group nuget
BenderProxy
Moq
NUnit
NUnit.Analyzers
NUnit3TestAdapter
Runfiles
Loading