-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.R
72 lines (60 loc) · 2.36 KB
/
build.R
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
############################################### #############################
### build_vvmover.R
############################################### #############################
### R code for Student Analytics VU University Amsterdam
### Copyright 2018 VU
### Web Page: http://www.vu.nl
### Contact: Theo Bakker ([email protected])
###
### Filename: build_vvMover.R
### Purpose: This script is used to build and release the vvmover pacakge
###
### Dependencies: None
###
### Datasets used: Datasets
###
### Comments:
### 1) None
###
############################################### #############################
### TODO:
### 1) None
###
############################################### #############################
### History:
### 28-09-2018: JvZ: Create file
############################################### #############################
##
## =============================================== ==============================
## Install and load the packages
build_packages <- c("devtools",
"usethis",
"renv")
## install the packages that are not installed yet
lapply(build_packages[which(!build_packages %in% installed.packages())],
install.packages)
renv::load("../sa-scripts/")
## Set project name
package_name <- basename(rstudioapi::getActiveProject())
## load the packages
invisible(lapply(build_packages,
library,
character.only = TRUE))
## =============================================== ==============================
## Build the new vusa package
## Check if the package is correct and can be built.
devtools::document()
devtools::check(manual = T)
devtools::build_manual(path = paste0("G:/DSZ/SA2016/Datasets/Packages/package_man/", package_name, "/"))
## Commit your changes in Smartgit (or manually in the terminal, next to console)
# If you don't do this, you will get the question with the (use_version) command below:
#There are uncommitted changes and you're about to bump version
#Do you want to proceed anyway?
# Before answering this question you can also commit, but if you don't
# nothing is changed
## Increment the version number and check in that change in Git
usethis::use_version()
## Build the package, and release it to the correct folder
devtools::build(path = paste0("G:/DSZ/SA2016/Datasets/Packages/", package_name, "/"))
## Make use of the development version again
usethis::use_dev_version()