-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.toml
98 lines (78 loc) · 2.97 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
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = {"linux" = "so", "macos" = "dylib", "windows" = "dll", "openbsd" = "so" } }
LIBRARY_PREFIX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = {"linux" = "lib", "macos" = "lib", "windows" = "", "openbsd" = "lib" } }
TEST_PLUGIN_FILENAME="wooting_analog_test_plugin"
# We want to skip the updater on non-windows platforms as it's just designed for windows
CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "", mapping = { "linux" = "wooting-analog-sdk-updater", "macos" = "wooting-analog-sdk-updater" } }
[tasks.build]
dependencies = [ "cargo-args"]
[tasks.cargo-args]
condition = { env_set = [ "CARGO_TARGET" ] }
env = { CARGO_ARGS="--target ${CARGO_TARGET}" }
script = [
"echo var: ${CARGO_TARGET}"
]
[tasks.run-test-app]
command = "cargo"
args = [ "run", "--manifest-path", "./wooting-analog-wrapper/Cargo.toml" ]
[tasks.member-build]
command = "cargo"
args = ["make", "build"]
[tasks.member-install-plugin]
command = "cargo"
args = ["make", "install-plugin"]
[tasks.test-app]
workspace = false
dependencies = [ "member-build", "member-install-plugin", "run-test-app" ]
[tasks.gen-headers]
[tasks.verify-headers]
[tasks.virtual-kb]
workspace = false
command="cargo"
args = ["run", "--manifest-path", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/wooting-analog-virtual-control/Cargo.toml"]
[tasks.install-plugin]
[tasks.install]
workspace = false
script_runner = "@shell"
script = [
'''
echo "Installing analog sdk to ${SDK_INSTALL_PATH}"
sudo install -Dm755 "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/debug/${FILENAME}" "${SDK_INSTALL_PATH}/${FILENAME}"
'''
]
dependencies = ["member-build", "member-install-plugin"]
[tasks.install.linux]
env = {FILENAME="libwooting_analog_sdk.so",SDK_INSTALL_PATH="/usr/lib"}
[tasks.install.windows]
env = {FILENAME="wooting_analog_sdk.dll",SDK_INSTALL_PATH="C:\\Program Files\\wooting-analog-sdk"}
script_runner = "powershell"
script_extension = "ps1"
script = [
'''
echo "Requesting admin powershell to install the wooting-analog-sdk"
$command = "New-Item -ItemType 'directory' -Force '${env:SDK_INSTALL_PATH}'; Copy-Item '${env:CARGO_MAKE_WORKING_DIRECTORY}\target\debug\${env:FILENAME}' '${env:SDK_INSTALL_PATH}\${env:FILENAME}' -Force"
echo $command
Start-Process PowerShell.exe -ArgumentList $command -Wait -Verb RunAs
'''
]
[tasks.install.mac]
env = {FILENAME="libwooting_analog_sdk.dylib",SDK_INSTALL_PATH="/usr/local/lib"}
[tasks.build-target-release]
workspace = false
description = "Makes a release build for a given target"
condition = { env_set = [ "TARGET" ]}
command = "cargo"
args = [
"build",
"--release",
"--all-features",
"--target",
"${TARGET}",
"--out-dir",
"${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/release-artifacts",
"-Z",
"unstable-options"
]
[tasks.build-deb]
dependencies = [ "build-target-release" ]