Skip to content

Commit

Permalink
fix: Use correct version in R tag target.
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Sep 14, 2022
1 parent 1576c3c commit d7cd6dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ tag: ## Bump version and tag
git add .
git commit -m "chore: Release v$(VERSION)"
git tag v$(VERSION)
# git push origin && git push origin --tags
git push origin && git push origin --tags

help: ## List all make tasks
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
20 changes: 10 additions & 10 deletions r/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=$(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
LOCAL_VERSION=$(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package DESCRIPTION | cut -d : -d \ -f 2)

R_FILES := $(wildcard R/*.R)
Expand All @@ -18,20 +18,20 @@ build: preinstall doc
mkdir build
mv man build
mv NAMESPACE build
mv $(PKG_NAME)_$(VERSION).tar.gz build/$(PKG_NAME)_$(VERSION)_R.tar.gz
mv $(PKG_NAME)_$(LOCAL_VERSION).tar.gz build/$(PKG_NAME)_$(LOCAL_VERSION)_R.tar.gz

build-nightly: preinstall
R CMD build .
rm -rf build
mkdir build
mv $(PKG_NAME)_$(VERSION).tar.gz build/$(PKG_NAME)_nightly_R.tar.gz
mv $(PKG_NAME)_$(LOCAL_VERSION).tar.gz build/$(PKG_NAME)_nightly_R.tar.gz

package0: doc $(PKG_NAME)_$(VERSION).tar.gz
$(PKG_NAME)_$(VERSION).tar.gz: $(PKG_FILES)
package0: doc $(PKG_NAME)_$(LOCAL_VERSION).tar.gz
$(PKG_NAME)_$(LOCAL_VERSION).tar.gz: $(PKG_FILES)
R CMD build .

check: $(PKG_NAME)_$(VERSION).tar.gz
R CMD check $(PKG_NAME)_$(VERSION).tar.gz
check: $(PKG_NAME)_$(LOCAL_VERSION).tar.gz
R CMD check $(PKG_NAME)_$(LOCAL_VERSION).tar.gz

doc:
Rscript -e '.libPaths(c("~/R_LIBS",.libPaths()));library(devtools);library(roxygen2);document()'
Expand All @@ -41,16 +41,16 @@ preinstall:
R -e 'install.packages(c("roxygen2","devtools","httr","stringr"), repos="http://cran.us.r-project.org")'

install:
R CMD INSTALL $(PKG_NAME)_$(VERSION).tar.gz
R CMD INSTALL $(PKG_NAME)_$(LOCAL_VERSION).tar.gz

uninstall: $(PKG_NAME)_$(VERSION).tar.gz
uninstall: $(PKG_NAME)_$(LOCAL_VERSION).tar.gz
R CMD REMOVE $(PKG_NAME)

.PHONY: tag
tag: # Bump version
$(SED) -i -r -e "s/Version.+/Version: $(VERSION)/" DESCRIPTION

uninstall: $(PKG_NAME)_$(VERSION).tar.gz
uninstall: $(PKG_NAME)_$(LOCAL_VERSION).tar.gz
R CMD REMOVE $(PKG_NAME)

clean:
Expand Down

0 comments on commit d7cd6dd

Please sign in to comment.