-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding assembly version stamping to .NET Bazel build process
- Loading branch information
Showing
9 changed files
with
142 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
[assembly: System.Reflection.AssemblyCompanyAttribute("{ASSEMBLY_COMPANY}")] | ||
[assembly: System.Reflection.AssemblyCopyrightAttribute("{ASSEMBLY_COPYRIGHT}")] | ||
[assembly: System.Reflection.AssemblyDescriptionAttribute("{ASSEMBLY_DESCRIPTION}")] | ||
[assembly: System.Reflection.AssemblyFileVersionAttribute("{ASSEMBLY_VERSION}")] | ||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("{ASSEMBLY_INFORMATIONAL_VERSION}")] | ||
[assembly: System.Reflection.AssemblyProductAttribute("{ASSEMBLY_PRODUCT}")] | ||
[assembly: System.Reflection.AssemblyTitleAttribute("{ASSEMBLY_TITLE}")] | ||
[assembly: System.Reflection.AssemblyVersionAttribute("{ASSEMBLY_VERSION}")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
exports_files(["WebDriver.snk"]) | ||
exports_files(["WebDriver.snk", "AssemblyInfo.cs.template"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Label of the template file to use. | ||
_TEMPLATE = "//dotnet:AssemblyInfo.cs.template" | ||
|
||
def _generated_assembly_info_impl(ctx): | ||
ctx.actions.expand_template( | ||
template = ctx.file.template, | ||
output = ctx.outputs.source_file, | ||
substitutions = { | ||
"{ASSEMBLY_VERSION}": ctx.attr.version, | ||
"{ASSEMBLY_COMPANY}": ctx.attr.company, | ||
"{ASSEMBLY_COPYRIGHT}": ctx.attr.copyright, | ||
"{ASSEMBLY_DESCRIPTION}": ctx.attr.description, | ||
"{ASSEMBLY_PRODUCT}": ctx.attr.product, | ||
"{ASSEMBLY_TITLE}": ctx.attr.title, | ||
"{ASSEMBLY_INFORMATIONAL_VERSION}": ctx.attr.informational_version, | ||
}, | ||
) | ||
|
||
generated_assembly_info = rule( | ||
implementation = _generated_assembly_info_impl, | ||
attrs = { | ||
"version": attr.string(mandatory = True), | ||
"company": attr.string(mandatory = True), | ||
"copyright": attr.string(mandatory = True), | ||
"description": attr.string(mandatory = True), | ||
"product": attr.string(mandatory = True), | ||
"title": attr.string(mandatory = True), | ||
"informational_version": attr.string(mandatory = True), | ||
"template": attr.label( | ||
default = Label(_TEMPLATE), | ||
allow_single_file = True, | ||
), | ||
}, | ||
outputs = {"source_file": "%{name}.AssemblyInfo.cs"}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters