-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-package.R
83 lines (73 loc) · 2.78 KB
/
build-package.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
# Data Repository of the Brazilian Soil
# Alessandro Samuel-Rosa
# Test package #####################################################################################
# Dependencies
update(remotes::package_deps(packages = "febr"))
update(remotes::package_deps(packages = "devtools"))
# Reverse dependency tools
devtools::revdep("febr-package/")
# Render README
rmarkdown::render("febr-package/README.Rmd")
# check documentation ----
roxygen2::roxygenise("febr-package/")
devtools::check_man("febr-package/")
devtools::spell_check("febr-package/", vignettes = FALSE)
# spelling::update_wordlist("febr-package/")
# check examples ----
devtools::run_examples("febr-package/")
# check for Linux (local) ----
devtools::check("febr-package/", manual = TRUE, run_dont_test = TRUE)
# check for Windows (remote) ----
devtools::check_win_oldrelease("febr-package/")
devtools::check_win_release("febr-package/")
devtools::check_win_devel("febr-package/")
# check in R-hub ----
# rhub::validate_email(email = "[email protected]")
# rhub::check_on_windows()
# rhub::platforms()
platforms <- c("fedora-clang-devel",
"ubuntu-gcc-release", "debian-clang-devel", "windows-x86_64-devel")
devtools::check_rhub("febr-package/", platforms = platforms)
devtools::build()
# Load package
devtools::load_all("febr-package")
# Build package site
if (!require(pkgdown)) {
install.packages("pkgdown")
}
pkgdown::build_site("febr-package")
html_files <- list.files(path = "febr-package/docs", pattern = ".html", recursive = TRUE, full.names = TRUE)
for (con in html_files) {
x <- readLines(con)
x <- sub("View on CRAN", "Ver no CRAN", x)
x <- sub("Browse source code", "Navegue pelo código fonte", x)
x <- sub("Report a bug", "Reporte um problema", x)
x <- sub("License", "Licença", x)
x <- sub("Developers", "Desenvolvedores", x)
x <- sub("Authors", "Autores", x)
x <- sub("Author", "Autor", x)
x <- sub("maintainer", "mantenedor", x)
x <- sub("Funder", "Financiador", x)
x <- sub("Contributor", "Contribuinte", x)
x <- sub("More about authors", "Mais sobre autores", x)
x <- sub("Developed by", "Desenvolvido por", x)
x <- sub("Site built with", "Página construída com", x)
x <- sub("Contents", "Conteúdo", x)
x <- sub("Citation", "Citação", x)
x <- sub("Citing", "Citando", x)
x <- sub("Reference", "Referência", x)
x <- sub("Source:", "Fonte:", x)
writeLines(x, con)
}
if (dir.exists("~/projects/web/pedometria.org/static/software/febr")) {
system("cp -a febr-package/docs/. ~/projects/web/pedometria.org/static/software/febr")
}
# pkgdown::preview_site("febr-package")
# pkgdown::build_articles()
# pkgdown::build_home()
# pkgdown::build_reference()
# pkgdown::build_news()
# turn on/off development mode
# devtools::dev_mode()
# upload to CRAN
devtools::release("febr-package", check = FALSE)