-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
60 lines (46 loc) · 1.7 KB
/
build.ps1
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
# PLEASE USE ABSOLUTE PATHS
if ($IsLinux) {
$env:HDF5_LIB_DIR = "/home/leonardo/Documents/unige/hdf5/1.14.5/lib"
$env:HDF5_INCLUDE_DIR = "/home/leonardo/Documents/unige/hdf5/1.14.5/include"
$env:HDF5_BIN_DIR = "/home/leonardo/Documents/unige/hdf5/1.14.5/lib"
} else {
$env:HDF5_LIB_DIR = "C:/Users/Leonardo/Documents/unige/hdf5/1.14.5/lib"
$env:HDF5_INCLUDE_DIR = "C:/Users/Leonardo/Documents/unige/hdf5/1.14.5/include"
$env:HDF5_BIN_DIR = "C:/Users/Leonardo/Documents/unige/hdf5/1.14.5/bin"
}
function Script:PrintHelp {
$PrintText = @'
================================================================================
PYCODE
================================================================================
USAGE:
./build.ps1 COMMAND
AVAILABLE COMMANDS:
create-venv create a new virtual environment with the necessary
packages installed
develop build and install the library in the current venv
build build the pycode library
================================================================================
================================================================================
'@
Write-Host $PrintText
}
$bin_dir = "Scripts"
if ($IsLinux) {
$bin_dir = "bin"
}
switch($args[0]) {
"create-venv" {
python -m venv .venv
Invoke-Expression ".venv/$bin_dir/pip install maturin matplotlib"
}
"develop" {
Invoke-Expression "./.venv/$bin_dir/maturin develop"
}
"build" {
Invoke-Expression "./.venv/$bin_dir/maturin build"
}
default {
Script:PrintHelp
}
}