Skip to content

Commit

Permalink
Merge pull request #1 from libhal/create-pull-request/patch
Browse files Browse the repository at this point in the history
Rename device package to libhal-storage
  • Loading branch information
MaliaLabor authored Aug 9, 2024
2 parents 4590aea + e578563 commit 7cde263
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 103 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/update_name.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand All @@ -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")
6 changes: 3 additions & 3 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
File renamed without changes.
2 changes: 1 addition & 1 deletion demos/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/__device__.cpp → src/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions test_package/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libhal-__device__/__device__.hpp>
#include <libhal-storage/storage.hpp>

int main()
{
hal::__device__::__device___replace_me bar;
hal::storage::storage_replace_me bar;
}
8 changes: 4 additions & 4 deletions tests/main.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
10 changes: 5 additions & 5 deletions tests/__device__.test.cpp → tests/storage.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libhal-__device__/__device__.hpp>
#include <libhal-storage/storage.hpp>

#include <boost/ut.hpp>

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

0 comments on commit 7cde263

Please sign in to comment.