forked from rdiaz02/OncoSimul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test-full.sh
executable file
·191 lines (165 loc) · 6.77 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/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 ./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
rm ./OncoSimulR/vignettes/*.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/*~
make -C ./OncoSimulR/src/FitnessLandscape clean
# 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 " "
export R_CHECK_ENVIRON="~/.R/check.Renviron"
echo " ************************************** "
echo " ********** R CMD build --vanilla *********** "
echo ""
time $V_R --vanilla CMD build --no-resave-data --keep-empty-dirs OncoSimulR
echo " "
echo " ======= done R CMD build --vanilla ======= "
echo " "
## time $V_R CMD build --keep-empty-dirs --resave-data OncoSimulR
echo " ************************************** "
echo " ********* R CMD check --vanilla ********** "
echo " "
time $V_R --vanilla CMD check --no-vignettes --timings OncoSimulR_$V_ADA.tar.gz
echo " "
echo " ======= done R CMD check --vanilla ======= "
echo " "
echo " ======= installing with tests "
$V_R --vanilla CMD INSTALL --install-tests OncoSimulR_$V_ADA.tar.gz
## No, these tests take several hours and obscure previous output.
## Run them with the appropriate script (test-manual-continuously.R)
# ## time $V_R CMD check --as-cran --no-vignettes --timings OncoSimulR_$V_ADA.tar.gz
# echo " ******************************************* "
# echo " ******* long manual tests --vanilla ************ "
# $V_R CMD INSTALL --install-tests OncoSimulR_$V_ADA.tar.gz
# echo " ======= done long manual tests --vanilla ======= "
# echo " "
# 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 ======= "
## --force-multiarch in windoze?
## 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