-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bazel rules for C# packaging, distribution and documentation #406
Add Bazel rules for C# packaging, distribution and documentation #406
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
#--------------------------------------------------------------------------- | ||
# Configuration options related to optional content included to the output | ||
#--------------------------------------------------------------------------- | ||
EXTRACT_STATIC = YES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't affect the C++ documentation (as it doesn't have docs for static classes -> doesn't need it) but is needed for the C# docs.
@@ -26,7 +26,7 @@ def _doxygen_docs_impl(ctx): | |||
files.extend(target.files.to_list()) | |||
|
|||
replacements = { | |||
"PROJECT_NAME": ctx.attr.project_name, | |||
"PROJECT_NAME": '"' + ctx.attr.project_name + '"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to scale from just cpp to cpp + csharp.
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# This file is based on the original implementation of https://github.com/SeleniumHQ/selenium/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things are just stolen (like dotnet_preamble
and many main ideas), and some things that I'll highlight further are modified. https://github.com/SeleniumHQ/selenium/. They have an Apache-2.0 license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put accredetation in the PR description :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what accreditation means in this context, but I've mentioned Selenium in the PR =) Hope it's what you was looking for
return version | ||
|
||
|
||
def _nuget_pack_impl(ctx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially taken from here, but this version has many small modifications.
|
||
def _nuget_pack_impl(ctx): | ||
version = _parse_version(ctx) | ||
nuspec = ctx.actions.declare_file("{}-generated.nuspec".format(ctx.label.name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create a .nuspec
-file (declaration of a nuget project) based on the given template.
|
||
package_name = "{}{}".format(ctx.attr.id, platform_suffix) | ||
|
||
if ctx.files.native_libs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we add native dynamic libs references to the template (needed for the runtime lib).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# This file is based on the original implementation of https://github.com/SeleniumHQ/selenium/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put accredetation in the PR description :)
We fixed the build issues with the doc target, that appeared because of the `cpp` dir renaming in[ the previous PR](#406), and some code style in the meantime.
What is the goal of this PR?
We prepare tools for the C# driver release, namely: documentation, packaging, and distribution.
What are the changes implemented in this PR?
Added:
Rules for the C# nuget packages generation and distribution. These rules are based on the rules from the open source Selenium repo, so thanks to them for boosting the development by making it available! They are used and tested in the typedb-driver project:
nuget_pack
: gets a list of C# libraries, native libs files (if needed), a template nuget project description, a list of files to include into the package (for example, README or logos), and produces two files: nupkg (nuget package) and snupkg (symbol package for debugging).nuget_push
: receives the result of the previous command and pushes the packages (with their symbols) to the target (snapshot/release) repo.Updated:
C++
. Now it's also convenient forC#
, so some refactoring and additions happened.