Skip to content

Commit 9d92e71

Browse files
aiutocopybara-github
authored andcommitted
Small tweaks to platform documentation.
- Point platform rules to the explanatory document which people should have read first. - Update the left nav to include the word "Toolchains" - move https://bazel.build/extending/platforms from Design Docs to Concepts It's not much, but it is a start. Note to the team: The automatic docs from source system makes this painfully complex. We need a way to generate rule doc from source but keep all the organization of how we group rules under what headings to the framework on the docs serving side. Next steps: - Update the platforms page. RELNOTES: None PiperOrigin-RevId: 504460917 Change-Id: I0acc1bd9ef8f6381f5c898688dddf328dcf513aa
1 parent 851c330 commit 9d92e71

File tree

7 files changed

+20
-14
lines changed

7 files changed

+20
-14
lines changed

src/main/java/com/google/devtools/build/docgen/templates/be/be-toc.vm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ toc:
99
path: /reference/be/make-variables
1010
- title: Functions
1111
path: /reference/be/functions
12-
- title: Language-specific rules
12+
- title: Core rules
13+
section:
14+
#foreach ($ruleFamily in $genericRuleFamilies)
15+
#if ($ruleFamily.size() > 0)
16+
- title: ${ruleFamily.name}
17+
path: /reference/be/${ruleFamily.id}
18+
#end
19+
#end
20+
- title: Language Specific rules
1321
section:
1422
#foreach ($ruleFamily in $langSpecificRuleFamilies)
1523
#if ($ruleFamily.size() > 0)
@@ -53,11 +61,3 @@ toc:
5361
- title: Scala
5462
path: https://github.com/bazelbuild/rules_scala
5563
status: external
56-
- title: Language-agnostic rules
57-
section:
58-
#foreach ($ruleFamily in $genericRuleFamilies)
59-
#if ($ruleFamily.size() > 0)
60-
- title: ${ruleFamily.name}
61-
path: /reference/be/${ruleFamily.id}
62-
#end
63-
#end

src/main/java/com/google/devtools/build/docgen/templates/be/rules.vm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
${ruleFamily.summary}
2121

22+
<h2>Context</h2>
23+
This set of rules exist to help model specific hardware platforms you are
24+
building for and the tools you may use to compile code for those platforms.
25+
The user should be familiar with the concepts explained
26+
<a href="//extending/platforms">here</a>.
27+
2228
#if (!$singlePage)
2329
<h2>Rules</h2>
2430
<ul>

src/main/java/com/google/devtools/build/lib/rules/ToolchainType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public Metadata getMetadata() {
7171
}
7272
}
7373
}
74-
/*<!-- #BLAZE_RULE (NAME = toolchain_type, FAMILY = Platform)[GENERIC_RULE] -->
74+
/*<!-- #BLAZE_RULE (NAME = toolchain_type, FAMILY = Platforms and Toolchains)[GENERIC_RULE] -->
7575
7676
<p>
7777
This rule defines a new type of toolchain -- a simple target that represents a class of tools that

src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public RuleDefinition.Metadata getMetadata() {
7777
.build();
7878
}
7979
}
80-
/*<!-- #BLAZE_RULE (NAME = constraint_setting, FAMILY = Platform)[GENERIC_RULE] -->
80+
/*<!-- #BLAZE_RULE (NAME = constraint_setting, FAMILY = Platforms and Toolchains)[GENERIC_RULE] -->
8181
8282
<p>This rule is used to introduce a new constraint type for which a platform may specify a value.
8383
For instance, you might define a <code>constraint_setting</code> named "glibc_version" to represent

src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Metadata getMetadata() {
7575
.build();
7676
}
7777
}
78-
/*<!-- #BLAZE_RULE (NAME = constraint_value, FAMILY = Platform)[GENERIC_RULE] -->
78+
/*<!-- #BLAZE_RULE (NAME = constraint_value, FAMILY = Platforms and Toolchains)[GENERIC_RULE] -->
7979
8080
This rule introduces a new value for a given constraint type.
8181

src/main/java/com/google/devtools/build/lib/rules/platform/PlatformRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public Metadata getMetadata() {
135135
.build();
136136
}
137137
}
138-
/*<!-- #BLAZE_RULE (NAME = platform, FAMILY = Platform)[GENERIC_RULE] -->
138+
/*<!-- #BLAZE_RULE (NAME = platform, FAMILY = Platforms and Toolchains)[GENERIC_RULE] -->
139139
140140
<p>This rule defines a new platform -- a named collection of constraint choices
141141
(such as cpu architecture or compiler version) describing an environment in

src/main/java/com/google/devtools/build/lib/rules/platform/ToolchainRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public RuleDefinition.Metadata getMetadata() {
107107
.build();
108108
}
109109
}
110-
/*<!-- #BLAZE_RULE (NAME = toolchain, FAMILY = Platform)[GENERIC_RULE] -->
110+
/*<!-- #BLAZE_RULE (NAME = toolchain, FAMILY = Platforms and Toolchains)[GENERIC_RULE] -->
111111
112112
<p>This rule declares a specific toolchain's type and constraints so that it can be selected
113113
during toolchain resolution. See the

0 commit comments

Comments
 (0)