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
64 changes: 64 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
Language: Cpp
# BasedOnStyle: JUCE (Custom)
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList : BeforeColon
BreakStringLiterals: false
ColumnLimit: 0
# ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
PackConstructorInitializers: CurrentLine
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: NonEmptyParentheses
SpaceInEmptyParentheses: false
SpaceBeforeInheritanceColon: true
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: "c++17"
TabWidth: 4
UseTab: Never
---

17 changes: 12 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: linux

on:
push:
branches: [main]
branches: [main,juce8,testing-juce8]
pull_request:

env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
build_dir: "Build"
package: EphysSocket-linux

Expand All @@ -20,7 +20,14 @@ jobs:

- name: set env vars
run: |
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
if [ ${{github.ref_name}} == 'juce8' ]; then
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
else
echo "Invalid branch : ${{github.ref_name}}"
exit 1
fi

- name: setup
run: |
Expand All @@ -38,7 +45,7 @@ jobs:
make

- name: deploy
if: github.ref == 'refs/heads/juce8' && steps.build.outcome == 'success'
if: github.ref == 'refs/heads/testing-juce8' && steps.build.outcome == 'success'
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
Expand All @@ -47,4 +54,4 @@ jobs:
cp -r $build_dir/*.so plugins
zipfile=${package}_${new_plugin_ver}.zip
zip -r -X $zipfile plugins
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/linux/$zipfile"
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/linux/$zipfile"
73 changes: 67 additions & 6 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: mac

on:
push:
branches: [main]
branches: [main,juce8,testing-juce8]
pull_request:

env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
build_dir: "Build/Release"
package: EphysSocket-mac

Expand All @@ -20,7 +20,14 @@ jobs:

- name: set env vars
run: |
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
if [ ${{github.ref_name}} == 'juce8' ]; then
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
else
echo "Invalid branch : ${{github.ref_name}}"
exit 1
fi

- name: setup
run: |
Expand All @@ -36,13 +43,67 @@ jobs:
xcodebuild -configuration Release

- name: deploy
if: github.ref == 'refs/heads/juce8' && steps.build.outcome == 'success'
if: github.ref == 'refs/heads/testing-juce8' && steps.build.outcome == 'success'
env:
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
MACOS_CERTIFICATE_PWD: ${{ secrets.BUILD_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.BUILD_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]" | tail -1)
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
new_plugin_ver=$tag-API$plugin_api

mkdir plugins
cp -r $build_dir/*.bundle plugins

# Turn our base64-encoded certificate back to a regular .p12 file
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12

# We need to create a new keychain, otherwise using the certificate will prompt
# with a UI dialog asking for the certificate password, which we can't
# use in a headless CI environment
security create-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v plugins/ephys-socket.bundle --deep --strict --timestamp --options=runtime

/usr/bin/codesign -dv --verbose=4 plugins/ephys-socket.bundle

# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI

echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"

# We can't notarize an app bundle directly, but we need to compress it as an archive.
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service

echo "Creating temp notarization archive"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent plugins/ephys-socket.bundle ephys-socket.zip

# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious

echo "Notarize app"
xcrun notarytool submit "ephys-socket.zip" --keychain-profile "notarytool-profile" --wait

# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
rm -r plugins/*
/usr/bin/ditto -x -k ephys-socket.zip plugins
xcrun stapler staple plugins/ephys-socket.bundle

spctl -vvv --assess --type exec plugins/ephys-socket.bundle

zipfile=${package}_${new_plugin_ver}.zip
zip -r -X $zipfile plugins
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/mac/$zipfile"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent plugins $zipfile
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/mac/$zipfile"
22 changes: 15 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Windows

on:
push:
branches: [main]
branches: [main,juce8,testing-juce8]
pull_request:

env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
build_dir: "Build/Release"
package: EphysSocket-windows

Expand All @@ -20,8 +20,16 @@ jobs:

- name: set env vars
run: |
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
echo "GUI_LIB_VERSION=v1.0.0-dev" >> "$GITHUB_ENV"
if [ ${{github.ref_name}} == 'juce8' ]; then
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
echo "GUI_LIB_VERSION=v1.0.0-dev" >> "$GITHUB_ENV"
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
echo "GUI_LIB_VERSION=v1.0.0-alpha" >> "$GITHUB_ENV"
else
echo "Invalid branch : ${{github.ref_name}}"
exit 1
fi
shell: bash

- name: setup
Expand All @@ -31,7 +39,7 @@ jobs:
cd plugin-GUI/Build
cmake -G "Visual Studio 17 2022" -A x64 ..
mkdir Release && cd Release
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
unzip open-ephys-lib.zip
shell: bash

Expand All @@ -52,7 +60,7 @@ jobs:
shell: cmd

- name: deploy
if: github.ref == 'refs/heads/juce8' && steps.build.outcome == 'success'
if: github.ref == 'refs/heads/testing-juce8' && steps.build.outcome == 'success'
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
Expand All @@ -61,5 +69,5 @@ jobs:
cp $build_dir/*.dll plugins
zipfile=${package}_${new_plugin_ver}.zip
powershell Compress-Archive -Path "plugins" -DestinationPath ${zipfile}
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/windows/$zipfile"
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/EphysSocket-plugin/windows/$zipfile"
shell: bash
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()
get_filename_component(PROJECT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
get_filename_component(PLUGIN_NAME ${PROJECT_FOLDER} NAME)

set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architecture for Mac OS X" FORCE)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "Build architecture for Mac OS X" FORCE)

project(OE_PLUGIN_${PLUGIN_NAME})
set(CMAKE_SHARED_LIBRARY_PREFIX "")
Expand Down Expand Up @@ -70,17 +70,17 @@ if(MSVC)
elseif(LINUX)
target_link_libraries(${PLUGIN_NAME} GL X11 Xext Xinerama asound dl freetype pthread rt)
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS
"-fvisibility=hidden -fPIC -rdynamic -Wl,-rpath='$ORIGIN/../shared' -Wl,-rpath='$ORIGIN/../shared-api8'")
"-fvisibility=hidden -fPIC -rdynamic -Wl,-rpath='$ORIGIN/../shared' -Wl,-rpath='$ORIGIN/../shared-api9'")
target_compile_options(${PLUGIN_NAME} PRIVATE -fPIC -rdynamic)
target_compile_options(${PLUGIN_NAME} PRIVATE -O3) #enable optimization for linux debug

install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/plugins)
elseif(APPLE)
set_target_properties(${PLUGIN_NAME} PROPERTIES BUNDLE TRUE)
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS
"-undefined dynamic_lookup -rpath @loader_path/../../../../shared-api8")
"-undefined dynamic_lookup -rpath @loader_path/../../../../shared-api9")

install(TARGETS ${PLUGIN_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/plugins-api8)
install(TARGETS ${PLUGIN_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/plugins-api9)
endif()

#create filters for vs and xcode
Expand Down
Loading
Loading