-
-
Notifications
You must be signed in to change notification settings - Fork 70
Pluginval as dependency #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sudara
wants to merge
15
commits into
develop
Choose a base branch
from
use-as-dependency
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+185
−36
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2506d4c
Guard standalone logic with pluginval_IS_TOP_LEVEL
sudara dcd222a
Add a custom target when not top level
sudara 94bab67
Add CLI option when dependency. Only compile docs when top-level.
sudara 4d3a427
Move JUCE depedency from git submodule to CPM
sudara 7ee6804
Actions have cached the module, lets not checkout the submodule
sudara d507a4f
Remove modules/juce
sudara 28a71d0
Add docs for installing as a dep
sudara c7926d1
Revert to 8.0.3 and clear ccache
sudara 0cd2c3b
CI: JUCE is now built in _deps, break plugin cache
sudara bd4e558
Support JUCE 8.0.11 (addDefaultFormats is removed)
sudara b596c78
Simplify the cache key (remove JUCE version)
sudara 6b26e84
Specify the correct CPM source directory as the build dir
sudara fb1dab7
Add a test for including pluginval as a dependency
sudara 061e056
Attempt to fix use-as-dependency tests on ubuntu/windows
sudara 77252e2
Clarify JUCE 8 requirement when pluginval is a dependency [ci skip]
sudara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,8 +48,6 @@ jobs: | |
| apt install -y sudo cmake curl tree | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Setup Environment Variables | ||
| shell: bash | ||
|
|
@@ -58,12 +56,11 @@ jobs: | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| echo "APP_DIR=${{ env.BUILD_DIR }}/${{ env.BINARY_NAME }}_artefacts/${{ env.BUILD_TYPE }}" >> $GITHUB_ENV | ||
| echo "ZIP_FILE_NAME=${{ env.BINARY_NAME }}_${{ matrix.name }}.zip" >> $GITHUB_ENV | ||
| echo "JUCE_SHA1=$(git rev-parse HEAD:modules/juce)" >> $GITHUB_ENV | ||
| echo "PLUGIN_BUILD_DIR=modules/juce/Builds" >> $GITHUB_ENV | ||
|
|
||
|
|
||
| # This needs to be absolute to make action/cache happy | ||
| # JUCE examples are built from within the CPM-fetched JUCE source directory | ||
| WORKING_DIR=$(pwd) | ||
| echo "PLUGIN_CACHE_PATH=$WORKING_DIR/modules/juce/Builds/examples/Plugins" >> $GITHUB_ENV | ||
| echo "PLUGIN_CACHE_PATH=$WORKING_DIR/${{ env.BUILD_DIR }}/_deps/juce-src/Builds/examples/Plugins" >> $GITHUB_ENV | ||
|
|
||
| - name: Install dependencies (Linux) | ||
| if: ${{ matrix.name == 'Linux' }} | ||
|
|
@@ -90,7 +87,7 @@ jobs: | |
| - name: ccache | ||
| uses: hendrikmuhs/[email protected] | ||
| with: | ||
| key: v2-${{ matrix.name }}-${{ env.BUILD_TYPE }} | ||
| key: v3-${{ matrix.name }}-${{ env.BUILD_TYPE }} | ||
|
|
||
| - name: Configure | ||
| shell: bash | ||
|
|
@@ -114,11 +111,11 @@ jobs: | |
| with: | ||
| path: ${{ env.PLUGIN_CACHE_PATH }} | ||
| # Increment the version in the key below to manually break plugin cache | ||
| key: v7-${{ runner.os }}-${{ env.JUCE_SHA1 }} | ||
| key: v9-${{ runner.os }} | ||
|
|
||
| - name: Build JUCE example plugins | ||
| if: steps.cache-plugins.outputs.cache-hit != 'true' | ||
| working-directory: modules/juce | ||
| working-directory: ${{ env.BUILD_DIR }}/_deps/juce-src | ||
| shell: bash | ||
| run: | | ||
| cmake -B Builds -DJUCE_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache . | ||
|
|
@@ -170,6 +167,33 @@ jobs: | |
| name: ${{ env.ZIP_FILE_NAME }} | ||
| path: ${{ env.APP_DIR }}/${{ env.ZIP_FILE_NAME }} | ||
|
|
||
| # Test pluginval as a dependency in another JUCE project | ||
| as_dependency: | ||
| name: Pluginval as Dependency | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-15, windows-latest] | ||
| juce: ["8.0.3", "8.0.11"] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libasound2-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev libwebkit2gtk-4.1-dev ladspa-sdk | ||
|
|
||
| - name: Configure | ||
| run: cmake -B build -S tests/pluginval_as_dependency -DJUCE_VERSION="${{ matrix.juce }}" | ||
|
|
||
| - name: Build | ||
| run: cmake --build build --target pluginval --parallel 4 | ||
|
|
||
| - name: Verify | ||
| run: cmake --build build --target verify_pluginval | ||
|
|
||
| # Create release for tagged refs | ||
| deploy: | ||
| if: contains(github.ref, 'tags/v') | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,25 @@ cmake -B Builds/Debug -DCMAKE_BUILD_TYPE=Debug . # configure | |
| cmake --build Builds/Debug --config Debug # build | ||
| ``` | ||
|
|
||
| ### Including within an existing JUCE project | ||
|
|
||
| Instead of running as a separate app, you can add pluginval as a CMake target to your existing JUCE plugin project. This not only makes for a convenient debugging workflow, it gives you better stack traces. | ||
|
|
||
| For example, if you add pluginval as a git submodule like so: | ||
| ``` | ||
| git submodule add -b develop [email protected]:Tracktion/pluginval.git modules/pluginval | ||
| ``` | ||
|
|
||
| or added with CPM like so: | ||
|
|
||
| ``` | ||
| CPMAddPackage("gh:tracktion/pluginval#develop") | ||
| ``` | ||
|
|
||
| Then all you need to do is call `add_subdirectory ("modules/pluginval")` in your `CMakeLists.txt`. This should be done **after** your call to `juce_add_plugin`. | ||
|
|
||
| Note that only JUCE 8 is currently supported/tested for this method. | ||
|
|
||
| ### Third-party Installation | ||
| ###### _Chocolatey (Windows):_ | ||
| ```shell | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule juce
deleted from
a2a9c5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| cmake_minimum_required(VERSION 3.22) | ||
| project(PluginvalAsDependency VERSION 1.0.0) | ||
|
|
||
| set(JUCE_VERSION "8.0.3" CACHE STRING "JUCE version to test against") | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM.cmake) | ||
|
|
||
| CPMAddPackage("gh:juce-framework/JUCE#${JUCE_VERSION}") | ||
|
|
||
| # Minimal plugin to test pluginval as a dependency | ||
| # Plugin name must match CMAKE_PROJECT_NAME for pluginval's CLI target to work | ||
| # Must be defined BEFORE adding pluginval | ||
| juce_add_plugin(${CMAKE_PROJECT_NAME} | ||
| PLUGIN_MANUFACTURER_CODE Test | ||
| PLUGIN_CODE Test | ||
| FORMATS VST3 AU | ||
| PRODUCT_NAME "TestPlugin") | ||
|
|
||
| target_sources(${CMAKE_PROJECT_NAME} PRIVATE TestPlugin.cpp) | ||
| target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE juce::juce_audio_processors) | ||
|
|
||
| CPMAddPackage( | ||
| NAME pluginval | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. | ||
| ) | ||
|
|
||
| # Verify pluginval runs and reports the expected JUCE version | ||
| add_custom_target(verify_pluginval | ||
| COMMAND $<TARGET_FILE:pluginval> --help | grep "JUCE v${JUCE_VERSION}" | ||
| DEPENDS pluginval | ||
| COMMENT "Verify pluginval built with JUCE ${JUCE_VERSION}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Minimal JUCE plugin to test pluginval builds as a dependency | ||
| #include <juce_audio_processors/juce_audio_processors.h> | ||
|
|
||
| class TestProcessor : public juce::AudioProcessor | ||
| { | ||
| public: | ||
| TestProcessor() | ||
| : AudioProcessor (BusesProperties() | ||
| .withInput ("Input", juce::AudioChannelSet::stereo(), true) | ||
| .withOutput ("Output", juce::AudioChannelSet::stereo(), true)) | ||
| { | ||
| } | ||
|
|
||
| const juce::String getName() const override { return "TestPlugin"; } | ||
| bool acceptsMidi() const override { return false; } | ||
| bool producesMidi() const override { return false; } | ||
| double getTailLengthSeconds() const override { return 0.0; } | ||
|
|
||
| int getNumPrograms() override { return 1; } | ||
| int getCurrentProgram() override { return 0; } | ||
| void setCurrentProgram (int) override {} | ||
| const juce::String getProgramName (int) override { return {}; } | ||
| void changeProgramName (int, const juce::String&) override {} | ||
|
|
||
| void prepareToPlay (double, int) override {} | ||
| void releaseResources() override {} | ||
| void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override {} | ||
|
|
||
| bool hasEditor() const override { return false; } | ||
| juce::AudioProcessorEditor* createEditor() override { return nullptr; } | ||
|
|
||
| void getStateInformation (juce::MemoryBlock&) override {} | ||
| void setStateInformation (const void*, int) override {} | ||
| }; | ||
|
|
||
| juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() | ||
| { | ||
| return new TestProcessor(); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's harder to grab this SHA1 when JUCE is coming from CPM. I looked at the history and decided this feature is unnecessary: