forked from emichael/dslabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (57 loc) · 1.83 KB
/
Makefile
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
.PHONY: all test dependencies serve clean clean-all
.FORCE:
FRAMEWORK_FILES = $(shell find framework -type f | sed 's/ /\\ /g')
LAB_FILES = $(shell find labs -type f | sed 's/ /\\ /g')
HANDOUT_FILES = $(shell find handout-files -type f | sed 's/ /\\ /g')
JAR_FILES = build/libs/framework.jar \
build/libs/grader.jar \
build/libs/framework-sources.jar \
build/libs/grader-sources.jar \
build/libs/framework-deps.jar \
build/libs/grader-deps.jar \
build/libs/framework-deps-sources.jar
LICENSE_NOTICE = build/reports/licenses/THIRD-PARTY-NOTICES.txt
OTHER_FILES = build/doc/ lombok.config
ifeq ($(shell uname -s),Darwin)
CP = gcp
TAR = gtar
SED = gsed
else
CP = cp
TAR = tar
SED = sed
endif
all: build/handout/
dependencies:
./gradlew copyDependencies
build/libs/: $(FRAMEWORK_FILES)
./gradlew assemble
touch $@
build/doc/: $(FRAMEWORK_FILES)
./gradlew javadoc
touch $@
$(LICENSE_NOTICE): build.gradle
./gradlew generateLicenseReport
build/handout/: $(LAB_FILES) $(HANDOUT_FILES) $(OTHER_FILES) build/libs/ $(LICENSE_NOTICE)
rm -rf $@
mkdir $@ build/handout/jars
$(CP) -r labs handout-files/. $(OTHER_FILES) $@
$(CP) $(JAR_FILES) build/handout/jars
# Strip out the date from the license report for a reproducible build
$(SED) -Ez -e 's/This report was generated at .*//' $(LICENSE_NOTICE) > build/handout/jars/THIRD-PARTY-NOTICES.txt
build/handout.tar.gz: build/handout/
$(TAR) -czf $@ --transform "s/^build\/handout/dslabs/" $^
test:
./gradlew test
www/javadoc/: build/doc/
rsync -a --delete $< $@
build/www/: www/javadoc/ .FORCE
mkdir -p $@
cd ./www; bundle exec jekyll build -d ../$@
touch $@
serve: www/javadoc/
cd www; watchy -w _config.yml -- bundle exec jekyll serve --watch -d ../build/www/
clean:
rm -rf build www/javadoc www/.jekyll-cache
clean-all: clean
rm -rf deps .gradle traces