|
| 1 | +# this script uses regex to edit the DESCRIPTION file within each of the Dash core |
| 2 | +# packages as required to test bleeding edge builds |
| 3 | +# |
| 4 | +# to avoid spurious versioning errors, we loosen the version restriction here so |
| 5 | +# that it is >= rather than the == format currently applied to release packages for |
| 6 | +# testing purposes only |
| 7 | + |
| 8 | +# capture DESCRIPTION data for dash, dashTable, dashCoreComponents, dashHtmlComponents |
| 9 | +dash_desc <- read.dcf("dashR/DESCRIPTION") |
| 10 | +dt_version <- read.dcf("dash-table/DESCRIPTION")[,"Version"] |
| 11 | +dcc_version <- read.dcf("dash-core-components/DESCRIPTION")[,"Version"] |
| 12 | +dhc_version <- read.dcf("dash-html-components/DESCRIPTION")[,"Version"] |
| 13 | + |
| 14 | +# capture Imports data for dashTable, dashCoreComponents, dashHtmlComponents |
| 15 | +imports <- dash_desc[,"Imports"][[1]] |
| 16 | + |
| 17 | +# loosen version restriction to prevent versioning errors at release time, |
| 18 | +# edit the Imports section of dash's DESCRIPTION as required, then update dash_desc |
| 19 | +imports <- gsub("==", ">=", imports, perl=TRUE) |
| 20 | + |
| 21 | +dash_desc[,"Imports"][[1]] <- imports |
| 22 | + |
| 23 | +# obtain the latest commit hash for dashTable, dashCoreComponents, dashHtmlComponents, and save |
| 24 | +dhc_hash <- system("cd dash-html-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE) |
| 25 | +dcc_hash <- system("cd dash-core-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE) |
| 26 | +dt_hash <- system("cd dash-table; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE) |
| 27 | +remotes <- dash_desc[,"Remotes"][[1]] |
| 28 | + |
| 29 | +# edit the Remotes section of dash's DESCRIPTION as required to update hashes, update dash_desc |
| 30 | +remotes <- gsub("((?<=plotly\\\\/dash-html-components@)([a-zA-Z0-9]+))", dhc_hash, remotes, perl=TRUE) |
| 31 | +remotes <- gsub("((?<=plotly\\\\/dash-core-components@)([a-zA-Z0-9]+))", dcc_hash, remotes, perl=TRUE) |
| 32 | +remotes <- gsub("((?<=plotly\\\\/dash-table@)([a-zA-Z0-9]+))", dt_hash, remotes, perl=TRUE) |
| 33 | +dash_desc[,"Remotes"][[1]] <- remotes |
| 34 | + |
| 35 | +# write the updated DESCRIPTION back to the dash package directory for installation |
| 36 | +write.dcf(dash_desc, "dashR/DESCRIPTION") |
0 commit comments