Skip to content
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

Merged
merged 20 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
4 changes: 2 additions & 2 deletions docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

exports_files(["cpp/doxyfile.template"])
exports_files(["doxygen/doxyfile.template"])

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@vaticle_dependencies_tool_docs//:requirements.bzl", docs_requirement = "requirement")
Expand All @@ -37,7 +37,7 @@ py_binary(
bzl_library(
name = "lib",
srcs = [
"cpp/rules.bzl",
"doxygen/rules.bzl",
"python/rules.bzl",
],
deps = [],
Expand Down
5 changes: 5 additions & 0 deletions docs/cpp/doxyfile.template → docs/doxygen/doxyfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,8 @@ GENERATE_LATEX = NO
HIDE_UNDOC_RELATIONS = YES
CLASS_GRAPH = YES
HAVE_DOT = NO ## Disables many details

#---------------------------------------------------------------------------
# Configuration options related to optional content included to the output
#---------------------------------------------------------------------------
EXTRACT_STATIC = YES
Copy link
Member Author

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.

6 changes: 3 additions & 3 deletions docs/cpp/rules.bzl → docs/doxygen/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '"',
Copy link
Member Author

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.

"PROJECT_NUMBER" : ctx.attr.version,
"PROJECT_BRIEF" : ctx.attr.desc,
"OUTPUT_DIRECTORY" : output_directory.path,
Expand Down Expand Up @@ -90,15 +90,15 @@ doxygen_docs = rule(
),
"_doxyfile_template" : attr.label(
allow_single_file = True,
default = "//docs:cpp/doxyfile.template"
default = "//docs:doxygen/doxyfile.template"
),
"_output_directory" : attr.string(
doc = "The output directory for the doxygen docs",
default = "doxygen_docs"
)
},
doc = """
Creates HTML documentation for C++ projects using Doxygen.
Creates HTML documentation for C++ and C# projects using Doxygen.
This rule is not hermetic, and requires doxygen to be installed on the host.
"""
)
16 changes: 16 additions & 0 deletions nuget/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
Loading