mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Compare commits
9 Commits
v6.1.7
...
0e69836cb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e69836cb1 | ||
|
|
e185d6d475 | ||
|
|
f8d4880517 | ||
|
|
38869c4aaa | ||
|
|
4a75d49478 | ||
|
|
c3d03dc716 | ||
|
|
053a1d8290 | ||
|
|
45bf24f8ea | ||
|
|
f128c442cc |
@@ -1,9 +0,0 @@
|
|||||||
# Bazel Central Registry
|
|
||||||
|
|
||||||
When the ruleset is released, we want it to be published to the
|
|
||||||
Bazel Central Registry automatically:
|
|
||||||
<https://registry.bazel.build>
|
|
||||||
|
|
||||||
This folder contains configuration files to automate the publish step.
|
|
||||||
See <https://github.com/bazel-contrib/publish-to-bcr/blob/main/templates/README.md>
|
|
||||||
for authoritative documentation about these files.
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"homepage": "https://github.com/ArthurSonzogni/FTXUI",
|
|
||||||
"maintainers": [
|
|
||||||
{
|
|
||||||
"name": "Arthur Sonzogni",
|
|
||||||
"email": "sonzogniarthur@gmail.com",
|
|
||||||
"github": "ArthurSonzogni",
|
|
||||||
"github_user_id": 4759106
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"repository": [
|
|
||||||
"github:ArthurSonzogni/FTXUI"
|
|
||||||
],
|
|
||||||
"versions": [],
|
|
||||||
"yanked_versions": {}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# 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
|
|
||||||
- debian10
|
|
||||||
- ubuntu2004
|
|
||||||
- macos
|
|
||||||
- windows
|
|
||||||
bazel: [6.x, 7.x, 8.x]
|
|
||||||
tasks:
|
|
||||||
verify_targets:
|
|
||||||
name: Build and test.
|
|
||||||
platform: ${{ platform }}
|
|
||||||
bazel: ${{ bazel }}
|
|
||||||
build_targets:
|
|
||||||
- '@ftxui//:ftxui'
|
|
||||||
- '@ftxui//:screen'
|
|
||||||
- '@ftxui//:dom'
|
|
||||||
- '@ftxui//:component'
|
|
||||||
test_targets:
|
|
||||||
- '@ftxui//:tests'
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"integrity": "",
|
|
||||||
"strip_prefix": "",
|
|
||||||
"url": "https://github.com/ArthurSonzogni/FTXUI/releases/download/{TAG}/source.tar.gz"
|
|
||||||
}
|
|
||||||
170
.github/workflows/build.yaml
vendored
170
.github/workflows/build.yaml
vendored
@@ -1,52 +1,17 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# On new commits to main:
|
create:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
# On pull requests:
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
test_bazel:
|
name: "Tests"
|
||||||
name: "Bazel, ${{ matrix.compiler }}, ${{ matrix.os }}"
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
compiler: gcc
|
|
||||||
|
|
||||||
- os: ubuntu-latest
|
|
||||||
compiler: llvm
|
|
||||||
|
|
||||||
- os: macos-latest
|
|
||||||
compiler: llvm
|
|
||||||
|
|
||||||
- os: macos-latest
|
|
||||||
compiler: gcc
|
|
||||||
|
|
||||||
- os: windows-latest
|
|
||||||
compiler: cl
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Build with Bazel"
|
|
||||||
run: bazel build ...
|
|
||||||
|
|
||||||
- name: "Tests with Bazel"
|
|
||||||
run: bazel run tests
|
|
||||||
|
|
||||||
test_cmake:
|
|
||||||
name: "CMake, ${{ matrix.compiler }}, ${{ matrix.os }}"
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -90,6 +55,19 @@ jobs:
|
|||||||
gcovr: "5.0"
|
gcovr: "5.0"
|
||||||
opencppcoverage: true
|
opencppcoverage: true
|
||||||
|
|
||||||
|
- name: "Install Bazel"
|
||||||
|
uses: bazel-contrib/setup-bazel@0.14.0
|
||||||
|
with:
|
||||||
|
bazelisk-cache: true
|
||||||
|
disk-cache: ${{ github.workflow }}
|
||||||
|
repository-cache: true
|
||||||
|
|
||||||
|
- name: "Build with Bazel"
|
||||||
|
run: bazel build ...
|
||||||
|
|
||||||
|
- name: "Tests with Bazel"
|
||||||
|
run: bazel run tests
|
||||||
|
|
||||||
# make sure coverage is only enabled for Debug builds, since it sets -O0
|
# make sure coverage is only enabled for Debug builds, since it sets -O0
|
||||||
# to make sure coverage has meaningful results
|
# to make sure coverage has meaningful results
|
||||||
- name: "Configure CMake"
|
- name: "Configure CMake"
|
||||||
@@ -154,3 +132,119 @@ jobs:
|
|||||||
flags: ${{ runner.os }}
|
flags: ${{ runner.os }}
|
||||||
name: ${{ runner.os }}-coverage
|
name: ${{ runner.os }}-coverage
|
||||||
files: ./build/coverage.xml
|
files: ./build/coverage.xml
|
||||||
|
|
||||||
|
# Create a release on new v* tags
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
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:
|
||||||
|
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
|
||||||
|
|
||||||
|
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
60
.github/workflows/documentation.yaml
vendored
@@ -1,60 +0,0 @@
|
|||||||
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
|
|
||||||
37
.github/workflows/publish.yaml
vendored
37
.github/workflows/publish.yaml
vendored
@@ -1,37 +0,0 @@
|
|||||||
name: "Publish to Bazel Central Registry"
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Manual kick-off (you type the tag)
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
description: "Tag to publish"
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
# Fire as soon as the Release workflow completes
|
|
||||||
workflow_run:
|
|
||||||
workflows:
|
|
||||||
- Release
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
|
|
||||||
attestations: write
|
|
||||||
contents: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
|
|
||||||
# Only run on manual dispatch, or when Release finishes successfully
|
|
||||||
if: |
|
|
||||||
github.event_name == 'workflow_dispatch' ||
|
|
||||||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name || github.event.workflow_run.head_branch }}
|
|
||||||
registry_fork: ArthurSonzogni/bazel-central-registry
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
publish_token: ${{ secrets.PUBLISH_TOKEN }}
|
|
||||||
116
.github/workflows/release.yaml
vendored
116
.github/workflows/release.yaml
vendored
@@ -1,116 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
- name: Generate source attestation
|
|
||||||
id: attest_source
|
|
||||||
uses: actions/attest-build-provenance@v2
|
|
||||||
with:
|
|
||||||
subject-path: source.tar.gz
|
|
||||||
|
|
||||||
- name: Rename source attestation
|
|
||||||
run: mv ${{ steps.attest_source.outputs.bundle-path }} source.tar.gz.intoto.jsonl
|
|
||||||
|
|
||||||
- name: "Upload source attestation"
|
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
|
||||||
asset_path: source.tar.gz.intoto.jsonl
|
|
||||||
overwrite: true
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,7 +35,6 @@ out/
|
|||||||
|
|
||||||
# bazel directory:
|
# bazel directory:
|
||||||
!bazel/**/*.bzl
|
!bazel/**/*.bzl
|
||||||
!.bcr/*
|
|
||||||
|
|
||||||
# doc directory:
|
# doc directory:
|
||||||
!doc/**/Doxyfile.in
|
!doc/**/Doxyfile.in
|
||||||
|
|||||||
20
BUILD.bazel
20
BUILD.bazel
@@ -3,18 +3,18 @@
|
|||||||
# the LICENSE file.
|
# the LICENSE file.
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# - Build benchmark.
|
# - Windows/MSVC support.
|
||||||
# - Build fuzzers.
|
# - Pass /utf-8 to MSVC users depending on FTXUI.
|
||||||
# - Build documentation.
|
# - Pass "FTXUI_MICROSOFT_TERMINAL_FALLBACK" to windows users.
|
||||||
|
# - Support building benchmark.
|
||||||
|
# - Support building examples.
|
||||||
|
# - Support building fuzzer.
|
||||||
|
# - Support building documentation.
|
||||||
# - Enable the two tests timing out.
|
# - Enable the two tests timing out.
|
||||||
# - Support WebAssembly
|
# - Support WebAssembly
|
||||||
|
|
||||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||||
load(":bazel/ftxui.bzl", "ftxui_cc_library")
|
load(":bazel/ftxui.bzl", "ftxui_cc_library", "generate_examples")
|
||||||
load(":bazel/ftxui.bzl", "generate_examples")
|
|
||||||
load(":bazel/ftxui.bzl", "cpp20")
|
|
||||||
load(":bazel/ftxui.bzl", "windows_copts")
|
|
||||||
load(":bazel/ftxui.bzl", "pthread_linkopts")
|
|
||||||
|
|
||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ ftxui_cc_library(
|
|||||||
"include/ftxui/component/screen_interactive.hpp",
|
"include/ftxui/component/screen_interactive.hpp",
|
||||||
"include/ftxui/component/task.hpp",
|
"include/ftxui/component/task.hpp",
|
||||||
],
|
],
|
||||||
linkopts = pthread_linkopts(),
|
linkopts = ["-lpthread"],
|
||||||
deps = [":dom"],
|
deps = [":dom"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -237,11 +237,11 @@ cc_test(
|
|||||||
# - "src/ftxui/component/screen_interactive_test.cpp",
|
# - "src/ftxui/component/screen_interactive_test.cpp",
|
||||||
# - "src/ftxui/dom/selection_test.cpp",
|
# - "src/ftxui/dom/selection_test.cpp",
|
||||||
],
|
],
|
||||||
|
copts = ["-std=c++20"],
|
||||||
includes = [
|
includes = [
|
||||||
"include",
|
"include",
|
||||||
"src",
|
"src",
|
||||||
],
|
],
|
||||||
copts = cpp20() + windows_copts(),
|
|
||||||
deps = [
|
deps = [
|
||||||
"//:ftxui",
|
"//:ftxui",
|
||||||
"@googletest//:gtest_main",
|
"@googletest//:gtest_main",
|
||||||
|
|||||||
32
CHANGELOG.md
32
CHANGELOG.md
@@ -1,36 +1,8 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Future release
|
Development
|
||||||
------------
|
-----------
|
||||||
|
|
||||||
6.1.7 (2025-05-01)
|
|
||||||
------------------
|
|
||||||
|
|
||||||
### Build
|
|
||||||
- Feature: Support `bazel` build system. See #1032.
|
|
||||||
Proposed by Kostya Serebryany @kcc
|
|
||||||
If all goes well (pending), it should appear in the Bazel central repository.
|
|
||||||
It can be imported into your project using the following lines:
|
|
||||||
|
|
||||||
**MODULE.bazel**
|
|
||||||
```bazel
|
|
||||||
bazel_dep(name = "ftxui", version = "6.1.7")
|
|
||||||
```
|
|
||||||
|
|
||||||
**BUILD.bazel**
|
|
||||||
```bazel
|
|
||||||
deps = [
|
|
||||||
// Depend on the whole library:
|
|
||||||
"@ftxui//:ftxui",
|
|
||||||
|
|
||||||
// Choose a specific submodule:
|
|
||||||
"@ftxui//:component",
|
|
||||||
"@ftxui//:dom",
|
|
||||||
"@ftxui//:screen",
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Component
|
### Component
|
||||||
- Bugfix: Fix a crash with ResizeableSplit. See #1023.
|
- Bugfix: Fix a crash with ResizeableSplit. See #1023.
|
||||||
- Clamp screen size to terminal size.
|
- Clamp screen size to terminal size.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
|||||||
|
|
||||||
project(ftxui
|
project(ftxui
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
VERSION 6.1.7
|
VERSION 6.0.2
|
||||||
DESCRIPTION "C++ Functional Terminal User Interface."
|
DESCRIPTION "C++ Functional Terminal User Interface."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
23
MODULE.bazel
23
MODULE.bazel
@@ -1,13 +1,20 @@
|
|||||||
# 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.
|
# FTXUI Module.
|
||||||
module(name = "ftxui", version = "6.1.7")
|
module(
|
||||||
|
name = "ftxui",
|
||||||
|
version = "6.0.3",
|
||||||
|
)
|
||||||
|
|
||||||
# Build deps.
|
# Build deps.
|
||||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
bazel_dep(name = "rules_cc", version = "0.0.17")
|
||||||
bazel_dep(name = "platforms", version = "0.0.11")
|
bazel_dep(name = "platforms", version = "0.0.10")
|
||||||
|
bazel_dep(name = "bazel_skylib", version = "1.7.1")
|
||||||
|
|
||||||
# Test deps.
|
# Test deps.
|
||||||
bazel_dep(name = "googletest", version = "1.16.0.bcr.1")
|
bazel_dep(name = "googletest", version = "1.15.2")
|
||||||
|
|
||||||
|
# Toolchain deps.
|
||||||
|
#cc_configure = use_extension(
|
||||||
|
#"@rules_cc//bzlmod:extensions.bzl",
|
||||||
|
#"cc_configure",
|
||||||
|
#)
|
||||||
|
#use_repo(cc_configure, "local_config_cc_toolchains")
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ A simple cross-platform C++ library for terminal based user interfaces!
|
|||||||
* No dependencies
|
* No dependencies
|
||||||
* **Cross platform**: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!).
|
* **Cross platform**: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!).
|
||||||
* Learn by [examples](#documentation), and [tutorials](#documentation)
|
* Learn by [examples](#documentation), and [tutorials](#documentation)
|
||||||
* Multiple packages: CMake [FetchContent]([https://bewagner.net/programming/2020/05/02/cmake-fetchcontent/](https://cmake.org/cmake/help/latest/module/FetchContent.html)) (preferred),Bazel, vcpkg, pkgbuild, conan.
|
* Multiple packages: CMake [FetchContent]([https://bewagner.net/programming/2020/05/02/cmake-fetchcontent/](https://cmake.org/cmake/help/latest/module/FetchContent.html)) (preferred), vcpkg, pkgbuild, conan.
|
||||||
* Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
|
* Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
@@ -372,7 +372,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
FetchContent_Declare(ftxui
|
FetchContent_Declare(ftxui
|
||||||
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
||||||
GIT_TAG v6.1.7
|
GIT_TAG v6.0.2
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_GetProperties(ftxui)
|
FetchContent_GetProperties(ftxui)
|
||||||
@@ -383,7 +383,6 @@ endif()
|
|||||||
```
|
```
|
||||||
|
|
||||||
If you don't, FTXUI may be used from the following packages:
|
If you don't, FTXUI may be used from the following packages:
|
||||||
- [bazel](...)
|
|
||||||
- [vcpkg](https://vcpkgx.com/details.html?package=ftxui)
|
- [vcpkg](https://vcpkgx.com/details.html?package=ftxui)
|
||||||
- [Arch Linux PKGBUILD](https://aur.archlinux.org/packages/ftxui-git/).
|
- [Arch Linux PKGBUILD](https://aur.archlinux.org/packages/ftxui-git/).
|
||||||
- [conan.io](https://conan.io/center/ftxui)
|
- [conan.io](https://conan.io/center/ftxui)
|
||||||
@@ -396,6 +395,8 @@ If you choose to build and link FTXUI yourself, `ftxui-component` must be first
|
|||||||
g++ . . . -lftxui-component -lftxui-dom -lftxui-screen . . .
|
g++ . . . -lftxui-component -lftxui-dom -lftxui-screen . . .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
<a href="https://github.com/ArthurSonzogni/FTXUI/graphs/contributors">
|
<a href="https://github.com/ArthurSonzogni/FTXUI/graphs/contributors">
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
# 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.
|
|
||||||
workspace(name = "ftxui")
|
workspace(name = "ftxui")
|
||||||
|
|||||||
@@ -2,80 +2,12 @@
|
|||||||
|
|
||||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||||
|
|
||||||
def cpp17():
|
|
||||||
return select({
|
|
||||||
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++17"],
|
|
||||||
"@rules_cc//cc/compiler:clang-cl": ["/std:c++17"],
|
|
||||||
"@rules_cc//cc/compiler:clang": ["-std=c++17"],
|
|
||||||
"@rules_cc//cc/compiler:gcc": ["-std=c++17"],
|
|
||||||
"//conditions:default": ["-std=c++17"],
|
|
||||||
})
|
|
||||||
|
|
||||||
def cpp20():
|
|
||||||
return select({
|
|
||||||
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"],
|
|
||||||
"@rules_cc//cc/compiler:clang-cl": ["/std:c++20"],
|
|
||||||
"@rules_cc//cc/compiler:clang": ["-std=c++20"],
|
|
||||||
"@rules_cc//cc/compiler:gcc": ["-std=c++20"],
|
|
||||||
"//conditions:default": ["-std=c++20"],
|
|
||||||
})
|
|
||||||
|
|
||||||
# Microsoft terminal is a bit buggy ¯\_(ツ)_/¯ and MSVC uses bad defaults.
|
|
||||||
def windows_copts():
|
|
||||||
MSVC_COPTS = [
|
|
||||||
# Microsoft Visual Studio must decode sources files as UTF-8.
|
|
||||||
"/utf-8",
|
|
||||||
|
|
||||||
# Microsoft Visual Studio must interpret the codepoint using unicode.
|
|
||||||
"/DUNICODE",
|
|
||||||
"/D_UNICODE",
|
|
||||||
|
|
||||||
# Fallback for Microsoft Terminal.
|
|
||||||
# This
|
|
||||||
# - Replace missing font symbols by others.
|
|
||||||
# - Reduce screen position pooling frequency to deals against a Microsoft
|
|
||||||
# race condition. This was fixed in 2020, but clients never not updated.
|
|
||||||
# - https://github.com/microsoft/terminal/pull/7583
|
|
||||||
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
|
|
||||||
"/DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
|
|
||||||
]
|
|
||||||
|
|
||||||
WINDOWS_COPTS = [
|
|
||||||
# Fallback for Microsoft Terminal.
|
|
||||||
# This
|
|
||||||
# - Replace missing font symbols by others.
|
|
||||||
# - Reduce screen position pooling frequency to deals against a Microsoft
|
|
||||||
# race condition. This was fixed in 2020, but clients never not updated.
|
|
||||||
# - https://github.com/microsoft/terminal/pull/7583
|
|
||||||
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
|
|
||||||
"-DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
|
|
||||||
];
|
|
||||||
|
|
||||||
return select({
|
|
||||||
# MSVC:
|
|
||||||
"@rules_cc//cc/compiler:msvc-cl": MSVC_COPTS,
|
|
||||||
"@rules_cc//cc/compiler:clang-cl": MSVC_COPTS,
|
|
||||||
"@platforms//os:windows": WINDOWS_COPTS,
|
|
||||||
"//conditions:default": [],
|
|
||||||
})
|
|
||||||
|
|
||||||
def pthread_linkopts():
|
|
||||||
return select({
|
|
||||||
# With MSVC, threading is already built-in (you don't need -pthread.
|
|
||||||
"@rules_cc//cc/compiler:msvc-cl": [],
|
|
||||||
"@rules_cc//cc/compiler:clang-cl": [],
|
|
||||||
"@rules_cc//cc/compiler:clang": ["-pthread"],
|
|
||||||
"@rules_cc//cc/compiler:gcc": ["-pthread"],
|
|
||||||
"//conditions:default": ["-pthread"],
|
|
||||||
})
|
|
||||||
|
|
||||||
def ftxui_cc_library(
|
def ftxui_cc_library(
|
||||||
name,
|
name,
|
||||||
srcs,
|
srcs,
|
||||||
hdrs,
|
hdrs,
|
||||||
linkopts = [],
|
linkopts = [],
|
||||||
deps = []):
|
deps = []):
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = name,
|
name = name,
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
@@ -88,12 +20,10 @@ def ftxui_cc_library(
|
|||||||
"include",
|
"include",
|
||||||
"src",
|
"src",
|
||||||
],
|
],
|
||||||
copts = cpp17() + windows_copts(),
|
copts = ["-std=c++17"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Compile all the examples in the examples/ directory.
|
|
||||||
# This is useful to check the Bazel is synchronized with CMake definitions.
|
|
||||||
def generate_examples():
|
def generate_examples():
|
||||||
cpp_files = native.glob(["examples/**/*.cpp"])
|
cpp_files = native.glob(["examples/**/*.cpp"])
|
||||||
|
|
||||||
@@ -111,5 +41,4 @@ def generate_examples():
|
|||||||
name = name,
|
name = name,
|
||||||
srcs = [src],
|
srcs = [src],
|
||||||
deps = ["//:component"],
|
deps = ["//:component"],
|
||||||
copts = cpp20() + windows_copts(),
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user