Compare commits

...

11 Commits
v6.1.0 ... main

Author SHA1 Message Date
ArthurSonzogni
add5f40d31
Restore dbox behavior from ftxui5.0.0
Some checks failed
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
Bug:https://github.com/eclipse-ecal/ecal/pull/2095
2025-05-02 16:48:00 +02:00
ArthurSonzogni
805db9bdea
Set Bazel compatibility level
Some checks failed
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Has been cancelled
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Has been cancelled
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
2025-05-01 11:53:18 +02:00
ArthurSonzogni
784f53fd7e
Remove attestion for Bazel 2025-05-01 11:30:12 +02:00
ArthurSonzogni
799d8a267e
Fix release workflow 2025-05-01 10:52:54 +02:00
ArthurSonzogni
f4513702b0
Fix release workflow 2025-05-01 10:40:53 +02:00
ArthurSonzogni
ba6716c6e1
Fix publish workflow 2025-05-01 10:33:19 +02:00
ArthurSonzogni
694fa6bf5c
Fix publish workflow 2025-05-01 10:09:18 +02:00
Arthur Sonzogni
625915b52c
Fix publish workflow (#1041) 2025-05-01 10:06:49 +02:00
Arthur Sonzogni
2d4c114008
v6.1.2 (#1040) 2025-05-01 10:01:05 +02:00
Arthur Sonzogni
aa80d8bac9
Generate attestation + refactor workflows (#1039) 2025-05-01 09:59:08 +02:00
Arthur Sonzogni
bcdcf70348
Fix Bazel Central Repository Workflow (#1038)
Some checks are pending
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, windows-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, ubuntu-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, macos-latest) (push) Waiting to run
Build / Bazel, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Waiting to run
Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Build packages (build/ftxui*Darwin*, macos-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Linux*, ubuntu-latest) (push) Blocked by required conditions
Build / Build packages (build/ftxui*Win64*, windows-latest) (push) Blocked by required conditions
Build / Build source package (push) Blocked by required conditions
Build / documentation (push) Waiting to run
2025-04-30 12:04:32 +02:00
10 changed files with 184 additions and 222 deletions

View File

@ -1,6 +1,3 @@
# Copyright 2025 Arthur Sonzogni. All rights reserved.
# Use of this source code is governed by the MIT license that can be found in
# the LICENSE file.
matrix:
platform:
- centos7

View File

@ -1,10 +1,12 @@
name: Build
on:
create:
# On new commits to main:
push:
branches:
- main
# On pull requests:
pull_request:
branches:
- main
@ -152,144 +154,3 @@ jobs:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml
# Create a release on new v* tags
release:
needs:
- test_cmake
- test_bazel
if: ${{ github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') }}
name: "Create release"
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: "Create release"
uses: softprops/action-gh-release@v1
id: create_release
with:
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build artifact for the release
package_compiled:
name: "Build packages"
needs: release
strategy:
matrix:
include:
- os: ubuntu-latest
asset_path: build/ftxui*Linux*
- os: macos-latest
asset_path: build/ftxui*Darwin*
- os: windows-latest
asset_path: build/ftxui*Win64*
runs-on: ${{ matrix.os }}
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Build packages"
run: >
mkdir build;
cd build;
cmake ..
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }}
-DFTXUI_BUILD_DOCS=OFF
-DFTXUI_BUILD_EXAMPLES=OFF
-DFTXUI_BUILD_TESTS=OFF
-DFTXUI_BUILD_TESTS_FUZZER=OFF
-DFTXUI_ENABLE_INSTALL=ON
-DFTXUI_DEV_WARNINGS=ON ;
cmake --build . --target package;
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.asset_path }}
overwrite: true
# Build "source" artifact for the release. This is the same as the github
# "source" archive, but with a stable URL. This is useful for the Bazel
# Central Repository.
package_source:
name: "Build source package"
needs: release
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Create source package"
run: >
git archive --format=tar.gz --prefix=ftxui/ -o source.tar.gz HEAD
- name: "Upload source package"
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: source.tar.gz
overwrite: true
documentation:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Install emsdk"
uses: mymindstorm/setup-emsdk@v7
- name: "Install Doxygen/Graphviz"
run: >
sudo apt-get update;
sudo apt-get install doxygen graphviz;
- name: "Build documentation"
run: >
mkdir build;
cd build;
emcmake cmake ..
-DCMAKE_BUILD_TYPE=Release
-DFTXUI_BUILD_DOCS=ON
-DFTXUI_BUILD_EXAMPLES=ON
-DFTXUI_BUILD_TESTS=OFF
-DFTXUI_BUILD_TESTS_FUZZER=OFF
-DFTXUI_ENABLE_INSTALL=OFF
-DFTXUI_DEV_WARNINGS=ON ;
cmake --build . --target doc;
cmake --build . ;
rsync -amv
--include='*/'
--include='*.html'
--include='*.css'
--include='*.mjs'
--include='*.js'
--include='*.wasm'
--exclude='*'
examples
doc/doxygen/html;
- name: "Deploy"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/doc/doxygen/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
publish_branch: gh-pages

60
.github/workflows/documentation.yaml vendored Normal file
View File

@ -0,0 +1,60 @@
name: Documentation
on:
# On new commits to main:
push:
branches:
- main
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Install emsdk"
uses: mymindstorm/setup-emsdk@v7
- name: "Install Doxygen/Graphviz"
run: >
sudo apt-get update;
sudo apt-get install doxygen graphviz;
- name: "Build documentation"
run: >
mkdir build;
cd build;
emcmake cmake ..
-DCMAKE_BUILD_TYPE=Release
-DFTXUI_BUILD_DOCS=ON
-DFTXUI_BUILD_EXAMPLES=ON
-DFTXUI_BUILD_TESTS=OFF
-DFTXUI_BUILD_TESTS_FUZZER=OFF
-DFTXUI_ENABLE_INSTALL=OFF
-DFTXUI_DEV_WARNINGS=ON ;
cmake --build . --target doc;
cmake --build . ;
rsync -amv
--include='*/'
--include='*.html'
--include='*.css'
--include='*.mjs'
--include='*.js'
--include='*.wasm'
--exclude='*'
examples
doc/doxygen/html;
- name: "Deploy"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/doc/doxygen/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
publish_branch: gh-pages

View File

@ -1,27 +1,24 @@
on:
# On new releases:
workflow_call:
inputs:
tag_name:
required: true
type: string
name: "Publish to Bazel Central Registry"
# On manual trigger:
on:
# Manual kick-off (you type the tag)
workflow_dispatch:
inputs:
tag_name:
description: "Tag to publish"
required: true
type: string
jobs:
permissions:
contents: write
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
with:
tag_name: ${{ inputs.tag_name }}
tag_name: ${{ github.event.inputs.tag_name }}
registry_fork: ArthurSonzogni/bazel-central-registry
permissions:
attestations: write
contents: write
id-token: write
attest: false
secrets:
publish_token: ${{ secrets.PUBLISH_TOKEN }}

100
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,100 @@
name: Release
on:
# On push to a tag:
push:
tags:
- 'v*'
# On manual trigger:
workflow_dispatch:
permissions:
# Needed to mint attestations
id-token: write
attestations: write
# Needed to upload release assets
contents: write
jobs:
release:
name: "Create release"
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: "Create release"
uses: softprops/action-gh-release@v1
id: create_release
with:
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build artifact for the release
package_compiled:
name: "Build packages"
needs: release
strategy:
matrix:
include:
- os: ubuntu-latest
asset_path: build/ftxui*Linux*
- os: macos-latest
asset_path: build/ftxui*Darwin*
- os: windows-latest
asset_path: build/ftxui*Win64*
runs-on: ${{ matrix.os }}
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Build packages"
run: >
mkdir build;
cd build;
cmake ..
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }}
-DFTXUI_BUILD_DOCS=OFF
-DFTXUI_BUILD_EXAMPLES=OFF
-DFTXUI_BUILD_TESTS=OFF
-DFTXUI_BUILD_TESTS_FUZZER=OFF
-DFTXUI_ENABLE_INSTALL=ON
-DFTXUI_DEV_WARNINGS=ON ;
cmake --build . --target package;
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.asset_path }}
overwrite: true
# Build "source" artifact for the release. This is the same as the github
# "source" archive, but with a stable URL. This is useful for the Bazel
# Central Repository.
package_source:
name: "Build source package"
needs: release
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Create source package"
run: >
git archive --format=tar.gz -o source.tar.gz HEAD
- name: "Upload source package"
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: source.tar.gz
overwrite: true

View File

@ -4,8 +4,12 @@ Changelog
Future release
------------
6.1.0 (2025-04-29)
-----------------
### dom
- Bugfix: Restore the `dbox` behavior from ftxui 5.0.0. To apply bgcolor
blending between the two layers, a new `dboxBlend` will be added.
6.1.8 (2025-05-01)
------------------
### Build
- Feature: Support `bazel` build system. See #1032.
@ -15,7 +19,7 @@ Future release
**MODULE.bazel**
```bazel
bazel_dep(name = "ftxui", version = "6.1.0")
bazel_dep(name = "ftxui", version = "6.1.8")
```
**BUILD.bazel**

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
project(ftxui
LANGUAGES CXX
VERSION 6.1.0
VERSION 6.1.8
DESCRIPTION "C++ Functional Terminal User Interface."
)

View File

@ -1,9 +1,5 @@
# Copyright 2025 Arthur Sonzogni. All rights reserved.
# Use of this source code is governed by the MIT license that can be found in
# the LICENSE file.
# FTXUI Module.
module(name = "ftxui", version = "6.1.0")
module(name = "ftxui", version = "6.1.8", compatibility_level = 6)
# Build deps.
bazel_dep(name = "rules_cc", version = "0.1.1")

View File

@ -372,7 +372,7 @@ include(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v6.1.0
GIT_TAG v6.1.8
)
FetchContent_GetProperties(ftxui)

View File

@ -45,59 +45,6 @@ class DBox : public Node {
child->SetBox(box);
}
}
void Render(Screen& screen) override {
if (children_.size() <= 1) {
Node::Render(screen);
return;
}
const int width = box_.x_max - box_.x_min + 1;
const int height = box_.y_max - box_.y_min + 1;
std::vector<Pixel> pixels(std::size_t(width * height));
for (auto& child : children_) {
child->Render(screen);
// Accumulate the pixels
Pixel* acc = pixels.data();
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
auto& pixel = screen.PixelAt(x + box_.x_min, y + box_.y_min);
acc->background_color =
Color::Blend(acc->background_color, pixel.background_color);
acc->automerge = pixel.automerge || acc->automerge;
if (pixel.character.empty()) {
acc->foreground_color =
Color::Blend(acc->foreground_color, pixel.background_color);
} else {
acc->blink = pixel.blink;
acc->bold = pixel.bold;
acc->dim = pixel.dim;
acc->inverted = pixel.inverted;
acc->italic = pixel.italic;
acc->underlined = pixel.underlined;
acc->underlined_double = pixel.underlined_double;
acc->strikethrough = pixel.strikethrough;
acc->hyperlink = pixel.hyperlink;
acc->character = pixel.character;
acc->foreground_color = pixel.foreground_color;
}
++acc; // NOLINT
pixel = Pixel();
}
}
}
// Render the accumulated pixels:
Pixel* acc = pixels.data();
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
screen.PixelAt(x + box_.x_min, y + box_.y_min) = *acc++; // NOLINT
}
}
}
};
} // namespace