-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
32 lines (22 loc) · 804 Bytes
/
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
# Makefile for testapp.R
all : test
.PHONY : all
test :
cd scripts && ./runtests.R --quitonerror
OBJS = scripts/*R
# work around doubled files when zipping on Mac OS X
export COPYFILE_DISABLE = true
SNAPSHOT_VERSION := $(shell git rev-parse --short HEAD)
TAG_VERSION := $(shell git describe --tags)
reversion:
perl -pi -e "s/app\.version <- '.*'/app\.version <- '$(TAG_VERSION)'/" scripts/testapp-config.R
snapshot: $(OBJS) reversion
tar cvfz testapp-$(SNAPSHOT_VERSION).tgz $(OBJS)
# release does the following
# confirms we're on the master branch
# confirms we're up to date
# builds a tgz file of stuff to be deployed
release : $(OBJS) test reversion
- git branch | grep -q "* master" ;
- git status | grep -qi "nothing to commit"
tar cvfz testapp-$(TAG_VERSION).tgz $(OBJS)