Skip to content

Commit

Permalink
Pluginval integration (#89)
Browse files Browse the repository at this point in the history
* Verify VST3 and AU versions
* Simplify build
* Fixed Windows local build
* Added Linux local dev env(devcontainer)
* Docs updated
  • Loading branch information
vvvar authored Jun 25, 2023
1 parent 01e8f54 commit e78353b
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 244 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu

RUN apt update
RUN apt install -y git
RUN apt install -y software-properties-common
RUN apt install -y ca-certificates
RUN apt install -y wget
RUN apt install -y curl
RUN apt install -y ssh
RUN apt install -y sudo
RUN apt install -y build-essential
RUN apt install -y python3 python3-pip
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin
7 changes: 6 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"image": "ubuntu:20.04"
"build": {
"dockerfile": "Dockerfile"
},
"forwardPorts": [
3000
]
}
21 changes: 18 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: macos
name: macos-build
path: build/Release/peakeater_artefacts/Release/DMG/*.dmg
- name: Upload test artifacts
uses: actions/upload-artifact@v3
with:
name: macos-test
path: build/Release/peakeater_artefacts/Release/Pluginval/*.txt

windows:
name: Windows
Expand All @@ -91,8 +96,13 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: windows
name: windows-build
path: build/Release/peakeater_artefacts/Release/Archive/*.zip
- name: Upload test artifacts
uses: actions/upload-artifact@v3
with:
name: windows-test
path: build/Release/peakeater_artefacts/Release/Pluginval/*.txt

linux:
name: Linux
Expand All @@ -113,5 +123,10 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: linux
name: linux-build
path: build/Release/peakeater_artefacts/Release/Archive/*.zip
- name: Upload test artifacts
uses: actions/upload-artifact@v3
with:
name: linux-test
path: build/Release/peakeater_artefacts/Release/Pluginval/*.txt
23 changes: 19 additions & 4 deletions .github/workflows/publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- master

jobs:
build:
name: Build
Expand All @@ -27,17 +27,32 @@ jobs:
- name: Download macOS build
uses: actions/download-artifact@v3
with:
name: macos
name: macos-build
path: release
- name: Download macOS test results
uses: actions/download-artifact@v3
with:
name: macos-test
path: release
- name: Download Windows build
uses: actions/download-artifact@v3
with:
name: windows
name: windows-build
path: release
- name: Download Windows test results
uses: actions/download-artifact@v3
with:
name: windows-test
path: release
- name: Download Linux build
uses: actions/download-artifact@v3
with:
name: linux
name: linux-build
path: release
- name: Download Linux test results
uses: actions/download-artifact@v3
with:
name: linux-test
path: release
- name: Get release version
id: get-version
Expand Down
16 changes: 4 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
# MacOS indexing files
.DS_Store

# Various vscode logs
/.vscode/*.log

# Build dir
/build
/test/build

# CMake workflow
CMakeUserPresets.json

# Projucer auto-gen files
/JuceLibraryCode

# Python cache
Scripts/Release/__pycache__

# node
node_modules

# Various vscode logs
/.vscode/*.log

# Env
.env
config/.env
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"ms-vscode.cpptools",
"ms-python.python",
"josetr.cmake-language-support-vscode",
"github.vscode-github-actions",
"shd101wyy.markdown-preview-enhanced",
"streetsidesoftware.code-spell-checker",
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,10 @@
"zipresp"
],
"sonarlint.pathToCompileCommands": "${workspaceFolder}/build/Release/compile_commands.json",
// Bandaid because occasinally git is not added to the Path which breaks just
// Keep untill this resolved - https://github.com/casey/just/issues/1517
// VS Code-only since it is installation issue which works fine on a CI
"terminal.integrated.env.windows": {
"Path": "${env:Path};C:\\Program Files\\Git\\bin"
},
}
73 changes: 48 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
cmake_minimum_required(VERSION 3.15)
project(${CMAKE_PROJECT_NAME} VERSION ${CMAKE_PROJECT_VERSION})

# For this to work, the following ENV variables must be set:
# - MACOS_APPLE_DEVELOPER_ID: Apple Developer ID(for ex. "Developer ID Application: John Doe (XXXXX6XX42)")
option(CODESIGN "Codesign plugins and bundle(macOS only)" OFF)
include(FetchContent)
include(CTest)

# Export compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

find_package(JUCE CONFIG REQUIRED)

include(FetchContent)
FetchContent_Declare(
clap-juce-extensions
GIT_REPOSITORY https://github.com/free-audio/clap-juce-extensions.git
Expand Down Expand Up @@ -95,64 +93,89 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags)

# Where to store the result of the Pluginval run
set(_PLUGINVAL_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_artefacts/${CMAKE_BUILD_TYPE}/Pluginval")

# Adding targets for testing, signing and packaging which are very platform-specific
# NOTE: only macOS supports signing at the moment
if(APPLE)
if(CODESIGN)
if(NOT DEFINED ENV{MACOS_APPLE_DEVELOPER_ID})
message(FATAL_ERROR "CODESIGN option is turned ON, but MACOS_APPLE_DEVELOPER_ID env variable is not defined")
endif()
# Test we haven't missed any compiler options. Makes sense only on macOS at the moment
add_test(NAME CompileOptions COMMAND python3 ${PROJECT_SOURCE_DIR}/test/test_compile_options.py --compile_commands=${CMAKE_BINARY_DIR}/compile_commands.json)

# Marks as CFBundle. Setting this globally because:
# 1. Without it, TARGET_BUNDLE_DIR won't work
# 2. TARGET_BUNDLE_DIR is used while bundling, signing and testing for macOS
set_target_properties(${CMAKE_PROJECT_NAME}_AU ${CMAKE_PROJECT_NAME}_CLAP ${CMAKE_PROJECT_NAME}_LV2 ${CMAKE_PROJECT_NAME}_VST3 PROPERTIES BUNDLE TRUE)

# Test VST3 and AU with Pluginval
add_test(NAME Pluginval_VST3
COMMAND pluginval --strictness-level 10 --verbose --skip-gui-tests --validate-in-process --output-dir ${_PLUGINVAL_OUT_DIR} $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_VST3>)
add_test(NAME Pluginval_AU
COMMAND pluginval --strictness-level 10 --verbose --skip-gui-tests --validate-in-process --output-dir ${_PLUGINVAL_OUT_DIR} $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_AU>)

# Codesign all plugins before we've bundled them
# Optionally, codesign all plugins before we've bundled them(ensure it with tests)
if(DEFINED ENV{MACOS_APPLE_DEVELOPER_ID})
add_custom_command(TARGET ${CMAKE_PROJECT_NAME}_AU VERBATIM POST_BUILD
COMMAND codesign --force -s $ENV{MACOS_APPLE_DEVELOPER_ID} -v $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_AU> --deep --strict --options=runtime --timestamp
COMMENT "Codesigning AU")
add_test(NAME Codesign_AU COMMAND codesign -dv --verify --verbose=4 $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_AU>)

add_custom_command(TARGET ${CMAKE_PROJECT_NAME}_CLAP VERBATIM POST_BUILD
COMMAND codesign --force -s $ENV{MACOS_APPLE_DEVELOPER_ID} -v $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_CLAP> --deep --strict --options=runtime --timestamp
COMMENT "Codesigning CLAP")
add_test(NAME Codesign_CLAP COMMAND codesign -dv --verify --verbose=4 $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_CLAP>)

add_custom_command(TARGET ${CMAKE_PROJECT_NAME}_LV2 VERBATIM POST_BUILD # lv2 is special, sign only TARGET_FILE
COMMAND codesign --force -s $ENV{MACOS_APPLE_DEVELOPER_ID} -v $<TARGET_FILE:${CMAKE_PROJECT_NAME}_LV2> --deep --strict --options=runtime --timestamp
COMMENT "Codesigning LV2")
add_test(NAME Codesign_LV2 COMMAND codesign -dv --verify --verbose=4 $<TARGET_FILE:${CMAKE_PROJECT_NAME}_LV2>)

add_custom_command(TARGET ${CMAKE_PROJECT_NAME}_VST3 VERBATIM POST_BUILD
COMMAND codesign --force -s $ENV{MACOS_APPLE_DEVELOPER_ID} -v $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_VST3> --deep --strict --options=runtime --timestamp
COMMENT "Codesigning VST3")
add_test(NAME Codesign_VST3 COMMAND codesign -dv --verify --verbose=4 $<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_VST3>)
endif()

# Build DMG
set(_OSX_DMG_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_artefacts/${CMAKE_BUILD_TYPE}/DMG")
set(_OSX_DMG_FILE "${_OSX_DMG_DIR}/${CMAKE_PROJECT_NAME}-v${CMAKE_PROJECT_VERSION}-macOS-universal.dmg")

# macOS specific. Marks as CFBundle. Otherwise - TARGET_BUNDLE_DIR wouldn't work
set_target_properties(${CMAKE_PROJECT_NAME}_AU ${CMAKE_PROJECT_NAME}_CLAP ${CMAKE_PROJECT_NAME}_LV2 ${CMAKE_PROJECT_NAME}_VST3 PROPERTIES BUNDLE TRUE)
get_target_property(_LV2_OUT_DIR ${CMAKE_PROJECT_NAME}_LV2 LIBRARY_OUTPUT_DIRECTORY) # Getting it like this since lv2 folder is not a bundle, so TARGET_BUNDLE_DIR wont work
add_custom_target(dmg ALL
add_custom_target(DMG ALL
BYPRODUCTS ${_OSX_DMG_FILE}
VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${_OSX_DMG_DIR}
COMMAND dmgbuild -s ${PROJECT_SOURCE_DIR}/config/dmgbuild.py -D au=$<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_AU> -D clap=$<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_CLAP> -D lv2=${_LV2_OUT_DIR} -D vst3=$<TARGET_BUNDLE_DIR:${CMAKE_PROJECT_NAME}_VST3> "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}" ${_OSX_DMG_FILE}
COMMENT "Building DMG")
add_dependencies(dmg ${CMAKE_PROJECT_NAME}_AU ${CMAKE_PROJECT_NAME}_CLAP ${CMAKE_PROJECT_NAME}_LV2 ${CMAKE_PROJECT_NAME}_VST3)
add_dependencies(DMG ${CMAKE_PROJECT_NAME}_AU ${CMAKE_PROJECT_NAME}_CLAP ${CMAKE_PROJECT_NAME}_LV2 ${CMAKE_PROJECT_NAME}_VST3)

if(CODESIGN)
# Codesign, notarise and staple DMG
add_custom_command(TARGET dmg VERBATIM POST_BUILD
# Optionally, codesign, notarize and stable the DMG(ensure it with test)
if(DEFINED ENV{MACOS_APPLE_DEVELOPER_ID})
add_custom_command(TARGET DMG VERBATIM POST_BUILD
COMMAND codesign --force -s $ENV{MACOS_APPLE_DEVELOPER_ID} -v ${_OSX_DMG_FILE} --deep --strict --options=runtime --timestamp
COMMAND xcrun notarytool submit ${_OSX_DMG_FILE} --keychain-profile "APPLE_SIGN_PROFILE" --wait
COMMAND xcrun stapler staple ${_OSX_DMG_FILE}
COMMENT "Codesigning, notarizing and stapling DMG")
add_test(NAME Codesign_DMG COMMAND codesign -dv --verify --verbose=4 ${_OSX_DMG_FILE})
endif()
else()
# The way of getting path to .vst3 is tricky since actual bin is inside ARCHIVE_OUTPUT_DIRECTORY
set(_VST3_BUNDLE "$<GENEX_EVAL:$<TARGET_PROPERTY:${CMAKE_PROJECT_NAME}_VST3,ARCHIVE_OUTPUT_DIRECTORY>>/${CMAKE_PROJECT_NAME}.vst3")
# Getting it like this since lv2 folder is not a bundle, so TARGET_BUNDLE_DIR wont work
get_target_property(_LV2_OUT_DIR ${CMAKE_PROJECT_NAME}_LV2 LIBRARY_OUTPUT_DIRECTORY)

# Archive everything into ZIP
set(_ARCHIVE_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_artefacts/${CMAKE_BUILD_TYPE}/Archive")
set(_ARCHIVE_FILE "${_ARCHIVE_DIR}/${CMAKE_PROJECT_NAME}-v${CMAKE_PROJECT_VERSION}-${CMAKE_HOST_SYSTEM_NAME}-x86_64.zip")

# otherwise, TARGET_BUNDLE_DIR wouldn't work
get_target_property(_LV2_OUT_DIR ${CMAKE_PROJECT_NAME}_LV2 LIBRARY_OUTPUT_DIRECTORY) # Getting it like this since lv2 folder is not a bundle, so TARGET_BUNDLE_DIR wont work
add_custom_target(archive ALL
VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${_ARCHIVE_DIR}
COMMAND ${CMAKE_COMMAND} -E tar cf ${_ARCHIVE_FILE} --format=zip $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}_CLAP> ${_LV2_OUT_DIR} $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}_VST3>
COMMAND ${CMAKE_COMMAND} -E tar cf ${_ARCHIVE_FILE} --format=zip $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}_CLAP> ${_LV2_OUT_DIR} ${_VST3_BUNDLE}
COMMENT "Archiving everything")
add_dependencies(archive ${CMAKE_PROJECT_NAME}_CLAP ${CMAKE_PROJECT_NAME}_LV2 ${CMAKE_PROJECT_NAME}_VST3)
endif()

# Print available CMake targets for the debugging purpose
get_property(target_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
message(DEBUG " Available CMake targets are: ${target_names}")
# Test VST3 with Pluginval(only non-macOS-specific format supported)
# NOTE#1: Unlike macOS, TARGET_FILE_DIR is used because unlike macOS is a file here
# NOTE#2: Only Windows supports GUI on a CI, thus check for it
add_test(NAME Pluginval_VST3
COMMAND pluginval --strictness-level 10 --verbose $<$<NOT:$<BOOL:${WIN32}>>:--skip-gui-tests> --validate-in-process --output-dir ${_PLUGINVAL_OUT_DIR} ${_VST3_BUNDLE})
endif()
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Table of Contents
- [Resizing](#resizing)
- [VST3, AU, LV2 and CLAP Support](#vst3-au-lv2-and-clap-support)
- [macOS, Windows and Linux Support](#available-on-all-major-platforms)
- [Verified by Pluginval](#verified-by-pluginval)
- [Installation](#installation)
- [macOS](#macos)
- [Windows](#windows)
Expand Down Expand Up @@ -151,6 +152,12 @@ You can use it on macOS, Windows or Linux.

> **Warning** Linux support is experimental and may be unstable.
### <a id="verified-by-pluginval"></a> Verified by Pluginval <img src="assets/pluginval.png" alt="Pluginval" height="20"/>

> pluginval is a cross-platform plugin validator and tester application. It is designed to be used by both plugin and host developers to ensure stability and compatibility between plugins and hosts. [GitHub Project Link](https://github.com/Tracktion/pluginval/tree/develop)
VST3 and AU versions are verified by [Tracktion Pluginval](https://www.tracktion.com/develop/pluginval) for all platforms. Maximum possible strictness level 10 is used. For macOS and Linux - Headless Mode is being used and GUI Mode is used for Windows. Starting from v0.6.5, you may find proofs of Pluginval verification in the "Assets" section on the Release page(*.txt files are split by platform and plugin format).

<!-- INSTALLATION -->

## Installation
Expand Down Expand Up @@ -211,8 +218,12 @@ Extract the zip and copy the plugin in a format of your choice into the folder w
- [Just](https://github.com/casey/just) 1.13.0+
- [Python](https://www.python.org) 3.11.4+
- [Brew](https://brew.sh) 4.0.23+(macOS only)
- [C++ Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022)(Windows only)
- [Chocolatey](https://chocolatey.org) 1.4.0+(Windows only)

> **Note**<br />
> It is recommended to use PowerShell on Windows
### Building

```sh
Expand Down Expand Up @@ -286,11 +297,3 @@ Distributed under the GPL-3.0 License. See [`LICENSE.md`](https://github.com/vvv

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[issues-shield]: https://img.shields.io/github/issues/vvvar/PeakEater?style=for-the-badge
[issues-url]: https://github.com/vvvar/PeakEater/issues
[license-shield]: https://img.shields.io/github/license/vvvar/PeakEater?style=for-the-badge
[license-url]: https://github.com/vvvar/PeakEater/blob/master/LICENSE.md
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/vladyslav-voinov-5126a793/
[product-screenshot]: assets/screenshots/main.png
Binary file added assets/pluginval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 2 additions & 26 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout
from conan.tools.files import copy
from conan.tools.env import VirtualBuildEnv

import os


class PeakEater(ConanFile):
name = "peakeater"
version = "0.6.4"
version = "0.6.5"
user = "vvvar"
channel = "testing"
company = "T-Audio"
url = "https://github.com/vvvar/PeakEater"
settings = "os", "arch", "compiler", "build_type"
options = {"signed": [True, False]}
default_options = {"signed": False}
options_description = {"signed": "Whether binaries are signed with the certificate or not"}
exports_sources = "assets", "modules", "source", "CMakeLists.txt"
package_type = "application"

requires = "juce/7.0.5@juce/release"
tool_requires = "pluginval/1.0.3@pluginval/release"

def layout(self):
cmake_layout(self)
Expand All @@ -32,7 +27,6 @@ def generate(self):
toolchain.cache_variables["CMAKE_PROJECT_VERSION"] = str(self.version)
toolchain.cache_variables["CONAN_PROJECT_COMPANY"] = str(self.company)
toolchain.cache_variables["CONAN_PROJECT_URL"] = str(self.url)
toolchain.cache_variables["CODESIGN"] = self.options.signed # type: ignore
toolchain.generate()
dependencies = CMakeDeps(self)
dependencies.generate()
Expand All @@ -43,21 +37,3 @@ def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package_info(self):
self.cpp_info.resdirs = ["data"]

def package(self):
# Package bins(plugins, installers, etc.)
bin_folder = os.path.join(str(self.package_folder), "bin")
artefacts_folder = os.path.join(self.build_folder, f"{self.name}_artefacts", self.settings.get_safe("build_type")) # type: ignore
copy(self, "*", src=os.path.join(artefacts_folder, "VST3"), dst=bin_folder)
copy(self, "*", src=os.path.join(artefacts_folder, "CLAP"), dst=bin_folder)
copy(self, "*", src=os.path.join(artefacts_folder, "LV2"), dst=bin_folder)
if self.settings.os == "Macos": # type: ignore
copy(self, "*", src=os.path.join(artefacts_folder, "AU"), dst=bin_folder)
copy(self, "*", src=os.path.join(artefacts_folder, "DMG"), dst=bin_folder)
# Package various build data(build logs, compile database, etc). Useful for analysis
data_folder = os.path.join(str(self.package_folder), "data")
copy(self, "compile_commands.json", src=self.build_folder, dst=data_folder)
copy(self, "build.ninja", src=self.build_folder, dst=data_folder)
Loading

0 comments on commit e78353b

Please sign in to comment.