From e578563fc568c2ad225d7c635ddc7658b40bf9ad Mon Sep 17 00:00:00 2001 From: MaliaLabor <99438964+MaliaLabor@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:54:14 +0000 Subject: [PATCH] [create-pull-request] automated change --- .github/workflows/update_name.yml | 57 ------------------- ARCHITECTURE.md | 2 +- CMakeLists.txt | 8 +-- README.md | 22 +++---- conanfile.py | 14 ++--- demos/CMakeLists.txt | 6 +- .../{__device__.cpp => storage.cpp} | 0 demos/conanfile.py | 2 +- .../storage.hpp} | 6 +- src/{__device__.cpp => storage.cpp} | 6 +- test_package/CMakeLists.txt | 4 +- test_package/main.cpp | 4 +- tests/main.test.cpp | 8 +-- .../{__device__.test.cpp => storage.test.cpp} | 10 ++-- 14 files changed, 46 insertions(+), 103 deletions(-) delete mode 100644 .github/workflows/update_name.yml rename demos/applications/{__device__.cpp => storage.cpp} (100%) rename include/{libhal-__device__/__device__.hpp => libhal-storage/storage.hpp} (84%) rename src/{__device__.cpp => storage.cpp} (83%) rename tests/{__device__.test.cpp => storage.test.cpp} (79%) diff --git a/.github/workflows/update_name.yml b/.github/workflows/update_name.yml deleted file mode 100644 index 606457f..0000000 --- a/.github/workflows/update_name.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2024 Khalil Estell -# -# 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. - -name: 🖋️ Update package name - -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - update_name: - name: 🖋️ Update package name - runs-on: ubuntu-latest - if: github.repository != 'libhal/libhal-__device__' - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - run: sudo apt install rename - - - name: Get device name from repo name - id: device_name - run: echo ${{ github.event.repository.name }} | sed -En "s/libhal-(.*)/device_name=\1/p" >> $GITHUB_ENV - - - name: Replace placeholder's in files - run: find . -type f -not -path '*/\.git/*' -exec sed -i "s/__device__/${{ env.device_name }}/g" {} + - - - name: Replace "// NOLINT" in files - run: find . -type f -not -path '*/\.git/*' -exec sed -i "s/[ ]*\/\/ NOLINT//g" {} + - - - name: Replace placeholder's in directory names - run: find . -type d -not -path '*/\.git/*' | xargs -r rename "s/__device__/${{ env.device_name }}/g" - - - name: Replace placeholder's in file names - run: find . -type f -not -path '*/\.git/*' | xargs -r rename "s/__device__/${{ env.device_name }}/g" - - - name: Remove update_name.yml file - run: rm .github/workflows/update_name.yml - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - title: "Rename device package to libhal-${{ env.device_name }}" diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index e101692..399832f 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -125,7 +125,7 @@ nothing except include `libhal-util`. Additional requirements and dependencies can be added after calling `add_demo_requirements`. -### `include/libhal-__device__/` +### `include/libhal-storage/` This directory contains the header files for the device library. This contains the public APIs. Try and keep the public APIs as minimal as possible as diff --git a/CMakeLists.txt b/CMakeLists.txt index f211ba8..2e99d2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,15 +13,15 @@ # limitations under the License. cmake_minimum_required(VERSION 3.15) -project(libhal-__device__ LANGUAGES CXX) +project(libhal-storage LANGUAGES CXX) libhal_test_and_make_library( - LIBRARY_NAME libhal-__device__ + LIBRARY_NAME libhal-storage SOURCES - src/__device__.cpp + src/storage.cpp TEST_SOURCES - tests/__device__.test.cpp + tests/storage.test.cpp tests/main.test.cpp ) diff --git a/README.md b/README.md index ac4fe91..e58812a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# libhal-__device__ +# libhal-storage -[![✅ Checks](https://github.com/libhal/libhal-__device__/actions/workflows/ci.yml/badge.svg)](https://github.com/libhal/libhal-__device__/actions/workflows/ci.yml) -[![GitHub stars](https://img.shields.io/github/stars/libhal/libhal-__device__.svg)](https://github.com/libhal/libhal-__device__/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/libhal/libhal-__device__.svg)](https://github.com/libhal/libhal-__device__/network) -[![GitHub issues](https://img.shields.io/github/issues/libhal/libhal-__device__.svg)](https://github.com/libhal/libhal-__device__/issues) +[![✅ Checks](https://github.com/libhal/libhal-storage/actions/workflows/ci.yml/badge.svg)](https://github.com/libhal/libhal-storage/actions/workflows/ci.yml) +[![GitHub stars](https://img.shields.io/github/stars/libhal/libhal-storage.svg)](https://github.com/libhal/libhal-storage/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/libhal/libhal-storage.svg)](https://github.com/libhal/libhal-storage/network) +[![GitHub issues](https://img.shields.io/github/issues/libhal/libhal-storage.svg)](https://github.com/libhal/libhal-storage/issues) -libhal compatible device library for the __device__ family of devices. +libhal compatible device library for the storage family of devices. ## 🏗️ Building Demos @@ -48,14 +48,14 @@ conan create . -pr stm32f103c8 -pr arm-gcc-12.3 --version=latest > `build/` directory at the root of the repo. Now links will point to the code > in the repo and NOT the conan package directory. -## 📋 Adding `libhal-__device__` to your project +## 📋 Adding `libhal-storage` to your project Add the following to your `requirements()` method within your application or library's `conanfile.py`: ```python def requirements(self): - self.requires("libhal-__device__/[^1.0.0]") + self.requires("libhal-storage/[^1.0.0]") ``` Replace version `1.0.0` with the desired version of the library. @@ -64,14 +64,14 @@ Assuming you are using CMake, you'll need to find and link the package to your executable: ```cmake -find_package(libhal-__device__ REQUIRED CONFIG) -target_link_libraries(app.elf PRIVATE libhal::__device__) +find_package(libhal-storage REQUIRED CONFIG) +target_link_libraries(app.elf PRIVATE libhal::storage) ``` Replace `app.elf` with the name of your executable. The available headers for your app or library will exist in the -[`include/libhal-__device__/`](./include/libhal-__device__) directory. +[`include/libhal-storage/`](./include/libhal-storage) directory. ## Contributing diff --git a/conanfile.py b/conanfile.py index 9efc429..fc20fad 100644 --- a/conanfile.py +++ b/conanfile.py @@ -18,12 +18,12 @@ required_conan_version = ">=2.0.14" -class libhal___device___conan(ConanFile): - name = "libhal-__device__" +class libhal_storage_conan(ConanFile): + name = "libhal-storage" license = "Apache-2.0" - homepage = "https://github.com/libhal/libhal-__device__" - description = ("A collection of drivers for the __device__") - topics = ("__device__", "libhal", "driver") + homepage = "https://github.com/libhal/libhal-storage" + description = ("A collection of drivers for the storage") + topics = ("storage", "libhal", "driver") settings = "compiler", "build_type", "os", "arch" python_requires = "libhal-bootstrap/[^4.0.0]" @@ -36,5 +36,5 @@ def requirements(self): bootstrap.module.add_library_requirements(self) def package_info(self): - self.cpp_info.libs = ["libhal-__device__"] - self.cpp_info.set_property("cmake_target_name", "libhal::__device__") + self.cpp_info.libs = ["libhal-storage"] + self.cpp_info.set_property("cmake_target_name", "libhal::storage") diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 462fd3e..5f6a758 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -18,14 +18,14 @@ project(demos LANGUAGES CXX) libhal_build_demos( DEMOS - __device__ + storage INCLUDES . PACKAGES - libhal-__device__ + libhal-storage LINK_LIBRARIES - libhal::__device__ + libhal::storage ) diff --git a/demos/applications/__device__.cpp b/demos/applications/storage.cpp similarity index 100% rename from demos/applications/__device__.cpp rename to demos/applications/storage.cpp diff --git a/demos/conanfile.py b/demos/conanfile.py index 11cd04f..3c3731d 100644 --- a/demos/conanfile.py +++ b/demos/conanfile.py @@ -21,4 +21,4 @@ class demos(ConanFile): def requirements(self): bootstrap = self.python_requires["libhal-bootstrap"] bootstrap.module.add_demo_requirements(self) - self.requires("libhal-__device__/[^1.0.0 || latest]") + self.requires("libhal-storage/[^1.0.0 || latest]") diff --git a/include/libhal-__device__/__device__.hpp b/include/libhal-storage/storage.hpp similarity index 84% rename from include/libhal-__device__/__device__.hpp rename to include/libhal-storage/storage.hpp index 60c9344..6290a2d 100644 --- a/include/libhal-__device__/__device__.hpp +++ b/include/libhal-storage/storage.hpp @@ -14,7 +14,7 @@ #pragma once -namespace hal::__device__ { // NOLINT -struct __device___replace_me // NOLINT +namespace hal::storage { +struct storage_replace_me {}; -} // namespace hal::__device__ +} // namespace hal::storage diff --git a/src/__device__.cpp b/src/storage.cpp similarity index 83% rename from src/__device__.cpp rename to src/storage.cpp index c0d3b65..2be31ef 100644 --- a/src/__device__.cpp +++ b/src/storage.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "libhal-__device__/__device__.hpp" +#include "libhal-storage/storage.hpp" -namespace hal::__device__ { // NOLINT -} // namespace hal::__device__ +namespace hal::storage { +} // namespace hal::storage diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt index 886091a..1782ab0 100644 --- a/test_package/CMakeLists.txt +++ b/test_package/CMakeLists.txt @@ -15,10 +15,10 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(libhal-__device__ REQUIRED CONFIG) +find_package(libhal-storage REQUIRED CONFIG) add_executable(${PROJECT_NAME} main.cpp) target_include_directories(${PROJECT_NAME} PUBLIC .) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) -target_link_libraries(${PROJECT_NAME} PRIVATE libhal::__device__) +target_link_libraries(${PROJECT_NAME} PRIVATE libhal::storage) diff --git a/test_package/main.cpp b/test_package/main.cpp index 6d7d30c..7b4b72c 100644 --- a/test_package/main.cpp +++ b/test_package/main.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include int main() { - hal::__device__::__device___replace_me bar; + hal::storage::storage_replace_me bar; } diff --git a/tests/main.test.cpp b/tests/main.test.cpp index 5b8c9f3..f352250 100644 --- a/tests/main.test.cpp +++ b/tests/main.test.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -namespace hal::__device__ { // NOLINT -extern void __device___test(); // NOLINT -} // namespace hal::__device__ +namespace hal::storage { +extern void storage_test(); +} // namespace hal::storage int main() { - hal::__device__::__device___test(); + hal::storage::storage_test(); } \ No newline at end of file diff --git a/tests/__device__.test.cpp b/tests/storage.test.cpp similarity index 79% rename from tests/__device__.test.cpp rename to tests/storage.test.cpp index c12bf8a..2a8a13f 100644 --- a/tests/__device__.test.cpp +++ b/tests/storage.test.cpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include -namespace hal::__device__ { // NOLINT -void __device___test() // NOLINT +namespace hal::storage { +void storage_test() { using namespace boost::ut; using namespace std::literals; - "__device__::create()"_test = []() { + "storage::create()"_test = []() { // Setup // Exercise // Verify }; }; -} // namespace hal::__device__ +} // namespace hal::storage