blob: 00facebdd49bcdffa76e87d1e266daeddcf17c05 [file] [log] [blame]
/*
* Copyright 2018-present Facebook, Inc.
*
* Licensed 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.
*/
{namespace table_of_contents}
/**
* Consider passing in the path to the URL of the page that the user
* is currently on and not hyperlinking that item in the table of contents.
* @param navid The navigation id of the loaded page
*/
{template .main}
{let $platformRulesMap: [
'android': [
'android_aar',
'android_binary',
'android_build_config',
'android_instrumentation_apk',
'android_instrumentation_test',
'android_library',
'android_manifest',
'android_prebuilt_aar',
'android_resource',
'apk_genrule',
'gen_aidl',
'keystore',
'ndk_library',
'prebuilt_jar',
'prebuilt_native_library',
'robolectric_test',
],
'core': [
'command_alias',
'export_file',
'filegroup',
'genrule',
'http_archive',
'http_file',
'remote_file',
'test_suite',
'worker_tool',
'zip_file',
],
'cxx': [
'cxx_binary',
'cxx_library',
'cxx_genrule',
'cxx_precompiled_header',
'cxx_test',
'prebuilt_cxx_library',
'prebuilt_cxx_library_group',
],
'd': [
'd_binary',
'd_library',
'd_test',
],
'dotnet': [
'csharp_library',
'prebuilt_dotnet_library',
],
'go': [
'go_binary',
'go_library',
'go_test',
'cgo_library',
],
'groovy': [
'groovy_library',
],
'halide': [
'halide_library',
],
'haskell': [
'haskell_binary',
'haskell_library',
'prebuilt_haskell_library',
],
'ios': [
'apple_asset_catalog',
'apple_binary',
'apple_bundle',
'apple_library',
'apple_package',
'apple_resource',
'apple_test',
'core_data_model',
'prebuilt_apple_framework',
],
'java': [
'java_binary',
'java_library',
'java_test',
'prebuilt_jar',
'prebuilt_native_library',
],
'kotlin': [
'kotlin_library',
'kotlin_test',
],
'lua': [
'cxx_lua_extension',
'lua_binary',
'lua_library',
],
'ocaml': [
'ocaml_binary',
'ocaml_library',
],
'python': [
'prebuilt_python_library',
'python_binary',
'python_library',
'python_test',
],
'rust': [
'rust_binary',
'rust_library',
'rust_test',
'prebuilt_rust_library',
],
'shell': [
'sh_binary',
'sh_test',
],
] /}
<h3>The Basics</h3>
<ul>
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'setup' /}
{param page: 'getting_started' /}
{param text: 'Getting Started' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'about' /}
{param page: 'overview' /}
{param text: 'Key Concepts' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'learning' /}
{param page: 'tutorial' /}
{param text: 'Tutorial' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'setup' /}
{param page: 'intellij_plugin_install' /}
{param text: 'Installing the IntelliJ Plugin' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'article' /}
{param page: 'exopackage' /}
{param text: 'Exopackage' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'article' /}
{param page: 'query_cheat_sheet' /}
{param text: 'Buck Cheat Sheet' /}
{/call}
</ul>
<h3>About</h3>
<ul>
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'what_makes_buck_so_fast' /}
{param text: 'What Makes Buck so Fast?' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'about' /}
{param page: 'showcase' /}
{param text: 'Showcase' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'troubleshooting' /}
{param text: 'Troubleshooting' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'about' /}
{param page: 'performance_tuning' /}
{param text: 'Performance Tuning' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'faq' /}
{param text: 'FAQ' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'presentations' /}
{param page: 'index' /}
{param text: 'Learn More (Buck Presentations)' /}
{/call}
</ul>
<h3>Concepts</h3>
<ul>
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'build_rule' /}
{param text: 'Build Rule' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'build_file' /}
{param text: 'Build File' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'build_target' /}
{param text: 'Build Target' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'build_target_pattern' /}
{param text: 'Build Target Pattern' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'buckd' /}
{param text: 'Buck Daemon (buckd)' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'visibility' /}
{param text: 'Visibility' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'http_cache_api' /}
{param text: 'HTTP Cache API' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'rule_keys' /}
{param text: 'Rule Keys' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'java_abis' /}
{param text: 'Java ABIs' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'concept' /}
{param page: 'skylark' /}
{param text: 'Skylark' /}
{/call}
</ul>
{call .tocFilesDirs}
{param navid: $navid /}
{/call}
{call .tocCommands}
{param navid: $navid /}
{/call}
<h3>Build Rules</h3>
<ul>
// Ugh, closure doesn't have the concept of sorting, so we cannot control the order without
// listing it ourselves.
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Core' /}
{param rules: $platformRulesMap['core'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Android' /}
{param rules: $platformRulesMap['android'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'CXX' /}
{param rules: $platformRulesMap['cxx'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'D' /}
{param rules: $platformRulesMap['d'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Go' /}
{param rules: $platformRulesMap['go'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Groovy' /}
{param rules: $platformRulesMap['groovy'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Halide' /}
{param rules: $platformRulesMap['halide'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Haskell' /}
{param rules: $platformRulesMap['haskell'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'iOS' /}
{param rules: $platformRulesMap['ios'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Java' /}
{param rules: $platformRulesMap['java'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Kotlin' /}
{param rules: $platformRulesMap['kotlin'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Lua' /}
{param rules: $platformRulesMap['lua'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'OCaml' /}
{param rules: $platformRulesMap['ocaml'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Python' /}
{param rules: $platformRulesMap['python'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Rust' /}
{param rules: $platformRulesMap['rust'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: 'Shell' /}
{param rules: $platformRulesMap['shell'] /}
{/call}
{call navigation.platformBuildRuleLink}
{param currentnavid: $navid /}
{param platform: '.NET' /}
{param rules: $platformRulesMap['dotnet'] /}
{/call}
</ul>
<h3>Functions</h3>
<ul>
<li><strong>Python DSL</strong></li>
{foreach $function in [
'add_build_file_dep',
'allow_unsafe_import',
'flatten_dicts',
'glob',
'get_base_path',
'get_cell_name',
'host_info',
'include_defs',
'load',
'read_config',
'subdir_glob',
]}
{let $functiontext}
{$function}()
{/let}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'function' /}
{param page: $function /}
{param text: $functiontext /}
{/call}
{/foreach}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'function' /}
{param page: 'string_parameter_macros' /}
{param text: 'String Parameter Macros' /}
{/call}
</ul>
{call skylark.tableOfContents}
{param navid: $navid /}
{/call}
<h3>Extending Buck</h3>
<ul>
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'extending' /}
{param page: 'macros' /}
{param text: 'Custom Macros' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'extending' /}
{param page: 'rules' /}
{param text: 'Custom Rules' /}
{/call}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'extending' /}
{param page: 'e2e_tests' /}
{param text: 'Building E2E Tests for Buck' /}
{/call}
</ul>
{/template}
/**
* Table of contents for Buck files and directories section.
* @param navid The current page's navigation id.
*/
{template .tocFilesDirs}
<h3>Files and Directories</h3>
<ul>
{foreach $file_dir in [
'buckconfig',
'buckjavaargs',
]}
{let $file_dir_text}
.{$file_dir}
{/let}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'files-and-dirs' /}
{param page: $file_dir /}
{param text: $file_dir_text /}
{/call}
{/foreach}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'files-and-dirs' /}
{param page: 'buck-out' /}
{param text: 'buck-out' /}
{/call}
</ul>
{/template}
/**
* Table of contents for Buck commands section.
* @param navid The current page's navigation id.
*/
{template .tocCommands}
<h3>Commands</h3>
<ul>
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'command' /}
{param page: 'common_parameters' /}
{param text: 'Common Parameters' /}
{/call}
{foreach $command in [
'audit',
'build',
'clean',
'doctor',
'fetch',
'fix',
'install',
'kill',
'killall',
'project',
'publish',
'query',
'run',
'root',
'server',
'targets',
'test',
'uninstall',
]}
{let $commandtext}
buck {$command}
{/let}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'command' /}
{param page: $command /}
{param text: $commandtext /}
{/call}
{/foreach}
{call navigation.link}
{param currentnavid: $navid /}
{param folder: 'command' /}
{param page: 'exit_codes' /}
{param text: 'Exit Codes' /}
{/call}
</ul>
{/template}