Skip to content

Commit

Permalink
Merge pull request #12 from m-hilgendorf/master
Browse files Browse the repository at this point in the history
Support MacOS and support UI
  • Loading branch information
MirkoCovizzi authored Apr 26, 2020
2 parents d5da6b0 + 670f5d5 commit 5380bda
Show file tree
Hide file tree
Showing 14 changed files with 552 additions and 359 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
branches:
- master
pull_request:

jobs:
check:
runs-on: ubuntu-latest
name: formatting and linting
steps:
- name: checkout
uses: actions/checkout@v2
- name: provision
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings

test:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
name: test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: test
args: --all
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Cargo.lock
.idea
.vscode
*.iml
validator
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ edition = "2018"
vst3-com = { path = "./com" }
bitflags = "1.2.0"

[dev-dependencies]
log = "0.4"
simple_logger = "1.6.0"
lazy_static = "1.4.0"
widestring = "0.4.0"

[workspace]
members = ["examples/passthru", "examples/again", "com", "com/macros", "com/macros/support"]
members = ["examples/again", "com", "com/macros", "com/macros/support"]

[[example]]
name = "passthru"
crate-type = ["cdylib"]
12 changes: 0 additions & 12 deletions LICENSE.txt

This file was deleted.

31 changes: 22 additions & 9 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,47 @@
workspace = false
script = []

[tasks.passthru.mac]
script = [
"cargo build --example passthru",
"./osx-bundler.sh passthru target/debug/examples/libpassthru.dylib"
]

[tasks.passthru.linux]
workspace = false
script = [
"cargo build --package passthru",
"mkdir -p target/debug/plugin.vst3/Contents/x86_64-linux",
"mkdir -p target/debug/plugin.vst3/Contents/Resources",
"cp target/debug/libpassthru.so target/debug/plugin.vst3/Contents/x86_64-linux/plugin.so"
"cargo build --example passthru",
"mkdir -p target/debug/passthru.vst3/Contents/x86_64-linux",
"mkdir -p target/debug/passthru.vst3/Contents/Resources",
"cp target/debug/examples/libpassthru.so target/debug/passthru.vst3/Contents/x86_64-linux/passthru.so"
]

[tasks.passthru.windows]
workspace = false
script_runner = "@shell"
script = [
"cargo build --package passthru",
"cp target/debug/passthru.dll target/debug/passthru.vst3"
"cargo build --example passthru",
"cp target/debug/examples/passthru.dll target/debug/passthru.vst3"
]

[tasks.again]
workspace = false
script = []

[tasks.again.mac]
workspace = false
script = [
"cargo build --package again",
"./osx-bundler.sh again target/debug/libagain.dylib"
]

[tasks.again.linux]
workspace = false
script = [
"cargo build --package again",
"mkdir -p target/debug/plugin.vst3/Contents/x86_64-linux",
"mkdir -p target/debug/plugin.vst3/Contents/Resources",
"cp target/debug/libagain.so target/debug/plugin.vst3/Contents/x86_64-linux/plugin.so"
"mkdir -p target/debug/again.vst3/Contents/x86_64-linux",
"mkdir -p target/debug/again.vst3/Contents/Resources",
"cp target/debug/libagain.so target/debug/again.vst3/Contents/x86_64-linux/again.so"
]

[tasks.again.windows]
Expand Down
2 changes: 1 addition & 1 deletion com/macros/support/src/co_class/class_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn generate(struct_item: &ItemStruct) -> HelperTokenStream {
// Bringing trait into scope to access IUnknown methods.
use vst3_com::interfaces::iunknown::IUnknown;

if aggr != std::ptr::null_mut() {
if !aggr.is_null() {
return vst3_com::sys::CLASS_E_NOAGGREGATION;
}

Expand Down
1 change: 1 addition & 0 deletions com/macros/support/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(clippy::ptr_arg)]
#![allow(clippy::implicit_hasher)]
extern crate proc_macro;

pub mod aggr_co_class;
Expand Down
13 changes: 13 additions & 0 deletions examples/again/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,19 @@ pub extern "system" fn ModuleExit() -> bool {
true
}

#[no_mangle]
#[allow(non_snake_case)]
pub extern "system" fn bundleEntry(_: *mut c_void) -> bool {
true
}

#[no_mangle]
#[allow(non_snake_case)]
pub extern "system" fn bundleExit() -> bool {
info!("Module exited");
true
}

static mut INIT_LOGGER: bool = false;

#[no_mangle]
Expand Down
Loading

0 comments on commit 5380bda

Please sign in to comment.