Skip to content

Commit 957bd63

Browse files
ednolanclaude
andcommitted
Refresh repository to latest beman.exemplar template
- Stamped out from exemplar cookiecutter template (project_name=transform_view, maintainer=tzlaine, minimum_cpp_build_version=23, paper=P3117R0, library_type=interface, unit_test_library=gtest) - Replaced template placeholder C++ files with actual transform_view implementation (transform_view.hpp, transform_view.test.cpp, transform_view_direct_usage.cpp) - Updated CMake files to reflect actual source files; kept GTest::gtest_main per exemplar conventions - Copied CI matrix parameters (preset-test and build-and-test) from prior ci_tests.yml; retained exemplar workflow version tags - Copied doc/ directory unchanged from prior repository - Updated README.md preserving all transform_view-specific content while deferring to exemplar boilerplate structure - Ran beman-readme-platforms to sync Supported Platforms table - Ran pre-commit --all-files to apply linter fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3afe86f commit 957bd63

20 files changed

Lines changed: 538 additions & 1280 deletions

.exemplar_version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0e615052846f61ed12b4cac61accac8ad0074d13

.github/workflows/ci_tests.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111
schedule:
12-
- cron: '30 15 * * *'
12+
- cron: '9 13 * * 5'
1313

1414
jobs:
1515
beman-submodule-check:
16-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.2.1
16+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.5.0
1717

1818
preset-test:
19-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.2.1
19+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.5.0
2020
with:
2121
matrix_config: >
2222
[
@@ -31,7 +31,7 @@ jobs:
3131
]
3232
3333
build-and-test:
34-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.2.1
34+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.5.0
3535
with:
3636
matrix_config: >
3737
{
@@ -123,13 +123,7 @@ jobs:
123123
]
124124
}
125125
126-
install-test:
127-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-install-test.yml@1.2.1
128-
with:
129-
image: ghcr.io/bemanproject/infra-containers-gcc:latest
130-
cxx_standard: 26
131-
132126
create-issue-when-fault:
133127
needs: [preset-test, build-and-test]
134128
if: failure() && github.event_name == 'schedule'
135-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.2.1
129+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.5.0

.github/workflows/pre-commit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
pre-commit:
13-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.2.1
13+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.5.0

.github/workflows/pre-commit-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ name: Weekly pre-commit autoupdate
55
on:
66
workflow_dispatch:
77
schedule:
8-
- cron: "0 16 * * 0"
8+
- cron: "3 17 * * 1"
99

1010
jobs:
1111
auto-update-pre-commit:
12-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.2.1
12+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.5.0
1313
secrets:
1414
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
1515
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}

.markdownlint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md033.md
2+
# Disable inline html linter is needed for <details> <summary>
3+
MD033: false
4+
5+
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md
6+
# Conforms to .clang-format ColumnLimit
7+
# Update the comment in .clang-format if we no-longer tie these two column limits.
8+
MD013:
9+
line_length: 119
10+
code_blocks: false

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
# This brings in a portable version of clang-format.
1414
# See also: https://github.com/ssciwr/clang-format-wheel
1515
- repo: https://github.com/pre-commit/mirrors-clang-format
16-
rev: v22.1.2
16+
rev: v22.1.1
1717
hooks:
1818
- id: clang-format
1919
types_or: [c++, c]

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
22

3-
cmake_minimum_required(VERSION 3.28...4.2)
3+
cmake_minimum_required(VERSION 3.30...4.3)
44

55
project(
66
beman.transform_view # CMake Project Name, which is also the name of the top-level
77
# targets (e.g., library, executable, etc.).
8-
DESCRIPTION "A conditionally borrowed `std::ranges::transform_view`"
8+
DESCRIPTION "A conditionally borrowed std::ranges::transform_view"
99
LANGUAGES CXX
1010
VERSION 0.1.0
1111
)
@@ -25,7 +25,7 @@ option(
2525
)
2626

2727
# for find of beman-install-library
28-
include(infra/cmake/beman-install-library-config.cmake)
28+
include(infra/cmake/beman-install-library.cmake)
2929

3030
add_library(beman.transform_view INTERFACE)
3131
add_library(beman::transform_view ALIAS beman.transform_view)
@@ -37,13 +37,12 @@ target_sources(
3737

3838
set_target_properties(
3939
beman.transform_view
40-
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON
40+
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
4141
)
4242

4343
add_subdirectory(include/beman/transform_view)
4444

45-
find_package(beman-install-library REQUIRED)
46-
beman_install_library(beman.transform_view)
45+
beman_install_library(beman.transform_view TARGETS beman.transform_view)
4746

4847
if(BEMAN_TRANSFORM_VIEW_BUILD_TESTS)
4948
enable_testing()

CONTRIBUTING.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Development
2+
3+
## Configure and Build the Project Using CMake Presets
4+
5+
The simplest way of configuring and building the project is to use [CMake
6+
Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html). Appropriate
7+
presets for major compilers have been included by default. You can use `cmake
8+
--list-presets=workflow` to see all available presets.
9+
10+
Here is an example of invoking the `gcc-debug` preset:
11+
12+
```shell
13+
cmake --workflow --preset gcc-debug
14+
```
15+
16+
Generally, there are two kinds of presets, `debug` and `release`.
17+
18+
The `debug` presets are designed to aid development, so they have debuginfo and sanitizers
19+
enabled.
20+
21+
> [!NOTE]
22+
>
23+
> The sanitizers that are enabled vary from compiler to compiler. See the toolchain files
24+
> under ([`infra/cmake`](infra/cmake/)) to determine the exact configuration used for each
25+
> preset.
26+
27+
The `release` presets are designed for production use, and
28+
consequently have the highest optimization turned on (e.g. `O3`).
29+
30+
## Configure and Build Manually
31+
32+
If the presets are not suitable for your use case, a traditional CMake invocation will
33+
provide more configurability.
34+
35+
To configure, build and test the project manually, you can run this set of commands. Note
36+
that this requires GoogleTest to be installed.
37+
38+
```bash
39+
cmake \
40+
-B build \
41+
-S . \
42+
-DCMAKE_CXX_STANDARD=23 \
43+
# Your extra arguments here.
44+
cmake --build build
45+
ctest --test-dir build
46+
```
47+
48+
> [!IMPORTANT]
49+
>
50+
> Beman projects are [passive projects](
51+
> https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md#cmakepassive_projects),
52+
> so you need to specify the C++ version via `CMAKE_CXX_STANDARD` when manually
53+
> configuring the project.
54+
55+
## Dependency Management
56+
57+
### FetchContent
58+
59+
Instead of installing the project's dependencies via a package manager, you can optionally
60+
configure beman.transform_view to fetch them automatically via CMake FetchContent.
61+
62+
To do so, specify
63+
`-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake`. This will
64+
bring in GoogleTest automatically along with any other dependency the project may require.
65+
66+
Example commands:
67+
68+
```shell
69+
cmake \
70+
-B build \
71+
-S . \
72+
-DCMAKE_CXX_STANDARD=23 \
73+
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake
74+
cmake --build build
75+
ctest --test-dir build
76+
```
77+
78+
The file `./lockfile.json` configures the list of dependencies and versions that will be
79+
acquired by FetchContent.
80+
81+
## Project-specific configure arguments
82+
83+
Project-specific options are prefixed with `BEMAN_TRANSFORM_VIEW`.
84+
You can see the list of available options with:
85+
86+
```bash
87+
cmake -LH -S . -B build | grep "BEMAN_TRANSFORM_VIEW" -C 2
88+
```
89+
90+
<details>
91+
92+
<summary>Some project-specific configure arguments</summary>
93+
94+
### `BEMAN_TRANSFORM_VIEW_BUILD_TESTS`
95+
96+
Enable building tests and test infrastructure. Default: `ON`.
97+
Values: `{ ON, OFF }`.
98+
99+
### `BEMAN_TRANSFORM_VIEW_BUILD_EXAMPLES`
100+
101+
Enable building examples. Default: `ON`. Values: `{ ON, OFF }`.
102+
103+
### `BEMAN_TRANSFORM_VIEW_INSTALL_CONFIG_FILE_PACKAGE`
104+
105+
Enable installing the CMake config file package. Default: `ON`.
106+
Values: `{ ON, OFF }`.
107+
108+
This is required so that users of `beman.transform_view` can use
109+
`find_package(beman.transform_view)` to locate the library.
110+
111+
</details>

0 commit comments

Comments
 (0)