Skip to content

Commit 19e81de

Browse files
committed
Fixing strong-named assembly references
In the move to using the `dotnet` build tools instead of calling the C# compiler directly, the creation of strong-named assemblies was broken with incorrect references being created. This commit fixes that problem. Fixes issue #5254.
1 parent be434cd commit 19e81de

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

dotnet/src/support/BUCK

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,28 @@ genrule(
6767
genrule(
6868
name = 'net35_strongnamed',
6969
srcs = [ 'WebDriver.Support.csproj' ],
70-
cmd = "echo '$(location //dotnet/src/webdriver:net35_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
70+
cmd = "echo '$(location //dotnet/src/webdriver:net35_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
7171
out = 'net35'
7272
)
7373

7474
genrule(
7575
name = 'net40_strongnamed',
7676
srcs = [ 'WebDriver.Support.csproj' ],
77-
cmd = "echo '$(location //dotnet/src/webdriver:net40_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
77+
cmd = "echo '$(location //dotnet/src/webdriver:net40_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
7878
out = 'net40'
7979
)
8080

8181
genrule(
8282
name = 'net45_strongnamed',
8383
srcs = [ 'WebDriver.Support.csproj' ],
84-
cmd = "echo '$(location //dotnet/src/webdriver:net45_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
84+
cmd = "echo '$(location //dotnet/src/webdriver:net45_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
8585
out = 'net45'
8686
)
8787

8888
genrule(
8989
name = 'netstandard2.0_strongnamed',
9090
srcs = [ 'WebDriver.Support.csproj' ],
91-
cmd = "echo '$(location //dotnet/src/webdriver:netstandard2.0_strongnamed)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
91+
cmd = "echo '$(location //dotnet/src/webdriver:netstandard2.0_strongnamed)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
9292
out = 'netstandard2.0'
9393
)
9494

dotnet/src/support/WebDriver.Support.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<FileVersion>3.0.0.0</FileVersion>
2929
</PropertyGroup>
3030

31+
<PropertyGroup Condition="'$(SignAssembly)'=='true'">
32+
<SignAssembly>true</SignAssembly>
33+
<AssemblyOriginatorKeyFile>..\..\WebDriver.snk</AssemblyOriginatorKeyFile>
34+
</PropertyGroup>
35+
3136
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|AnyCPU'">
3237
<DocumentationFile>..\..\..\build\cli\Release\net35\WebDriver.Support.xml</DocumentationFile>
3338
</PropertyGroup>

dotnet/src/webdriver/BUCK

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ genrule(
8181
genrule(
8282
name = 'net35_strongnamed',
8383
srcs = [ 'WebDriver.csproj' ],
84-
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
84+
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
8585
out = 'net35',
8686
visibility = [
8787
'//dotnet/src/webdriverbackedselenium:net35_strongnamed',
@@ -92,7 +92,7 @@ genrule(
9292
genrule(
9393
name = 'net40_strongnamed',
9494
srcs = [ 'WebDriver.csproj' ],
95-
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
95+
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
9696
out = 'net40',
9797
visibility = [
9898
'//dotnet/src/webdriverbackedselenium:net40_strongnamed',
@@ -103,7 +103,7 @@ genrule(
103103
genrule(
104104
name = 'net45_strongnamed',
105105
srcs = [ 'WebDriver.csproj' ],
106-
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
106+
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
107107
out = 'net45',
108108
visibility = [
109109
'//dotnet/src/webdriverbackedselenium:net45_strongnamed',
@@ -114,7 +114,7 @@ genrule(
114114
genrule(
115115
name = 'netstandard2.0_strongnamed',
116116
srcs = [ 'WebDriver.csproj' ],
117-
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
117+
cmd = "echo '$(location :webdriver_deps)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
118118
out = 'netstandard2.0',
119119
visibility = [
120120
'//dotnet/src/webdriverbackedselenium:netstandard2.0_strongnamed',

dotnet/src/webdriver/WebDriver.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<FileVersion>3.0.0.0</FileVersion>
2929
</PropertyGroup>
3030

31+
<PropertyGroup Condition="'$(SignAssembly)'=='true'">
32+
<SignAssembly>true</SignAssembly>
33+
<AssemblyOriginatorKeyFile>..\..\WebDriver.snk</AssemblyOriginatorKeyFile>
34+
</PropertyGroup>
35+
3136
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|AnyCPU'">
3237
<DocumentationFile>..\..\..\build\cli\Release\net35\WebDriver.xml</DocumentationFile>
3338
</PropertyGroup>

dotnet/src/webdriverbackedselenium/BUCK

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,28 @@ genrule(
6767
genrule(
6868
name = 'net35_strongnamed',
6969
srcs = [ 'Selenium.WebDriverBackedSelenium.csproj' ],
70-
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net35_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
70+
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net35_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net35 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
7171
out = 'net35'
7272
)
7373

7474
genrule(
7575
name = 'net40_strongnamed',
7676
srcs = [ 'Selenium.WebDriverBackedSelenium.csproj' ],
77-
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net40_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
77+
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net40_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net40 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
7878
out = 'net40'
7979
)
8080

8181
genrule(
8282
name = 'net45_strongnamed',
8383
srcs = [ 'Selenium.WebDriverBackedSelenium.csproj' ],
84-
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net45_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
84+
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:net45_strongnamed)' && dotnet build %SRCS% --configuration Release --framework net45 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
8585
out = 'net45'
8686
)
8787

8888
genrule(
8989
name = 'netstandard2.0_strongnamed',
9090
srcs = [ 'Selenium.WebDriverBackedSelenium.csproj' ],
91-
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:netstandard2.0_strongnamed)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$(location //dotnet:keyfile) /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
91+
cmd = "echo '$(location :webdriverbackedselenium_deps)' && echo '$(location //dotnet/src/webdriver:netstandard2.0_strongnamed)' && dotnet build %SRCS% --configuration Release --framework netstandard2.0 --output %OUT% /p:SignAssembly=true /p:Version={} /p:AssemblyVersion={} /p:FileVersion={} /p:BuildSystem=buck".format(SE_VERSION, ASSEMBLY_VERSION, ASSEMBLY_VERSION),
9292
out = 'netstandard2.0'
9393
)
9494

dotnet/src/webdriverbackedselenium/Selenium.WebDriverBackedSelenium.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<FileVersion>3.0.0.0</FileVersion>
2929
</PropertyGroup>
3030

31+
<PropertyGroup Condition="'$(SignAssembly)'=='true'">
32+
<SignAssembly>true</SignAssembly>
33+
<AssemblyOriginatorKeyFile>..\..\WebDriver.snk</AssemblyOriginatorKeyFile>
34+
</PropertyGroup>
35+
3136
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|AnyCPU'">
3237
<DocumentationFile>..\..\..\build\cli\Release\net35\Selenium.WebDriverBackedSelenium.xml</DocumentationFile>
3338
</PropertyGroup>

0 commit comments

Comments
 (0)