-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
31 lines (25 loc) · 849 Bytes
/
build.sh
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
#!/bin/bash
set -o errexit
PREGEX="^Package: "
PKG=$(grep $PREGEX DESCRIPTION|sed "s/$PREGEX//")
echo Package from DESCRIPTION: $PKG
R -e "if(require(inlinedocs))package.skeleton.dx('.')"
cd ..
RELEASE=$PKG-release
echo Copying $PKG to $RELEASE
rm -rf $RELEASE
cp -r $PKG $RELEASE
echo Editing $RELEASE for CRAN submission
grep -v Remotes $PKG/DESCRIPTION > $RELEASE/DESCRIPTION
rm $RELEASE/tests/testthat/*
cp $PKG/tests/testthat/test-CRAN*.R $RELEASE/tests/testthat
echo Building $RELEASE
RCMD="R --vanilla CMD"
$RCMD build $RELEASE | tee build.out
PKG_TGZ=$(grep building build.out|sed "s/.*\($PKG.*.tar.gz\).*/\1/")
# https://www.stats.ox.ac.uk/pub/bdr/Strict/00README.txt
export _R_USE_STRICT_R_HEADERS_=true
echo Installing $PKG_TGZ
$RCMD INSTALL $PKG_TGZ
echo Checking $PKG_TGZ
_R_CHECK_FORCE_SUGGESTS_=0 $RCMD check --as-cran $PKG_TGZ