-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs are now auto-generated using mdbook (#692)
- Loading branch information
1 parent
4a3b072
commit a7f1c9e
Showing
31 changed files
with
362 additions
and
948 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,42 @@ | ||
diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel | ||
index a5a37ac..e381ce8 100644 | ||
--- a/docs/BUILD.bazel | ||
+++ b/docs/BUILD.bazel | ||
@@ -35,7 +35,7 @@ genrule( | ||
cmd = """cat << EOF > $@ | ||
#!/bin/bash | ||
set -e | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/README.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/index.md | ||
""", | ||
) | ||
|
||
diff --git a/docs/book.toml b/docs/book.toml | ||
new file mode 100644 | ||
index 0000000..5096728 | ||
--- /dev/null | ||
+++ b/docs/book.toml | ||
@@ -0,0 +1,5 @@ | ||
+[book] | ||
+title = "Rules ForeignCc" | ||
+ | ||
+[output.html] | ||
+git-repository-url = "https://github.com/bazelbuild/rules_foreign_cc" | ||
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md | ||
new file mode 100644 | ||
index 0000000..69fbd4d | ||
--- /dev/null | ||
+++ b/docs/src/SUMMARY.md | ||
@@ -0,0 +1,3 @@ | ||
+# SUMMARY | ||
+ | ||
+- [Rules ForeignCc](index.md) | ||
diff --git a/version.bzl b/version.bzl | ||
new file mode 100644 | ||
index 0000000..98bb722 | ||
--- /dev/null | ||
+++ b/version.bzl | ||
@@ -0,0 +1,3 @@ | ||
+"""A module represeting the version of rules_foreign_cc""" | ||
+ | ||
+VERSION = "0.1.0" |
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,42 @@ | ||
diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel | ||
index a5a37ac..091e679 100644 | ||
--- a/docs/BUILD.bazel | ||
+++ b/docs/BUILD.bazel | ||
@@ -35,7 +35,7 @@ genrule( | ||
cmd = """cat << EOF > $@ | ||
#!/bin/bash | ||
set -e | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/README.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/index.md | ||
""", | ||
) | ||
|
||
diff --git a/docs/book.toml b/docs/book.toml | ||
new file mode 100644 | ||
index 0000000..5096728 | ||
--- /dev/null | ||
+++ b/docs/book.toml | ||
@@ -0,0 +1,5 @@ | ||
+[book] | ||
+title = "Rules ForeignCc" | ||
+ | ||
+[output.html] | ||
+git-repository-url = "https://github.com/bazelbuild/rules_foreign_cc" | ||
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md | ||
new file mode 100644 | ||
index 0000000..69fbd4d | ||
--- /dev/null | ||
+++ b/docs/src/SUMMARY.md | ||
@@ -0,0 +1,3 @@ | ||
+# SUMMARY | ||
+ | ||
+- [Rules ForeignCc](index.md) | ||
diff --git a/version.bzl b/version.bzl | ||
new file mode 100644 | ||
index 0000000..98bb722 | ||
--- /dev/null | ||
+++ b/version.bzl | ||
@@ -0,0 +1,3 @@ | ||
+"""A module represeting the version of rules_foreign_cc""" | ||
+ | ||
+VERSION = "0.2.0" |
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,82 @@ | ||
diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel | ||
index 461df15..efa4c26 100644 | ||
--- a/docs/BUILD.bazel | ||
+++ b/docs/BUILD.bazel | ||
@@ -68,16 +68,17 @@ build_test( | ||
|
||
genrule( | ||
name = "generate_docs_src", | ||
- srcs = DOCS_TARGETS, | ||
+ srcs = DOCS_TARGETS + ["index.md"], | ||
outs = ["generate_docs.sh"], | ||
cmd = """cat << EOF > $@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:flatten_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/flatten.md | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:cmake_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/cmake.md | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:ninja_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/ninja.md | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:make_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/make.md | ||
-cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:configure_make_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/configure_make.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:flatten_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/flatten.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:cmake_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/cmake.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:ninja_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/ninja.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:make_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/make.md | ||
+cat \\$${BUILD_WORKSPACE_DIRECTORY}/$(location //:configure_make_docs) > \\$${BUILD_WORKSPACE_DIRECTORY}/src/configure_make.md | ||
+cp \\$${BUILD_WORKSPACE_DIRECTORY}/$(rootpath index.md) \\$${BUILD_WORKSPACE_DIRECTORY}/src/index.md | ||
EOF | ||
""", | ||
) | ||
diff --git a/docs/book.toml b/docs/book.toml | ||
new file mode 100644 | ||
index 0000000..5096728 | ||
--- /dev/null | ||
+++ b/docs/book.toml | ||
@@ -0,0 +1,5 @@ | ||
+[book] | ||
+title = "Rules ForeignCc" | ||
+ | ||
+[output.html] | ||
+git-repository-url = "https://github.com/bazelbuild/rules_foreign_cc" | ||
diff --git a/docs/index.md b/docs/index.md | ||
index 3a91e41..14c8e3b 100644 | ||
--- a/docs/index.md | ||
+++ b/docs/index.md | ||
@@ -21,9 +21,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "rules_foreign_cc", | ||
- sha256 = "d54742ffbdc6924f222d2179f0e10e911c5c659c4ae74158e9fe827aad862ac6", | ||
- strip_prefix = "rules_foreign_cc-0.2.0", | ||
- url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.tar.gz", | ||
+ # TODO: Get the latest sha256 value from the latest release on the releases page | ||
+ # https://github.com/bazelbuild/rules_foreign_cc/releases | ||
+ # | ||
+ # sha256 = "...", | ||
+ strip_prefix = "rules_foreign_cc-0.3.0", | ||
+ url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.3.0.tar.gz", | ||
) | ||
|
||
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") | ||
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md | ||
new file mode 100644 | ||
index 0000000..9e77270 | ||
--- /dev/null | ||
+++ b/docs/src/SUMMARY.md | ||
@@ -0,0 +1,8 @@ | ||
+# SUMMARY | ||
+ | ||
+- [Rules ForeignCc](index.md) | ||
+ - [cmake](cmake.md) | ||
+ - [configure_make](configure_make.md) | ||
+ - [make](make.md) | ||
+ - [ninja](ninja.md) | ||
+ - [Full API](flatten.md) | ||
diff --git a/version.bzl b/version.bzl | ||
new file mode 100644 | ||
index 0000000..98bb722 | ||
--- /dev/null | ||
+++ b/version.bzl | ||
@@ -0,0 +1,3 @@ | ||
+"""A module represeting the version of rules_foreign_cc""" | ||
+ | ||
+VERSION = "0.3.0" |
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,91 @@ | ||
name: Deploy mdBook | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
pages: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Create a job for each target triple | ||
include: | ||
- ref: main | ||
- ref: "0.3.0" | ||
- ref: "0.2.0" | ||
- ref: "0.1.0" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
if: ${{ matrix.ref == 'main' }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ matrix.ref }} | ||
if: ${{ matrix.ref != 'main' }} | ||
- name: Pin the release to main | ||
run: echo "RELEASE=main" >> $GITHUB_ENV | ||
if: ${{ matrix.ref == 'main' }} | ||
- name: Patch older branches | ||
run: | | ||
mkdir -p ${{ github.workspace }}/.github | ||
curl https://raw.githubusercontent.com/bazelbuild/rules_foreign_cc/main/.github/docs-${{ matrix.ref }}.patch > ${{ github.workspace }}/.github/docs-${{ matrix.ref }}.patch | ||
git apply ${{ github.workspace }}/.github/docs-${{ matrix.ref }}.patch | ||
if: ${{ matrix.ref == '0.3.0' || matrix.ref == '0.2.0' || matrix.ref == '0.1.0' }} | ||
- name: Install bazelisk | ||
run: | | ||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.9.0/bazelisk-linux-amd64" | ||
mkdir -p "${{ github.workspace }}/bin/" | ||
mv bazelisk-linux-amd64 "${{ github.workspace }}/bin/bazel" | ||
chmod +x "${{ github.workspace }}/bin/bazel" | ||
- name: Generate docs | ||
run: | | ||
"${{ github.workspace }}/bin/bazel" run //:generate_docs | ||
"${{ github.workspace }}/bin/bazel" clean | ||
working-directory: ${{ github.workspace }}/docs | ||
- name: Install mdbook | ||
run: | | ||
curl -LO "https://github.com/rust-lang/mdBook/releases/download/v0.4.10/mdbook-v0.4.10-x86_64-unknown-linux-gnu.tar.gz" | ||
mkdir -p "${{ github.workspace }}/bin/" | ||
tar -xvf mdbook-v0.4.10-x86_64-unknown-linux-gnu.tar.gz | ||
mv mdbook "${{ github.workspace }}/bin/mdbook" | ||
chmod +x "${{ github.workspace }}/bin/mdbook" | ||
- name: mdbook build | ||
run: ${{ github.workspace }}/bin/mdbook build | ||
working-directory: ${{ github.workspace }}/docs | ||
- name: Save the newly built book | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ matrix.ref }}" | ||
path: ${{ github.workspace }}/docs/book | ||
if-no-files-found: error | ||
- name: Build root | ||
run: ${{ github.workspace }}/bin/mdbook build | ||
if: ${{ matrix.ref == 'main' }} | ||
working-directory: ${{ github.workspace }}/docs/root | ||
- name: Save the newly built book | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ matrix.ref }}-root" | ||
path: ${{ github.workspace }}/docs/root/book | ||
if-no-files-found: error | ||
if: ${{ matrix.ref == 'main' }} | ||
publish: | ||
needs: pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch artifacts (first root then others so the ordering is correct) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: main-root | ||
path: ${{ github.workspace }}/docs/book | ||
- name: Fetch artifacts (first root then others so the ordering is correct) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: ${{ github.workspace }}/docs/pages | ||
- name: Install pages | ||
run: mv ${{ github.workspace }}/docs/pages/* ${{ github.workspace }}/docs/book/ | ||
- name: publish | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: docs | ||
publish_dir: ./docs/book |
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,3 @@ | ||
# Bazel configuration flags for rules_foregin_cc_docs | ||
|
||
build --workspace_status_command=tools/workspace_status.sh |
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,2 @@ | ||
src | ||
book |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.