-
Notifications
You must be signed in to change notification settings - Fork 44
/
build-test-full.sh
executable file
·167 lines (147 loc) · 6.34 KB
/
build-test-full.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/bin/bash
## if second argument is "ghp", then push to github pages the html and pdf
## if second is "cran" another check, as in CRAN, that will detect things
## such as mc.cores > 2
V_R=$1
V_ADA=$(cat ./OncoSimulR/DESCRIPTION | grep Version | cut -d' ' -f2)
rm OncoSimulR_$V_ADA.tar.gz
rm ./OncoSimulR/Rplots.pdf
rm ./OncoSimulR/.Rhistory
rm ./OncoSimulR/*~
rm ./OncoSimulR/inst/*~
rm ./OncoSimulR/man/*~
rm ./OncoSimulR/man/Rplots.pdf
rm ./OncoSimulR/man/.Rhistory
rm ./OncoSimulR/tests/*~
rm ./OncoSimulR/tests/Rplots.pdf
rm ./OncoSimulR/tests/.Rhistory
rm ./OncoSimulR/data/*~
rm ./OncoSimulR/data/Rplots.pdf
rm ./OncoSimulR/data/.Rhistory
rm ./OncoSimulR/tests/testthat/*~
rm -r -f ./OncoSimulR/tests/testthat/_snaps
rm ./OncoSimulR/tests/testthat/Rplots.pdf
rm ./OncoSimulR/tests/testthat/.Rhistory
rm ./OncoSimulR/tests/manual/*~
rm ./OncoSimulR/tests/manual/Rplots.pdf
rm ./OncoSimulR/tests/manual/.Rhistory
rm ./OncoSimulR/R/*~
rm ./OncoSimulR/R/.Rhistory
rm ./OncoSimulR/R/Rplots.pdf
rm ./OncoSimulR/vignettes/*~
rm ./OncoSimulR/vignettes/OncoSimulR-tex.*
rm -r -f ./OncoSimulR/vignettes/OncoSimulR-tex_files
rm ./OncoSimulR/vignettes/rl1.txt
rm ./OncoSimulR/vignettes/Rplots.pdf
rm ./OncoSimulR/vignettes/.Rhistory
rm ./OncoSimulR/src/*.so
rm ./OncoSimulR/src/*~
rm ./OncoSimulR/src/*.o
rm ./OncoSimulR/src/*.gcda
rm ./OncoSimulR/src/*.gcno
rm ./OncoSimulR/src/OncoSimulR.so
rm ./OncoSimulR/src/OncoSimul.o
rm ./OncoSimulR/src/OncoSimulR_init.o
rm ./OncoSimulR/src/symbols.rds
rm /OncoSimulR.Rcheck/* -r -f
rm ./OncoSimulR.Rcheck/* -r -f
# rm ./OncoSimulR/inst/doc/auto/*
# rmdir ./OncoSimulR/inst/doc/auto
rm ./OncoSimulR/vignettes/auto/*
rmdir ./OncoSimulR/vignettes/auto
rm ./OncoSimulR/vignettes/figure/*
rmdir ./OncoSimulR/vignettes/figure
rm ./OncoSimulR/vignettes/*.bbl
rm ./OncoSimulR/vignettes/*.aux
rm ./OncoSimulR/vignettes/*.toc
rm ./OncoSimulR/vignettes/OncoSimulR.tex
rm ./OncoSimulR/vignettes/OncoSimulR.html
cp ./OncoSimulR/vignettes/hurlbut.pdf ./OncoSimulR/vignettes/hurlbutpdft
rm ./OncoSimulR/vignettes/*.pdf
mv ./OncoSimulR/vignettes/hurlbutpdft ./OncoSimulR/vignettes/hurlbut.pdf
rm ./OncoSimulR/vignettes/*.log
rm ./OncoSimulR/vignettes/*.out
rm ./OncoSimulR/vignettes/*.blg
rm ./OncoSimulR/vignettes/*.synctex.*
rm ./OncoSimulR/src/liblandscape.a
rm ./OncoSimulR/src/fl_statistics
rm ./OncoSimulR/src/fl_generate
rm ./OncoSimulR/src/fl_genchains
rm ./OncoSimulR/src/FitnessLandscape/*.o
rm ./OncoSimulR/src/FitnessLandscape/*~
## Next not needed in the BioC script, as the directory has been rm'ed
## and populated only with c and h files.
make -C ./OncoSimulR/src/FitnessLandscape clean
## We always do this, though it should not be necessary
sed -i 's/^};$/}/' ./OncoSimulR/src/FitnessLandscape/generalized_chain.c
# echo " ************************************** "
# echo " ********** R CMD build *********** "
# echo ""
# time $V_R CMD build --keep-empty-dirs OncoSimulR
# echo " "
# echo " ======= done R CMD build ======= "
# echo " "
# ## time $V_R CMD build --keep-empty-dirs --resave-data OncoSimulR
# echo " ************************************** "
# echo " ********* R CMD check ********** "
# echo " "
# time $V_R CMD check --no-vignettes --timings OncoSimulR_$V_ADA.tar.gz
# echo " "
# echo " ======= done R CMD check ======= "
# echo " "
# ## time $V_R CMD check --as-cran --no-vignettes --timings OncoSimulR_$V_ADA.tar.gz
# echo " ******************************************* "
# echo " ******* long manual tests ************ "
# $V_R CMD INSTALL --install-tests OncoSimulR_$V_ADA.tar.gz
# time $V_R -e 'library(OncoSimulR); library(testthat); library(gtools); library(smatr); test_dir("./OncoSimulR/tests/manual/")'
# echo " "
# echo " ======= done long manual tests ======= "
# echo " "
## Remember we can also import Renviron in .Rprofile
export R_CHECK_ENVIRON="~/.R/Renviron.bioc" ## see https://bioconductor.org/checkResults/devel/bioc-LATEST/Renviron.bioc
echo " ************************************** "
echo " ********** R CMD build --vanilla *********** "
echo ""
time R_ENVIRON_USER="~/.R/Renviron.bioc" $V_R --no-site-file --no-init-file --no-save --no-restore CMD build --keep-empty-dirs --no-resave-data OncoSimulR
echo " "
echo " ======= done R CMD build --vanilla ======= "
echo " "
echo " ************************************** "
echo " ********* R CMD check --vanilla ********** "
echo " "
time R_ENVIRON_USER="~/.R/Renviron.bioc" $V_R --no-site-file --no-init-file --no-save --no-restore CMD check --no-vignettes --timings OncoSimulR_$V_ADA.tar.gz
echo " "
echo " ======= done R CMD check --vanilla ======= "
echo " "
echo " ======= installing with tests "
R_ENVIRON_USER="~/.R/Renviron.bioc" $V_R --no-site-file --no-init-file --no-save --no-restore CMD INSTALL --install-tests OncoSimulR_$V_ADA.tar.gz
# echo " ******************************************* "
# echo " ******* long manual tests ************ "
# $V_R CMD INSTALL --install-tests OncoSimulR_$V_ADA.tar.gz
# time $V_R -e 'library(OncoSimulR); library(testthat); library(gtools); library(smatr); test_dir("./OncoSimulR/tests/manual/")'
# echo " "
# echo " ======= done long manual tests ======= "
## To do it the Hadley way
## Rscript --vanilla -e 'library(devtools); devtools::check("OncoSimulR", document = FALSE)'
## But: I set document to FALSE, as it insists on roxygen. And the above
## will CHANGE files if it deems appropriate (e.g., RcppExports) without
## asking you. However, it can point out things that I miss with the
## BUILD and check. So do it in a tmp directory or git checkout changes.
if [ "$2" = "ghp" ]; then
./ghp.sh
# cd ./OncoSimulR/vignettes
# Rscript -e 'library(rmarkdown); library(BiocStyle); render("OncoSimulR.Rmd")'
# mv OncoSimulR.html ../../../oncosimul-gh-pages/.
# Rscript -e 'library(rmarkdown); library(BiocStyle); library(bookdown); render("OncoSimulR.Rmd", output_format = bookdown::pdf_document2(toc = TRUE, toc_depth = 4, keep_tex = TRUE))'
# mv OncoSimulR.pdf ../../../oncosimul-gh-pages/pdfs/.
# rm -r -f OncoSimulR_files
# rm OncoSimulR.tex
# rm OncoSimulR.synctex.gz
# cd ../../../oncosimul-gh-pages
# gv=$(git rev-parse --short HEAD)
# echo " **** Now, Commit and push, if appropriate, including gh-pages. We are at " $gv
fi
## for very paranoid checks
if [ "$2" = "cran" ]; then
$V_R --vanilla CMD check --as-cran --timings OncoSimulR_$V_ADA.tar.gz
fi