-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev_history.R
89 lines (71 loc) · 3.25 KB
/
dev_history.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
require(usethis)
require(devtools)
require(attachment)
require(pkgdown)
require(dplyr)
## See tutorials here : https://rtask.thinkr.fr/blog/rmd-first-when-development-starts-with-documentation/ and here : https://stateofther.github.io/finistR2019/d-mypkg.html and here https://jef.works/blog/2019/02/17/automate-testing-of-your-R-package/
## and https://usethis.r-lib.org/articles/articles/usethis-setup.html
## and video here : http://www.user2019.fr/static/pres/t257651.zip
## create the package
usethis::create_package("/home/ptaconet/eodataflow")
## Manual step : Create a dev_history.R file that archives all the package history steps. Then copy it to the package folder.
## Then proceed :
usethis::use_build_ignore("dev_history.R")
usethis::use_git()
usethis::use_git_ignore("dev_history.R")
usethis::use_gpl3_license()
devtools::check()
usethis::proj_get()
## Manual steps : If not installed, install these packages
# system("brew install libssh2")
# system("brew install libgit2")
# install.packages("git2r")
## Manual step : Fill-in DESCRIPTION file with title and description of the package
## Manual step : If not already done, add a local SSH key following the instructions here : https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
## Then proceed :
usethis::use_github()
devtools::install()
usethis::use_readme_rmd()
usethis::use_package("magrittr","dplyr","httr","sf","purrr","lubridate","xml2","stringr","rvest","utils","parallel","curl")
# pour que les vignettes s'installent : ajouter VignetteBuilder: knitr dans le DESCRIPTION file
# Intégration continue avec Travis-CI
usethis::use_travis()
## Manual step : Commit and push
## Document functions and dependencies
attachment::att_to_description()
## Check the package
devtools::check()
usethis::use_testthat()
## Manual step : Add example dataset in inst/example-data
#usethis::use_vignette("aa-exploration")
# Document functions and dependencies
attachment::att_to_description()
# Check the package
devtools::check()
devtools::document()
# For CRAN-like check
devtools::check(args = c('--as-cran'))
#then :
devtools::install(build_vignettes = TRUE)
devtools::test() #reloads your code with load_all(), then runs all testthat tests.
## Ajouter manuellement dans le description file, la liste des packages dont dépend le package
roi_modis2tiles<-"/home/ptaconet/Documents/modis2tiles.gpkg"
file.copy(roi_modis2tiles,gsub("Documents","opendapr/inst/extdata",roi_modis2tiles))
### To add a config file with username and password to usgs. More info : https://db.rstudio.com/best-practices/managing-credentials/
file.create("config.yml")
usethis::use_build_ignore("config.yml")
usethis::use_git_ignore("config.yml")
## To build vignettes
devtools::build_vignettes() # ne pas oublier d'avoir ajouté au préalable VignetteBuilder: knitr dans le DESCRIPTION file
devtools::install(build_vignettes = TRUE)
devtools::install()
# to test build on windows
#check_win()
## To build a website with home and vignettes
usethis::use_package_doc()
usethis::use_tibble()
devtools::document()
pkgdown::build_site()
usethis::use_build_ignore("docs")
## Manual step : go to the settings of the package on the github page, then under "github page" put "master branch /docs folder"
usethis::use_build_ignore(c("korhogo"))