-
Notifications
You must be signed in to change notification settings - Fork 16
/
justfile
161 lines (137 loc) · 5.32 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Enable .env integration
set dotenv-load
# Choose conan profile based on platform
conan_profile := if os() == "macos" {
"config/conan/macos.jinja"
} else if os() == "windows" {
"config/conan/windows.jinja"
} else if os() == "linux" {
"config/conan/linux.jinja"
} else {
"default"
}
build_type := if env_var_or_default("DEBUG", "False") == "False" { "Release" } else { "Debug" }
# Just uses "sh" on Windows by default.
# Force use powershell since Conan fails to lift virtualenv with sh
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
# Cleanup tmp and gen files in the repository
[unix]
[private]
clean-repo:
rm -rf build
rm -f CMakeUserPresets.json
rm -rf test/build
rm -f test/CMakeUserPresets.json
rm -rf Testing
rm -f config/system/requirements.macos.brew.rb.lock.json
# Cleanup tmp and gen files in the repository
[windows]
[private]
clean-repo:
echo "Cleaning is not supported on Windows yet"
# Clean Conan cache(e.g. ~/conan/data)
[unix]
[private]
clean-conan-cache:
rm -rf ~/conan/data
rm -rf ~/conan2/data
[private]
clean-all:
just clean-repo
just clean-conan-cache
[macos]
[private]
setup-system:
brew update
brew bundle install --file=config/system/requirements.macos.brew.rb --no-lock
[windows]
[private]
setup-system:
# Without it PowerShell will ask any .ps1 script to be digitally signed
Set-ExecutionPolicy -ExecutionPolicy unrestricted
choco install config/system/requirements.windows.choco.config --ignore-package-exit-codes
[linux]
[private]
setup-system:
sudo apt-get update # Update available packages list
xargs -a config/system/requirements.linux.apt.txt sudo apt-get install -y
[private]
setup-git:
git submodule update --init --recursive
[private]
setup-conan:
pip3 install -r config/system/requirements.dev.pip.txt
conan profile detect --force
conan create modules/juce-conan -pr:h {{conan_profile}} -pr:b {{conan_profile}}
conan create modules/pluginval-conan -pr:h {{conan_profile}} -pr:b {{conan_profile}}
# Auth in macOS notarytool. Needed to notarize dmg
[macos]
[private]
setup-notarytool:
xcrun notarytool store-credentials "APPLE_SIGN_PROFILE" --apple-id $MACOS_APPLE_ID --password $MACOS_APPLE_PASSWORD --team-id $MACOS_APPLE_TEAM_ID
# Setup the project
setup:
just setup-system # Install system dependencies
just setup-git # Initialize git dependencies
just setup-conan # Setup conan & install project dependencies
# Build, sign and bundle the project
build:
conan install . -pr:h {{conan_profile}} -pr:b {{conan_profile}}
conan build . -pr:h {{conan_profile}} -pr:b {{conan_profile}}
# Run Static Code Analysis
sca:
cppcheck --project=build/{{build_type}}/compile_commands.json --enable=all --report-progress --check-config --suppress=missingIncludeSystem
# Runs plugin as a standalone app
[macos]
run:
build/{{build_type}}/peakeater_artefacts/{{build_type}}/Standalone/peakeater.app/Contents/MacOS/peakeater
# Runs plugin as a standalone app
[windows]
run:
build/{{build_type}}/peakeater_artefacts/{{build_type}}/Standalone/peakeater.exe
# macOS requires a special treatment because how Mac works with AU.
# macOS requires AU plugins to be registered in order to be discoverable.
# Registration means it is placed either in system or in user's AU folder and
# special utility is called.
# Discussion - https://github.com/Tracktion/pluginval/issues/39
[macos]
[private]
test-au:
# In case there's no AU user dir
mkdir -p ~/Library/Audio/Plug-Ins/Components
# Cleanup leftovers from previous test
rm -rf ~/Library/Audio/Plug-Ins/Components/peakeater.component
# Copy AU to the user AU plugins folder(~/Library/Audio/Plug-Ins/Components) because macOS makes a scan there
cp -R build/{{build_type}}/peakeater_artefacts/{{build_type}}/AU/peakeater.component ~/Library/Audio/Plug-Ins/Components
# Trigger AudioComponentRegistrar and auval, this will force macOS to scan & register new AU plugin
killall -9 AudioComponentRegistrar
auval -a
# Source conanbuild.sh because path to pluginval is set there
source build/{{build_type}}/generators/conanbuild.sh && ctest --progress --verbose --test-dir build/{{build_type}} -R Pluginval_AU
# Cleanup global Components dir since we've polluted it with our AU under test
rm -rf ~/Library/Audio/Plug-Ins/Components/peakeater.component
[macos]
[private]
test-vst3:
source build/{{build_type}}/generators/conanbuild.sh && ctest --progress --verbose --test-dir build/{{build_type}} -R Pluginval_VST3
[macos]
[private]
test-compile-options:
source build/{{build_type}}/generators/conanbuild.sh && ctest --progress --verbose --test-dir build/{{build_type}} -R CompileOptions
# Run a test suite
# On a mac, we want to have an ability to exec every test individually because AU test is not possible with sanitized exec
[macos]
test:
just test-compile-options
just test-vst3
just test-au
# Run a test suite
[linux]
test:
# Source conanbuild.sh because path to pluginval is set there
. build/{{build_type}}/generators/conanbuild.sh && ctest --progress --verbose --test-dir build/{{build_type}}
# Run a test suite
[windows]
test:
# Run conanbuild.ps1 because path to pluginval is set there
./build/{{build_type}}/generators/conanbuild.ps1; ctest --progress --verbose --test-dir build/{{build_type}}