Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/linux-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fi

mkdir -p "release/${ARTIFACT_NAME}/share/applications" "release/${ARTIFACT_NAME}/share/icons"
cp build/CoreDeck "release/${ARTIFACT_NAME}/"
cp build/libimgui.so "release/${ARTIFACT_NAME}/"
cp -r build/assets "release/${ARTIFACT_NAME}/"
cp "${desktop}" "release/${ARTIFACT_NAME}/share/applications/com.devmuaz.coredeck.desktop"
cp -R packaging/linux/hicolor "release/${ARTIFACT_NAME}/share/icons/hicolor"
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ on:
branches: [ main, develop ]

jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yml
structure_format_tidy:
name: Structure, format, and tidy
uses: ./.github/workflows/structure-format-tidy.yml

linux:
name: Linux
needs: structure_format_tidy
uses: ./.github/workflows/build-linux.yml
secrets: inherit

macos:
name: macOS
needs: structure_format_tidy
uses: ./.github/workflows/build-macos.yml
secrets: inherit

windows:
name: Windows
needs: structure_format_tidy
uses: ./.github/workflows/build-windows.yml
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Lint
name: Structure, format, and tidy

on:
workflow_call:

jobs:
lint:
structure-format-tidy:
name: Structure, format, and clang-tidy
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
build/
build-release/
build-debug/
build-tidy/
build-homebrew-gcc16-release/
build-homebrew-gcc16-debug/
build-homebrew-clang-release/
Expand Down
11 changes: 11 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@
"command": "& \"${workspaceFolder}/.vscode/scripts/run-ctest.ps1\" -BuildType Debug"
}
},
{
"label": "structure-format-tidy",
"type": "shell",
"command": "bash \"${workspaceFolder}/tools/structure_format_tidy.sh\"",
"problemMatcher": [],
"group": "test",
"presentation": {
"reveal": "always",
"panel": "dedicated"
}
},
{
"label": "ctest-release",
"type": "shell",
Expand Down
50 changes: 39 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ project.

## Branching Model

| Branch | Purpose |
| --------- | --------------------------------------------------------- |
| `main` | Stable, release-ready code. Protected — no direct pushes. |
| `develop` | Active development. All feature work merges here first. |
| Branch | Purpose |
| --------- | -------------------------------------------------------------------------- |
| `main` | Stable, release-ready code. Protected — no direct pushes. |
| `develop` | Active development. Feature work merges here. Test tags are cut from here. |

```
feature/* ──> develop ──> main (via PR) ──> tag vX.Y.Z ──> release
feature/* ──> develop ──> tag vX.Y.Z-label ──> pre-release
│
└──> main (via PR) ──> tag vX.Y.Z ──> stable release
```

## How to Contribute
Expand Down Expand Up @@ -48,7 +50,7 @@ feature/* ──> develop ──> main (via PR) ──> tag vX.Y.Z ──> relea

## PR Guidelines

- PRs to `develop` trigger the CI build workflow across Windows, macOS, and Linux
- A pull request into `develop` runs the build on Windows, macOS, and Linux. Merge the feature there. A pull request into `main` runs that same build and is how `develop` is promoted for a stable release, not how each feature lands
- Make sure the build passes on all platforms before requesting review
- Keep PRs focused — avoid mixing unrelated changes
- Update the [CHANGELOG.md](CHANGELOG.md) if your change is user-facing
Expand Down Expand Up @@ -79,7 +81,7 @@ Prefix with `fix:`, `refactor:`, or `chore:` when it helps clarify intent, but i
- C++20 standard
- No comments unless the "why" is non-obvious
- Keep changes minimal — don't refactor unrelated code in the same PR
- File names, layers, and entry points follow [the source layout](docs/building.md#source-layout). `tools/check_structure.py` checks them locally, and CI runs that script with `clang-format` and `clang-tidy`
- File names, layers, and entry points follow [the source layout](docs/building.md#source-layout). Run `tools/structure_format_tidy.sh` before opening a pull request. It runs the structure check, `clang-format`, and `clang-tidy` that CI runs. The Windows, macOS, and Linux builds start only after that job passes

## Bumping the bundled command-line tools

Expand Down Expand Up @@ -118,11 +120,37 @@ This is routine maintenance, not a hotfix: Google keeps old archives available f

## Release Process

Releases are handled by maintainers:
Maintainers publish two kinds of builds. Pushing a tag that starts with `v` starts the release workflow. The tag's commit is what gets built. `main` does not have to move for a test build.

1. `develop` is merged into `main` via PR
2. A version tag (`vX.Y.Z`) is pushed to `main`
3. The release workflow builds and publishes artifacts for all platforms
A tag with a hyphen, such as `v0.17.0-phase1`, is a pre-release. A tag with no hyphen, such as `v0.17.0`, is a stable release. A stable tag also updates the Homebrew tap. A pre-release does not.

### Pre-release

A pre-release is an unfinished test build. It is not battle-tested, it may crash or misbehave, and it is not a build to rely on. Install a stable release for everyday use.

1. The approved work is on `develop`. Leave `main` where it is.
2. Tag that commit with a hyphen in the name and push the tag:

```bash
git checkout develop
git tag v0.17.0-phase1
git push origin v0.17.0-phase1
```

3. The workflow publishes a GitHub pre-release with the signed installers. The Homebrew tap stays on the last stable version.

### Stable release

1. Open a pull request from `develop` into `main` and wait for the build.
2. Merge it, then push a tag with no hyphen to that `main` commit:

```bash
git checkout main
git tag v0.17.0
git push origin v0.17.0
```

3. The workflow publishes the stable release and updates the Homebrew tap.

## Questions?

Expand Down
9 changes: 5 additions & 4 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ coredeck_add_extern(${CMAKE_SOURCE_DIR}/extern/glfw ${CMAKE_BINARY_DIR}/extern/g
find_package(OpenGL REQUIRED)

set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/extern/imgui)
add_library(imgui STATIC
add_library(imgui SHARED
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
)
target_include_directories(imgui PUBLIC ${IMGUI_DIR} ${IMGUI_DIR}/backends)
target_link_libraries(imgui PUBLIC glfw OpenGL::GL)
if(WIN32)
target_compile_definitions(imgui PRIVATE "IMGUI_API=__declspec(dllexport)")
target_compile_definitions(imgui INTERFACE "IMGUI_API=__declspec(dllimport)")
endif()

set(REFLECTCPP_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(REFLECTCPP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
Expand Down
6 changes: 6 additions & 0 deletions cmake/Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ if(WIN32 AND COREDECK_INTL_RUNTIME_DLLS)
install(FILES ${COREDECK_INTL_RUNTIME_DLLS} DESTINATION .)
endif()

if(WIN32)
install(TARGETS imgui RUNTIME DESTINATION .)
elseif(UNIX AND NOT APPLE)
install(TARGETS imgui LIBRARY DESTINATION .)
endif()

if(NOT APPLE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/assets/fonts DESTINATION assets)
install(DIRECTORY ${COREDECK_LOCALE_DIR}/ DESTINATION assets/locales)
Expand Down
31 changes: 29 additions & 2 deletions cmake/Runtime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,27 @@ else()
)
endif()

if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH "@executable_path/../Frameworks"
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:imgui>" "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks/$<TARGET_FILE_NAME:imgui>"
VERBATIM
)
endif()

if(UNIX AND NOT APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
)
endif()

if(APPLE AND NOT Intl_IS_BUILT_IN)
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY BUILD_RPATH "@executable_path/../Frameworks")
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INSTALL_RPATH "@executable_path/../Frameworks")
get_filename_component(_intl_real "${Intl_LIBRARY}" REALPATH)
execute_process(
COMMAND otool -D "${_intl_real}"
Expand All @@ -38,6 +56,15 @@ if(APPLE AND NOT Intl_IS_BUILT_IN)
COMMAND ${CMAKE_COMMAND} -E copy "${_intl_real}" "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks/libintl.8.dylib"
COMMAND install_name_tool -id "@rpath/libintl.8.dylib" "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks/libintl.8.dylib"
COMMAND install_name_tool -change "${COREDECK_INTL_INSTALL_NAME}" "@rpath/libintl.8.dylib" "$<TARGET_FILE:${PROJECT_NAME}>"
COMMAND codesign --force --sign - "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks/libintl.8.dylib"
VERBATIM
)
endif()

if(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND codesign --force --sign - "$<TARGET_BUNDLE_CONTENT_DIR:${PROJECT_NAME}>/Frameworks/$<TARGET_FILE_NAME:imgui>"
COMMAND codesign --force --sign - "$<TARGET_FILE:${PROJECT_NAME}>"
VERBATIM
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The first build compiles the bundled dependencies, including sentry-native, Dear
| `coredeck_platform` | `src/platform` | platform | Processes, HTTP, archives, hashing, logging, translation, paths, and generic helpers split by what they hold: `strings`, `files`, `secrets`, `desktop` |
| `coredeck_core` | `src/core` | platform, core | Android logic, grouped by domain: `sdk/`, `avd/`, `adb/`, `apk/` |
| `coredeck_app` | `src/app` | platform, app | Settings, app paths, crash reporting, update checks, and file dialogs |
| `coredeck_gui` | `src/gui` | all of the above | Everything that draws. Dear ImGui is its own `imgui` target |
| `coredeck_gui` | `src/gui` | all of the above | Everything that draws. Dear ImGui is the shared `imgui` library linked by the executable |

Core and App do not include each other. The executable is `src/main.cpp` and links only `coredeck_gui`. A call names the layer: `Platform::JoinPaths`, `Core::SignApk`, `App::LoadAppSettings`.

Expand Down
2 changes: 1 addition & 1 deletion src/app/app_paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace CoreDeck::App {
}

std::string ResolveAssetsDirectory(const std::string &resourcesDir) {
const std::string beside = Platform::JoinPaths({resourcesDir, "assets"});
std::string beside = Platform::JoinPaths({resourcesDir, "assets"});
#ifdef __linux__
std::error_code error;
if (!resourcesDir.empty() && !std::filesystem::is_directory(beside, error)) {
Expand Down
8 changes: 8 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ add_library(coredeck_gui STATIC
)

target_precompile_headers(coredeck_gui PRIVATE ${CMAKE_SOURCE_DIR}/src/pch.h)
target_sources(coredeck_gui PRIVATE
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
)
if(WIN32)
target_compile_definitions(coredeck_gui PRIVATE "IMGUI_IMPL_API=")
endif()
target_link_libraries(coredeck_gui PUBLIC coredeck_app coredeck_core imgui)
target_link_libraries(coredeck_gui PRIVATE glfw OpenGL::GL)

if(WIN32)
target_link_libraries(coredeck_gui PRIVATE dwmapi)
Expand Down
4 changes: 2 additions & 2 deletions src/gui/shell/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace CoreDeck::Gui {
self->m_FontPixelScale = xscale;
ImGui::GetStyle().FontScaleDpi = 1.0F;

ImGuiIO &io = ImGui::GetIO();
const ImGuiIO &io = ImGui::GetIO();
io.Fonts->Clear();
self->m_LoadFonts();
io.Fonts->Build();
Expand Down Expand Up @@ -624,7 +624,7 @@ namespace CoreDeck::Gui {
SetThemePreference(preference);
}

void ApplyWindowChrome(GLFWwindow *window) {
void ApplyWindowChrome(GLFWwindow *window) { // NOLINT(misc-const-correctness) Windows and macOS pass this pointer to GLFW.
if (window == nullptr) {
return;
}
Expand Down
12 changes: 7 additions & 5 deletions src/gui/theme/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#endif

#if !defined(_WIN32) && !defined(__APPLE__)
#include <fstream>

#include "platform/env.h"
#include "platform/strings.h"
#endif
Expand Down Expand Up @@ -222,11 +224,11 @@ namespace CoreDeck::Gui {
#else
std::string TrimCopy(const std::string &text) {
std::size_t begin = 0;
while (begin < text.size() && std::isspace(static_cast<unsigned char>(text[begin]))) {
while (begin < text.size() && std::isspace(static_cast<unsigned char>(text.at(begin)))) {
++begin;
}
std::size_t end = text.size();
while (end > begin && std::isspace(static_cast<unsigned char>(text[end - 1]))) {
while (end > begin && std::isspace(static_cast<unsigned char>(text.at(end - 1)))) {
--end;
}
return text.substr(begin, end - begin);
Expand All @@ -237,7 +239,7 @@ namespace CoreDeck::Gui {
}

bool ReadCommand(const char *command, std::string &output) {
FILE *pipe = popen(command, "r");
FILE *pipe = popen(command, "r"); // NOLINT(cert-env33-c, bugprone-command-processor)
if (pipe == nullptr) {
return false;
}
Expand All @@ -251,10 +253,10 @@ namespace CoreDeck::Gui {
}

std::string ConfigDirectory() {
if (const char *xdg = std::getenv(Platform::ENV_XDG_CONFIG_HOME); xdg != nullptr && xdg[0] != '\0') {
if (const char *xdg = std::getenv(Platform::ENV_XDG_CONFIG_HOME); xdg != nullptr && xdg[0] != '\0') { // NOLINT(concurrency-mt-unsafe)
return xdg;
}
if (const char *home = std::getenv(Platform::ENV_HOME); home != nullptr && home[0] != '\0') {
if (const char *home = std::getenv(Platform::ENV_HOME); home != nullptr && home[0] != '\0') { // NOLINT(concurrency-mt-unsafe)
return std::string(home) + "/.config";
}
return {};
Expand Down
4 changes: 4 additions & 0 deletions src/platform/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
#include <mach-o/dyld.h>
#include <sys/syslimits.h>
#elif __linux__
#include <climits>
#include <unistd.h>
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#endif

#include "platform/env.h"
Expand Down
2 changes: 1 addition & 1 deletion src/platform/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <chrono>
#include <thread>

extern char **environ; // NOLINT(readability-identifier-naming)
extern char **environ; // NOLINT(readability-identifier-naming, readability-redundant-declaration)
#endif

namespace CoreDeck::Platform {
Expand Down
Loading
Loading