forked from CyberShadow/ae
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakejson.sh
More file actions
executable file
·30 lines (24 loc) · 774 Bytes
/
makejson.sh
File metadata and controls
executable file
·30 lines (24 loc) · 774 Bytes
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
#!/bin/bash
set -eu
# Generate a JSON file usable with DAutoFix.
# Also create an all.d file, which can be used to run all unit tests.
IFS=$'\n'
packages=(
# These don't have any special *compile-time* dependencies.
# (We're not going to try to link the output.)
ae
ae:sqlite
)
rm -f files.txt
for package in "${packages[@]}"
do
dub describe "$package" > describe.json
jq -r --arg package "$package" '.packages[] | select(.name == $package) | .files[] | select(.role == "source") | .path' describe.json >> files.txt
done
mapfile -t files < files.txt
rm files.txt describe.json
dmd -o- -dw -Xfae.json "${files[@]}"
(
echo "deprecated module ae.all;"
printf '%s\n' "${files[@]}" | sed 's#^\(.*\)\.d$#import ae/\1;#g' | grep -v "package;" | sed s#/#.#g
) > all.d