Skip to content

Commit 1aec5d2

Browse files
authored
Merge pull request #7 from TwinFan/next
v4.1.2 isVisible, Parked
2 parents 85483b3 + 6d78216 commit 1aec5d2

File tree

130 files changed

+10523
-9064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+10523
-9064
lines changed

.github/actions/build-lin/action.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ outputs:
1919
xpl-file-name:
2020
description: Path to the resulting xpl file
2121
value: ${{ steps.return.outputs.xpl-file-name }}
22+
pdb-file-name:
23+
description: Path to the resulting .debug.zip file (debug symbol info)
24+
value: ${{ steps.return.outputs.pdb-file-name }}
2225

2326
runs:
2427
using: "composite"
@@ -53,9 +56,23 @@ runs:
5356
echo Expected target build not found: "$TARGET_XPL"
5457
exit 1
5558
fi
59+
- name: Extract symbol info
60+
shell: bash
61+
env:
62+
TARGET_XPL: ${{ inputs.baseDir }}build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
63+
TARGET_DBG: ${{ inputs.baseDir }}build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.debug
64+
TARGET_PDB: ${{ inputs.baseDir }}build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.debug.zip
65+
run: |
66+
objcopy --only-keep-debug "$TARGET_XPL" "$TARGET_DBG"
67+
strip --strip-debug --strip-unneeded "$TARGET_XPL"
68+
objcopy --add-gnu-debuglink="$TARGET_DBG" "$TARGET_XPL"
69+
zip -9 "$TARGET_PDB" "$TARGET_DBG"
5670
- name: Return Value
5771
id: return
5872
shell: bash
5973
env:
6074
TARGET_XPL: ${{ inputs.baseDir }}build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
61-
run: echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
75+
TARGET_PDB: ${{ inputs.baseDir }}build-lin/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.debug.zip
76+
run: |
77+
echo "xpl-file-name=$(echo $TARGET_XPL)" >> $GITHUB_OUTPUT
78+
echo "pdb-file-name=$(echo $TARGET_PDB)" >> $GITHUB_OUTPUT

.github/actions/build-mac/action.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ outputs:
1919
xpl-file-name:
2020
description: Path to the resulting xpl file
2121
value: ${{ steps.return.outputs.xpl-file-name }}
22+
pdb-file-name:
23+
description: Path to the resulting .dSYM.zip file (debug symbol info)
24+
value: ${{ steps.return.outputs.pdb-file-name }}
2225

2326
runs:
2427
using: "composite"
@@ -52,9 +55,23 @@ runs:
5255
echo Expected target build not found: "$TARGET_XPL"
5356
exit 1
5457
fi
58+
- name: Extract symbol info
59+
shell: bash
60+
env:
61+
TARGET_XPL: ${{ inputs.baseDir }}build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
62+
TARGET_DSYM: ${{ inputs.baseDir }}build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.dSYM
63+
TARGET_PDB: ${{ inputs.baseDir }}build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.dSYM.zip
64+
run: |
65+
dsymutil "$TARGET_XPL"
66+
zip -9r "$TARGET_PDB" "$TARGET_DSYM"
67+
rm -rf "$TARGET_DSYM"
68+
strip -S "$TARGET_XPL"
5569
- name: Return Value
5670
id: return
5771
shell: bash
5872
env:
5973
TARGET_XPL: ${{ inputs.baseDir }}build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl
60-
run: echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
74+
TARGET_PDB: ${{ inputs.baseDir }}build-mac/${{ inputs.archFolder }}/${{ inputs.pluginName }}.xpl.dSYM.zip
75+
run: |
76+
echo "xpl-file-name=$(echo $TARGET_XPL)" >> $GITHUB_OUTPUT
77+
echo "pdb-file-name=$(echo $TARGET_PDB)" >> $GITHUB_OUTPUT

.github/actions/build-win/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ runs:
4545
TARGET_XPL: ${{ inputs.baseDir }}build-win/${{ inputs.pluginName }}.xpl
4646
TARGET_PDB: ${{ inputs.baseDir }}build-win/${{ inputs.pluginName }}.pdb
4747
run: |
48-
echo "::set-output name=xpl-file-name::$(echo $TARGET_XPL)"
49-
echo "::set-output name=pdb-file-name::$(echo $TARGET_PDB)"
48+
echo "xpl-file-name=$(echo $TARGET_XPL)" >> $GITHUB_OUTPUT
49+
echo "pdb-file-name=$(echo $TARGET_PDB)" >> $GITHUB_OUTPUT

.github/actions/sign-notarize/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ It waits for Apple's answer to notarization, which can take a couple of minutes!
77

88
Parameter|Requied|Default|Description
99
---------|-------|-------|------------
10-
`bundleId`|yes||Plugin's bundle id, something like 'Author.plugin.NameOfPlugin
1110
`xplFileName`|yes||Path to just built xpl plugin
1211
`certificate`|yes||Base64 encoded .p12 certificate file
1312
`certPwd`|yes||Password of the .p12 certificate file
14-
`notarizeUser`|yes||Username/EMail for notarization
15-
`notarizeAppPwd`|yes||App-specific password for notarization
13+
`notarizeUser`|yes||Apple ID for notarization service (parameter `--apple-id` to `notarytool`)
14+
`notarizeTeam`|yes||Team ID for notarization service (parameter `--team-id` to `notarytool`)
15+
`notarizeAppPwd`|yes||[App-specific password](https://support.apple.com/en-gb/HT204397) for notarization service (parameter `--password` to `notarytool`)
1616

1717
## What it does
1818

.github/actions/sign-notarize/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ name: Sign/Notarize MacOS plugin
22
description: Signs, then notarizes the plugin
33
author: TwinFan
44

5-
inputs:
6-
bundleId:
7-
description: "Plugin's bundle id, something like 'Author.plugin.NameOfPlugin"
8-
required: true
5+
inputs:
96
xplFileName:
107
description: "Path to just built xpl plugin"
118
required: true
@@ -16,7 +13,10 @@ inputs:
1613
description: "Password of the .p12 certificate file"
1714
required: true
1815
notarizeUser:
19-
description: "Username/EMail for notarization"
16+
description: "Apple-ID for notarization"
17+
required: true
18+
notarizeTeam:
19+
description: "Team-ID for notarization"
2020
required: true
2121
notarizeAppPwd:
2222
description: "App-specific password for notarization"
@@ -30,4 +30,4 @@ runs:
3030
run: |
3131
echo ${{ inputs.certificate }} | base64 --decode > certificate.p12
3232
chmod a+x ${{ github.action_path }}/sign-notarize
33-
${{ github.action_path }}/sign-notarize "${{ inputs.xplFileName }}" "${{ inputs.bundleId }}" certificate.p12 "${{ inputs.certPwd }}" "${{ inputs.notarizeUser }}" "${{ inputs.notarizeAppPwd }}"
33+
${{ github.action_path }}/sign-notarize "${{ inputs.xplFileName }}" certificate.p12 "${{ inputs.certPwd }}" "${{ inputs.notarizeUser }}" "${{ inputs.notarizeTeam }}" "${{ inputs.notarizeAppPwd }}"

.github/actions/sign-notarize/sign-notarize

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#
44
# Parameters
55
# 1. Path to file to sign, then notarize
6-
# 2. Bundle id to use during notarization
7-
# 3. Signing ID file like 'certificate.p12'
8-
# 4. Password for above p12 file
9-
# 5. Username for notarization
10-
# 6. App-specific password for notarization
6+
# 2. Signing ID file like 'certificate.p12'
7+
# 3. Password for above p12 file
8+
# 4. Apple ID for notarization (parameter --apple-id to notarytool)
9+
# 5. Team ID for notarization (parmeter --team-id to notarytool)
10+
# 6. App-specific password for notarization (parameter --password to notarytool)
1111

1212
set -eu
1313

@@ -18,33 +18,6 @@ function cleanup {
1818
security delete-keychain build.keychain
1919
}
2020

21-
# --- Function to check for notarization results
22-
23-
check_notarization() {
24-
local REQUID=$1
25-
local USERNAME=$2
26-
local USERPWD=$3
27-
local STATUS="in progress"
28-
while [ "$STATUS" == "in progress" ]
29-
do
30-
echo "Wait 30s for results..."
31-
sleep 30
32-
STATUS=`xcrun altool --notarization-info "$REQUID" -u "$USERNAME" -p "$USERPWD" | egrep -o '(in progress|success|invalid)'`
33-
done
34-
35-
case $STATUS in
36-
success) echo ">>> SUCCESS <<<"
37-
return 0
38-
;;
39-
invalid) echo "%%% INVALID %%%"
40-
return 1
41-
;;
42-
*) echo "Unknown status $STATUS"
43-
return 1
44-
;;
45-
esac
46-
}
47-
4821
# ==================================================================
4922
# Read parameters
5023

@@ -55,10 +28,10 @@ then
5528
fi
5629

5730
PATH_TO_FILE=$1
58-
BUNDLE_ID=$2
59-
SIGN_ID_FILE=$3
60-
SIGN_ID_PWD=$4
61-
NOTAR_USER=$5
31+
SIGN_ID_FILE=$2
32+
SIGN_ID_PWD=$3
33+
NOTAR_USER=$4
34+
NOTAR_TEAM=$5
6235
NOTAR_PWD=$6
6336

6437
# --- Sign
@@ -91,17 +64,9 @@ echo .
9164

9265
# Can only send zip archives to notarization
9366
zip -v "$PATH_TO_FILE.zip" "$PATH_TO_FILE"
94-
REQUID=`xcrun altool --notarize-app --primary-bundle-id "$BUNDLE_ID" --username "$NOTAR_USER" --password "$NOTAR_PWD" --file "$PATH_TO_FILE.zip" | egrep -o '([a-z0-9]+-){4}[a-z0-9]+'`
67+
xcrun notarytool submit --wait --apple-id "$NOTAR_USER" --password "$NOTAR_PWD" --team-id "$NOTAR_TEAM" "$PATH_TO_FILE.zip"
9568
rm "$PATH_TO_FILE.zip"
9669

97-
# --- Check notarization results ---
98-
99-
echo .
100-
echo "--- Check notarization results ---"
101-
echo .
102-
103-
check_notarization "$REQUID" "$NOTAR_USER" "$NOTAR_PWD"
104-
10570
# Note: No stapling possible to .xpl files
10671

10772
echo .

.github/actions/upload-plugin/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ runs:
2828
mv "${{ inputs.pdbFileName }}" "deploy-${{ inputs.pluginName }}/${{ inputs.pluginName }}/${{ inputs.archFolder }}"
2929
fi
3030
- name: Upload plugin
31-
uses: actions/upload-artifact@v2
31+
uses: actions/upload-artifact@v4
3232
with:
33-
name: ${{ inputs.pluginName }}
33+
name: ${{ inputs.pluginName }}-${{ env.platform }}
3434
path: deploy-${{ inputs.pluginName }}/* # this way the top folder in the artifacts is "MyPlugin"
3535
if-no-files-found: error

.github/workflows/build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ on:
1010
env:
1111
PRJ_BASE: Example/ # The base directory from which we build everything
1212
PRJ_NAME: LTAPIExample # The plugin's name, expected to be the .xpl file's name and used as the plugin folder name
13-
PRJ_BUNDLEID: TwinFan.plugin.LTAPIExample
1413

1514
jobs:
1615
#####################################
1716
# Linux with GCC
1817
build-lin:
19-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-20.04
19+
env:
20+
platform: lin
2021
steps:
2122
- name: Checkout Code
22-
uses: actions/checkout@v2 # must checkout before we can use our own actions
23+
uses: actions/checkout@v4 # must checkout before we can use our own actions
2324
- name: Build
2425
uses: ./.github/actions/build-lin
2526
id: build
@@ -32,14 +33,17 @@ jobs:
3233
pluginName: ${{ env.PRJ_NAME }}
3334
archFolder: lin_x64
3435
xplFileName: "${{ steps.build.outputs.xpl-file-name }}"
36+
pdbFileName: "${{ steps.build.outputs.pdb-file-name }}"
3537

3638
#####################################
3739
# MacOS with CMake/clang and sign/notarize in self-written script
3840
build-mac:
39-
runs-on: macos-latest
41+
runs-on: macos-14
42+
env:
43+
platform: mac
4044
steps:
4145
- name: Checkout Code
42-
uses: actions/checkout@v2 # must checkout before we can use our own actions
46+
uses: actions/checkout@v4 # must checkout before we can use our own actions
4347
- name: Build
4448
uses: ./.github/actions/build-mac
4549
id: build
@@ -53,34 +57,35 @@ jobs:
5357
shell: bash
5458
run: |
5559
if [ "$MACOS_CERTIFICATE" == "" ]; then
56-
echo ::set-output name=secretspresent::
60+
echo "secretspresent=" >> $GITHUB_OUTPUT
5761
else
58-
echo ::set-output name=secretspresent::true
62+
echo "secretspresent=true" >> $GITHUB_OUTPUT
5963
fi
6064
- name: Codesign and Notarization
6165
if: ${{ steps.checksecrets.outputs.secretspresent }}
6266
uses: ./.github/actions/sign-notarize
6367
with:
64-
bundleId: ${{ env.PRJ_BUNDLEID }}
6568
xplFileName: ${{ steps.build.outputs.xpl-file-name }}
6669
certificate: ${{ secrets.MACOS_CERTIFICATE }}
6770
certPwd: ${{ secrets.MACOS_CERT_PWD }}
6871
notarizeUser: ${{ secrets.NOTARIZATION_USERNAME }}
72+
notarizeTeam: ${{ secrets.NOTARIZATION_TEAM }}
6973
notarizeAppPwd: ${{ secrets.NOTARIZATION_PASSWORD }}
7074
- name: Upload
7175
uses: ./.github/actions/upload-plugin
7276
with:
7377
pluginName: ${{ env.PRJ_NAME }}
7478
archFolder: mac_x64
7579
xplFileName: ${{ steps.build.outputs.xpl-file-name }}
80+
pdbFileName: "${{ steps.build.outputs.pdb-file-name }}"
7681

7782
#####################################
7883
# Windows with MS Visual Studio
7984
build-win:
8085
runs-on: windows-2022
8186
steps:
8287
- name: Checkout Code
83-
uses: actions/checkout@v2 # must checkout before we can use our own actions
88+
uses: actions/checkout@v4 # must checkout before we can use our own actions
8489
- name: Build
8590
uses: ./.github/actions/build-win
8691
id: build

Example/CMakeLists.txt

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
# LT_API build script.
22
#
33

4-
cmake_minimum_required(VERSION 3.9)
5-
project(LT_API VERSION 1.0.0 DESCRIPTION "LiveTraffic API Example Plugin")
4+
cmake_minimum_required(VERSION 3.16)
5+
6+
# Mac: Need to tell early on that we want a cross platform build
7+
if(DEFINED ENV{platform})
8+
message ("-- Platform is $ENV{platform}")
9+
if($ENV{platform} STREQUAL "mac-x86")
10+
message (" Building cross-platform for mac/x86_64")
11+
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Archs to build")
12+
elseif($ENV{platform} STREQUAL "mac-arm")
13+
message (" Building cross-platform for mac/arm64")
14+
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Archs to build")
15+
elseif($ENV{platform} STREQUAL "mac")
16+
message (" Building cross-platform for both mac/x86_64 and mac/arm64")
17+
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Archs to build")
18+
endif()
19+
else()
20+
# No 'platform' defined could mean running from command line, assume we build universal image in one go via XCode
21+
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Archs to build")
22+
endif()
623

7-
# By default, use optimized release configuration.
8-
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
9-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
10-
endif ()
24+
set(CMAKE_BUILD_TYPE RelWithDebInfo)
1125

12-
set(CMAKE_CXX_STANDARD 11)
26+
project(LT_API VERSION 1.3.0 DESCRIPTION "LiveTraffic API Example Plugin")
27+
28+
set(CMAKE_CXX_STANDARD 17)
29+
set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED 17)
30+
set_property(GLOBAL PROPERTY CXX_STANDARD 17)
1331

1432
# Set include directories used by our code and dependencies.
1533
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
@@ -68,13 +86,9 @@ else()
6886
if(MSVC)
6987
# Use highest optimization level in Release builds
7088
add_compile_options(/GL)
71-
elseif(APPLE)
72-
add_compile_options(-O3 -fPIC)
73-
elseif (UNIX OR MINGW)
74-
# Use position-independent code and highest optimization level (FPS!).
89+
else()
90+
# Use position-independent code and highest optimization level
7591
add_compile_options(-O3 -fPIC)
76-
# Strip symbols during linking
77-
add_link_options(-s)
7892
endif()
7993
endif()
8094

0 commit comments

Comments
 (0)