diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b864668 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: Electron project build plan +#author: Clovis Durand +#description: GitHub action to buid the OSCO-OD-Gen project + +on: [push] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # TODO : Make this work for Windows + # os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + package_manager: [npm] + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Checkout submodules + run: | + git submodule sync --recursive + git submodule update --init --recursive + + - name: Setup NodeJS, NPM & Yarn + uses: actions/setup-node@master + with: + node-version: 13 + + - name: Install Node dependencies + run: | + npm install + + - name: Installing dependencies (macOS) + if: matrix.os == 'macOS-latest' + run: | + set -x + brew update + brew install doxygen graphviz coreutils pkg-config + ln -s /usr/local/bin/greadlink /usr/local/bin/readlink + + - name: Build C generator dependencies + if: matrix.os != 'windows-latest' + run: | + npm run build-gen + + - name: Build C generator dependencies (Windows) + if: matrix.os == 'windows-latest' + run: | + mkdir build + cd build + cmake ../generator -DCMAKE_C_FLAGS=/w34716 -DCMAKE_CXX_FLAGS=/w34716 + cmake --build . + + - name: Test Node project + run: | + npm test diff --git a/README.md b/README.md index bb6829c..41ae56a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # OSCO-OD-Gen - CANOpen Object Dictionary Generator for [OSCO](https://github.com/Clovel/OSCO) +![Electron project build plan](https://github.com/Clovel/OSCO-OD-Gen/workflows/Electron%20project%20build%20plan/badge.svg?branch=master) + This project's is a cross-platform and modern code generator for the CANOpen Object Dictionary of the [OSCO](https://github.com/Clovel/OSCO) stack. ## Program goals diff --git a/generator/docs/Doxyfile.in b/generator/docs/Doxyfile.in index 49a925a..ce037bd 100644 --- a/generator/docs/Doxyfile.in +++ b/generator/docs/Doxyfile.in @@ -768,6 +768,7 @@ WARN_LOGFILE = INPUT = @doxy_main_page@ \ @CMAKE_CURRENT_SOURCE_DIR@/../src \ + @CMAKE_CURRENT_SOURCE_DIR@/../inc \ USE_MDFILE_AS_MAINPAGE = @doxy_main_page@ diff --git a/generator/inc/APIExports.h b/generator/inc/APIExports.h new file mode 100644 index 0000000..31e2d4b --- /dev/null +++ b/generator/inc/APIExports.h @@ -0,0 +1,14 @@ +#ifndef API_EXPORTS_H +#define API_EXPORTS_H + +#ifdef _WIN32 + #ifdef osco_od_gen_EXPORTS + #define API_EXPORT __declspec(dllexport) + #else + #define API_EXPORT __declspec(dllimport) + #endif +#else + #define API_EXPORT +#endif + +#endif /* API_EXPORTS_H */ \ No newline at end of file diff --git a/generator/src/EDS.hpp b/generator/inc/EDS.hpp similarity index 95% rename from generator/src/EDS.hpp rename to generator/inc/EDS.hpp index 6b455ec..e4604a5 100644 --- a/generator/src/EDS.hpp +++ b/generator/inc/EDS.hpp @@ -10,6 +10,8 @@ /* Includes -------------------------------------------- */ #include "INI.hpp" +#include "APIExports.h" + /* Defines --------------------------------------------- */ /* Type definitions ------------------------------------ */ @@ -17,7 +19,7 @@ /* Forward declarations -------------------------------- */ /* EDS class ------------------------------------------- */ -class EDS : public INI { +class API_EXPORT EDS : public INI { public: EDS(const std::string &pFile); diff --git a/package.json b/package.json index 91543ed..f4c0325 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Object Dictionary code generator for the OSCO stack", "main": "gui/main.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "echo \"Error: no test specified\" && exit 0", "build-gen": "./buildCGen.sh", "start": "electron ." },