mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
Add macOS simulator build to pipelines (#162)
- GitHub actions changed to build simulator on macOS (it's broken, but at least we get a good code portability check for now!) - `Buildscripts/` shell scripts updated to use `/bin/sh` so it works on macOS too - Various includes fixed in various subprojects so the code is more portable
This commit is contained in:
parent
431fa84ffb
commit
5d189fe5a3
6
.github/actions/build-simulator/action.yml
vendored
6
.github/actions/build-simulator/action.yml
vendored
@ -7,6 +7,9 @@ inputs:
|
|||||||
platform_name:
|
platform_name:
|
||||||
description: A descriptive name for the target platform (e.g. amd64, aarch64, etc.)
|
description: A descriptive name for the target platform (e.g. amd64, aarch64, etc.)
|
||||||
required: true
|
required: true
|
||||||
|
publish:
|
||||||
|
description: A boolean that enables publishing of artifacts
|
||||||
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@ -16,7 +19,7 @@ runs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install Linux Dependencies for SDL
|
- name: Install Linux Dependencies for SDL
|
||||||
if: ${{ inputs.platform_name }} == 'linux'
|
if: ${{ runner.os == 'Linux' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# See Libraries/SDL/docs/README-linux.md
|
# See Libraries/SDL/docs/README-linux.md
|
||||||
run: >
|
run: >
|
||||||
@ -45,6 +48,7 @@ runs:
|
|||||||
run: Buildscripts/release-simulator.sh buildsim release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
run: Buildscripts/release-simulator.sh buildsim release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
if: ${{ inputs.publish == 'true' }}
|
||||||
with:
|
with:
|
||||||
name: Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
name: Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
||||||
path: release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
path: release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
||||||
|
|||||||
14
.github/workflows/build-simulator.yml
vendored
14
.github/workflows/build-simulator.yml
vendored
@ -2,7 +2,7 @@
|
|||||||
name: Build Simulator
|
name: Build Simulator
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
Build-Simulator:
|
Build-Simulator-Linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -11,3 +11,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
os_name: linux
|
os_name: linux
|
||||||
platform_name: amd64
|
platform_name: amd64
|
||||||
|
publish: true
|
||||||
|
Build-Simulator-macOS:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: "Build"
|
||||||
|
uses: ./.github/actions/build-simulator
|
||||||
|
with:
|
||||||
|
os_name: macos
|
||||||
|
platform_name: aarch64
|
||||||
|
# macOS simulator currently fails due to main thread requirement for rendering
|
||||||
|
publish: false
|
||||||
|
|||||||
@ -11,15 +11,15 @@ class SimulatorPower : public Power {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SimulatorPower() {}
|
SimulatorPower() = default;
|
||||||
~SimulatorPower() {}
|
~SimulatorPower() override = default;
|
||||||
|
|
||||||
bool supportsMetric(MetricType type) const override;
|
bool supportsMetric(MetricType type) const override;
|
||||||
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
||||||
|
|
||||||
bool supportsChargeControl() const { return true; }
|
bool supportsChargeControl() const override { return true; }
|
||||||
bool isAllowedToCharge() const { return allowedToCharge; }
|
bool isAllowedToCharge() const override { return allowedToCharge; }
|
||||||
void setAllowedToCharge(bool canCharge) { allowedToCharge = canCharge; }
|
void setAllowedToCharge(bool canCharge) override { allowedToCharge = canCharge; }
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<Power> simulatorPower();
|
std::shared_ptr<Power> simulatorPower();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
# flash.sh [port]
|
# flash.sh [port]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
function build() {
|
function build() {
|
||||||
Buildscripts/build.sh $1
|
Buildscripts/build.sh $1
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Usage: build.sh [boardname]
|
# Usage: build.sh [boardname]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Description: Releases the current build files as an SDK in release/TactilitySDK
|
# Description: Releases the current build files as an SDK in release/TactilitySDK
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Usage: release-sdk.sh [target_path]
|
# Usage: release-sdk.sh [target_path]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Usage: release-simulator.sh [builddir] [target_path]
|
# Usage: release-simulator.sh [builddir] [target_path]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Usage: release.sh [boardname]
|
# Usage: release.sh [boardname]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
cmake -S ./ -B build-sim
|
cmake -S ./ -B build-sim
|
||||||
cmake --build build-sim --target build-tests -j 14
|
cmake --build build-sim --target build-tests -j 14
|
||||||
|
|||||||
@ -70,7 +70,6 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
||||||
|
|
||||||
# FreeRTOS
|
# FreeRTOS
|
||||||
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Boards/Simulator/Source CACHE STRING "")
|
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Boards/Simulator/Source CACHE STRING "")
|
||||||
set(FREERTOS_PORT GCC_POSIX CACHE STRING "")
|
set(FREERTOS_PORT GCC_POSIX CACHE STRING "")
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#include "FileUtils.h"
|
#include "FileUtils.h"
|
||||||
#include "TactilityCore.h"
|
#include "TactilityCore.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <bits/stdc++.h>
|
|
||||||
#include <StringUtils.h>
|
#include <StringUtils.h>
|
||||||
|
|
||||||
namespace tt::app::files {
|
namespace tt::app::files {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#include <cstring>
|
|
||||||
#include "app/alertdialog/AlertDialog.h"
|
#include "app/alertdialog/AlertDialog.h"
|
||||||
#include "app/imageviewer/ImageViewer.h"
|
#include "app/imageviewer/ImageViewer.h"
|
||||||
#include "app/inputdialog/InputDialog.h"
|
#include "app/inputdialog/InputDialog.h"
|
||||||
@ -11,7 +10,8 @@
|
|||||||
#include "Tactility.h"
|
#include "Tactility.h"
|
||||||
#include "View.h"
|
#include "View.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include <filesystem>
|
#include <cstring>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#define TAG "files_app"
|
#define TAG "files_app"
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace tt::app::i2cscanner {
|
namespace tt::app::i2cscanner {
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include "hal/Touch.h"
|
#include "hal/Touch.h"
|
||||||
#include "hal/Keyboard.h"
|
#include "hal/Keyboard.h"
|
||||||
#include "lvgl/LvglKeypad.h"
|
#include "lvgl/LvglKeypad.h"
|
||||||
#include "lvgl/Lvgl.h"
|
#include "lvgl/LvglDisplay.h"
|
||||||
#include "kernel/SystemEvents.h"
|
#include "kernel/SystemEvents.h"
|
||||||
|
|
||||||
namespace tt::lvgl {
|
namespace tt::lvgl {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "lvgl/Lvgl.h"
|
#include "lvgl/LvglDisplay.h"
|
||||||
#include "Check.h"
|
#include "Check.h"
|
||||||
|
|
||||||
namespace tt::lvgl {
|
namespace tt::lvgl {
|
||||||
@ -1,5 +1,6 @@
|
|||||||
#include "Mutex.h"
|
#include "Mutex.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace tt {
|
namespace tt {
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <bits/stdc++.h>
|
#include <algorithm>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user