Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Nov 8, 2022
2 parents 67e02b8 + 4edfd60 commit a1e2e78
Show file tree
Hide file tree
Showing 310 changed files with 15,789 additions and 11,657 deletions.
8 changes: 4 additions & 4 deletions .github/actions/build-lin/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# build-lin

This is a custom GitHub action to build an X-Plane plugin on Linux based on a prepared CMake setup.
This is a custom GitHub action to build a library on Linux based on a prepared CMake setup.

## Parameters

Parameter|Requied|Default|Description
---------|-------|-------|------------
`pluginName`|yes||Plugin's name, used both as top-level folder name and as file name as required by X-Plane
`archFolder`|yes|`lin_x64`|Subfolder in which the executable is placed, is based on architecture like 'lin_x64'
`libName`|yes | |Library's name, used as file name
`flags` |no | |Flags to be passed to CMake

## What it does

Expand All @@ -19,4 +19,4 @@ Parameter|Requied|Default|Description

Output|Description
------|-----------
`xpl-file-name`|path to the produced xpl file
`lib-file-name`|path to the produced library
33 changes: 16 additions & 17 deletions .github/actions/build-lin/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Build Linux / CMake
description: Build on Linux based on a CMake setup
description: Build library on Linux based on a CMake setup
author: TwinFan

inputs:
pluginName:
description: "Plugin's name, used both as top-level folder name and as file name as required by X-Plane"
libName:
description: "Library's name, used as file name"
required: true
archFolder:
description: "Subfolder in which the executable is placed, is based on architecture like 'lin_x64'"
required: true
default: lin_x64
flags:
description: "Flags to be passed to CMake"
required: false

outputs:
xpl-file-name:
description: Path to the resulting xpl file
value: ${{ steps.return.outputs.xpl-file-name }}
lib-file-name:
description: Path to the resulting lib file
value: ${{ steps.return.outputs.lib-file-name }}

runs:
using: "composite"
Expand All @@ -33,25 +32,25 @@ runs:
run: |
cd build-lin
pwd
cmake -G Ninja ..
cmake -G Ninja ${{ inputs.flags }} ..
- name: Build
shell: bash
run: |
cd build-lin
pwd
ninja XPMP2 XPMP2-Sample XPMP2-Remote
ninja
- name: Test for Target
shell: bash
env:
TARGET_XPL: build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
TARGET_LIB: build-lin/lib${{ inputs.libName }}.a
run: |
if [[ ! -f "$TARGET_XPL" ]]; then
echo Expected target build not found: "$TARGET_XPL"
if [[ ! -f "$TARGET_LIB" ]]; then
echo Expected target build not found: "$TARGET_LIB"
exit 1
fi
- name: Return Value
id: return
shell: bash
env:
TARGET_XPL: build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
run: echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
TARGET_LIB: build-lin/lib${{ inputs.libName }}.a
run: echo "lib-file-name=$(echo $TARGET_LIB)" >> $GITHUB_OUTPUT
9 changes: 5 additions & 4 deletions .github/actions/build-mac/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# build-mac

This is a custom GitHub action to build an X-Plane plugin on and for MacOS based on a prepared CMake setup.
This is a custom GitHub action to build a framwork for MacOS based on a prepared CMake setup.

## Inputs

Parameter|Requied|Default|Description
---------|-------|-------|------------
`pluginName`|yes||Plugin's name, used both as top-level folder name and as file name as required by X-Plane
`archFolder`|yes|`mac_x64`|Subfolder in which the executable is placed, is based on architecture like 'mac_x64'
`libName`|yes | |Library's name, used as file name
`flags` |no | |Flags to be passed to CMake

## What it does

- Installs Ninja
- Creates build folder `build-mac`
- There, runs `cmake`, then `ninja` to build
- Zips the framework, including the `-y` parameter to preserve symlinks

## Outputs

Output|Description
------|-----------
`xpl-file-name`|path to the produced xpl file
`lib-file-name`|path to the produced zip archive of the framework
35 changes: 18 additions & 17 deletions .github/actions/build-mac/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ description: Build a MacOS plugin based on a CMake setup
author: TwinFan

inputs:
pluginName:
description: "Plugin's name, used both as top-level folder name and as file name as required by X-Plane"
libName:
description: "Library's name, used both as top-level folder name and as file name as required by X-Plane"
required: true
archFolder:
description: "Subfolder in which the executable is placed, is based on architecture like 'mac_x64'"
required: true
default: mac_x64
flags:
description: "Flags to be passed to CMake"
required: false

outputs:
xpl-file-name:
description: Path to the resulting xpl file
value: ${{ steps.return.outputs.xpl-file-name }}
lib-file-name:
description: Path to the resulting lib file
value: ${{ steps.return.outputs.lib-file-name }}

runs:
using: "composite"
Expand All @@ -32,25 +31,27 @@ runs:
run: |
cd build-mac
pwd
cmake -G Ninja ..
cmake -G Ninja ${{ inputs.flags }} ..
- name: Build
shell: bash
run: |
cd build-mac
pwd
ninja XPMP2 XPMP2-Sample XPMP2-Remote
- name: Test for Target
ninja
- name: Test for and Zip Framework
shell: bash
env:
TARGET_XPL: build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
TARGET_LIB: build-mac/${{ inputs.libName }}.framework
run: |
if [[ ! -f "$TARGET_XPL" ]]; then
echo Expected target build not found: "$TARGET_XPL"
if [[ ! -d "$TARGET_LIB" ]]; then
echo Expected target build not found: "$TARGET_LIB"
exit 1
fi
cd build-mac
zip -9ry ${{ inputs.libName }}.framework.zip ${{ inputs.libName }}.framework
- name: Return Value
id: return
shell: bash
env:
TARGET_XPL: build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
run: echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
TARGET_ZIP: build-mac/${{ inputs.libName }}.framework.zip
run: echo "lib-file-name=$(echo $TARGET_ZIP)" >> $GITHUB_OUTPUT
16 changes: 8 additions & 8 deletions .github/actions/build-win/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# build-mac
# build-win

This is a custom GitHub action to build an X-Plane plugin on and for MacOS based on a prepared CMake setup.
This is a custom GitHub action to build a library on and for Windows based on a prepared CMake setup.

## Inputs

Parameter|Requied|Default|Description
---------|-------|-------|------------
`pluginName`|yes||Plugin's name, used both as top-level folder name and as file name as required by X-Plane
`archFolder`|yes|`mac_x64`|Subfolder in which the executable is placed, is based on architecture like 'mac_x64'
`libName`|yes | |Library's name, used as file name
`flags` |no | |Flags to be passed to CMake

## What it does

- Installs Ninja
- Creates build folder `build-mac`
- There, runs `cmake`, then `ninja` to build
- Runs a separate command file, `build-win.cmd`, which in tun
- Creates build folder `build-win`
- There, runs `CMAKE`, then `NMAKE` to build

## Outputs

Output|Description
------|-----------
`xpl-file-name`|path to the produced xpl file
`lib-file-name`|path to the produced lib file
37 changes: 15 additions & 22 deletions .github/actions/build-win/action.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
name: Build Windows / MSVC / CMake
description: Build a Windows plugin with MS Visual Studio based on a CMake setup
description: Build a Windows library with MS Visual Studio based on a CMake setup
author: TwinFan

inputs:
pluginName:
description: "Plugin's name, used both as top-level folder name and as file name as required by X-Plane"
libName:
description: "Library's name, used as file name"
required: true
archFolder:
description: "Subfolder in which the executable is placed, is based on architecture like 'win_x64'"
required: true
default: win_x64
flags:
description: "Flags to be passed to CMake"
required: false

outputs:
xpl-file-name:
description: Path to the resulting xpl file
value: ${{ steps.return.outputs.xpl-file-name }}
pdb-file-name:
description: Path to the resulting pdb file (debug symbol info)
value: ${{ steps.return.outputs.pdb-file-name }}
lib-file-name:
description: Path to the resulting lib
value: ${{ steps.return.outputs.lib-file-name }}

runs:
using: "composite"
steps:
- name: Build
shell: cmd
run: ${{ github.action_path }}\build-win.cmd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" build-win
run: ${{ github.action_path }}\build-win.cmd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" build-win "${{ inputs.flags }}"
- name: Test for Target
shell: bash
env:
TARGET_XPL: build-win/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
TARGET_LIB: build-win/${{ inputs.libName }}.lib
run: |
if [[ ! -f "$TARGET_XPL" ]]; then
echo Expected target build not found: "$TARGET_XPL"
if [[ ! -f "$TARGET_LIB" ]]; then
echo Expected target build not found: "$TARGET_LIB"
exit 1
fi
- name: Return Value
id: return
shell: bash
env:
TARGET_XPL: build-win/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
TARGET_PDB: build-win/${{ inputs.archFolder }}/${{ inputs.pluginName }}.pdb
run: |
echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
echo "::set-output name=pdb-file-name::$(echo $TARGET_PDB)"
TARGET_LIB: build-win/${{ inputs.libName }}.lib
run: echo "lib-file-name=$(echo $TARGET_LIB)" >> $GITHUB_OUTPUT
5 changes: 3 additions & 2 deletions .github/actions/build-win/build-win.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@ECHO OFF

REM We expect 2 parameters
REM Additional parameters are passed through to CMake
IF "%~1"=="" GOTO :PRINT_HELP
IF "%~2"=="" GOTO :PRINT_HELP

Expand All @@ -20,11 +21,11 @@ PUSHD "%MY_BUILD_DIR%"
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

REM Create Makefile from CMakeLists.txt, using NMake output beacause NMake happens to be available
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DCMAKE_MAKE_PROGRAM="nmake.exe" -DCMAKE_TOOLCHAIN_FILE="..\docker\Toolchain-msvc-x86-64.cmake" ..
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" -DCMAKE_MAKE_PROGRAM="nmake.exe" -DCMAKE_TOOLCHAIN_FILE="..\docker\Toolchain-msvc-x86-64.cmake" %~3 %~4 %~5 ..
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

REM Perform the actual build
NMAKE /A XPMP2 XPMP2-Sample XPMP2-Remote
NMAKE /A
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Windows Build: SUCCESS!
Expand Down
23 changes: 0 additions & 23 deletions .github/actions/sign-notarize/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions .github/actions/sign-notarize/action.yml

This file was deleted.

Loading

0 comments on commit a1e2e78

Please sign in to comment.