-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
33 lines (25 loc) · 846 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
#!/bin/bash
set -o errexit
PREGEX="^Package: "
PKG=$(grep $PREGEX DESCRIPTION|sed "s/$PREGEX//")
echo Package from DESCRIPTION: $PKG
##R -e "update.packages()"
##R -e "if(!require(devtools))install.packages('devtools');devtools::install_dev_deps()"
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/")
echo Installing $PKG_TGZ
$RCMD INSTALL $PKG_TGZ
echo checking as usual
$RCMD check --as-cran $PKG_TGZ