-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.toml
124 lines (100 loc) · 3.49 KB
/
Makefile.toml
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
# vim: set ts=4 sw=4 expandtab:
[config]
additional_profiles = [ "release" ]
[env]
PLATFORM_DYLIB_EXT = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "so", mapping = {"macos" = "dylib", "windows" = "dll" } }
PLATFORM_EXTERNAL_PREFIX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "l", mapping = {"linux" = "l", "macos" = "d", "windows" = "m", "openbsd" = "o", "freebsd" = "l" } }
PLATFORM_EXTERNAL_SUFFIX = { source = "${CARGO_MAKE_RUST_TARGET_ARCH}", default_value = "ERROR", mapping = {"x86" = "i386", "x86_64" = "amd64", "arm" = "arm", "aarch64" = "arm64", "powerpc" = "ppc" } }
PLATFORM_EXTERNAL_EXT = "${PLATFORM_EXTERNAL_PREFIX}_${PLATFORM_EXTERNAL_SUFFIX}"
[env.development]
BUILD_ARGS = "build"
PROFILE_TARGET_DIR = "target/debug"
[env.release]
BUILD_ARGS = "build|--release"
PROFILE_TARGET_DIR = "target/release"
[tasks.echo]
script = [
'''
echo PLATFORM_DYLIB_EXT: ${PLATFORM_DYLIB_EXT}
echo PLATFORM_EXTERNAL_EXT: ${PLATFORM_EXTERNAL_EXT}
'''
]
[tasks.build]
args = ["@@split(BUILD_ARGS,|)"]
[tasks.clean]
dependencies = ["clean-artifacts"]
command = "cargo"
args = ["clean"]
[tasks.post-build]
dependencies = ["move"]
[tasks.clean-artifacts]
script_runner = "@shell"
script = [ "rm -rf ${CARGO_MAKE_CRATE_FS_NAME} *.dek*" ]
# Package for Deken
[tasks.package]
dependencies = ["move"]
command = "./deken/developer/deken"
args = ["package", "-v", "${CARGO_MAKE_CRATE_VERSION}", "${CARGO_MAKE_CRATE_FS_NAME}"]
# Upload to Deken
[tasks.upload]
dependencies = ["package"]
command = "./deken/developer/deken"
args = ["upload", "${CARGO_MAKE_CRATE_FS_NAME}"]
[tasks.platform-env.linux]
env = { "PLATFORM_EXTERNAL_EXT" = "pd_linux", "PLATFORM_DYLIB_EXT" = "so" }
private = true
[tasks.platform-env.mac]
env = { "PLATFORM_EXTERNAL_EXT" = "pd_darwin", "PLATFORM_DYLIB_EXT" = "dylib" }
private = true
[tasks.name-env]
env = { "LIB_TILDE" = "${PROFILE_TARGET_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}_tilde.${PLATFORM_DYLIB_EXT}", "LIB" = "${PROFILE_TARGET_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}.${PLATFORM_DYLIB_EXT}", "EXTERNAL_TILDE" = "${CARGO_MAKE_CRATE_FS_NAME}~.${PLATFORM_EXTERNAL_EXT}", "EXTERNAL" = "${CARGO_MAKE_CRATE_FS_NAME}.${PLATFORM_EXTERNAL_EXT}" }
private = true
[tasks.move]
dependencies = ["build", "name-env"]
script_runner = "@shell"
script = [
'''
mkdir -p ${CARGO_MAKE_CRATE_FS_NAME}
[ -f ${LIB_TILDE} ] && rsync -a ${LIB_TILDE} ${CARGO_MAKE_CRATE_FS_NAME}/${EXTERNAL_TILDE} || rsync -a ${LIB} ${CARGO_MAKE_CRATE_FS_NAME}/${EXTERNAL}
'''
]
[tasks.run.linux]
dependencies = ["move"]
command = "pd"
args = ["test.pd"]
[tasks.run.mac]
dependencies = ["move"]
command = "open"
args = ["test.pd"]
[tasks.install.mac]
dependencies = ["move"]
script_runner = "@shell"
script = [
'''
# Check if plugdata directory exists
# If it does, use that, if not, use the PD default
if [ -d ~/Documents/plugdata ]; then
INSTALL_PATH=~/Documents/plugdata/Externals
else
INSTALL_PATH=~/Library/Pd/externals
fi
echo "Installing to: $INSTALL_PATH"
# Create the directory if it doesn't exist
mkdir -p $INSTALL_PATH
# Copy the external to the directory
cp -r ${CARGO_MAKE_CRATE_FS_NAME}/* $INSTALL_PATH
'''
]
[tasks.install.linux]
dependencies = ["move"]
script_runner = "@shell"
script = [
'''
INSTALL_PATH=~/pd-externals
echo "Installing to: $INSTALL_PATH"
# Create the directory if it doesn't exist
mkdir -p $INSTALL_PATH
# Copy the external to the directory
cp -r ${CARGO_MAKE_CRATE_FS_NAME}/* $INSTALL_PATH
'''
]