Skip to content

Commit

Permalink
version increment rules
Browse files Browse the repository at this point in the history
  • Loading branch information
JnyJny committed Oct 27, 2015
1 parent 3e91bb2 commit ca68822
Showing 1 changed file with 40 additions and 16 deletions.
56 changes: 40 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@

TARGET= GameOfLife
VERSION= 0.0.14

MAJOR=0
MINOR=0
POINT=17
VERSION= ${MAJOR}.${MINOR}.${POINT}
QVERSION= "'${VERSION}'"
VERSION_FILE= VERSION
NEWPOINT = `expr $(POINT) + 1`
NEWMINOR = `expr $(MINOR) + 1`
NEWMAJOR = `expr $(MAJOR) + 1`
UPDTINIT = 's/__version__.*=.*/__version__ = ${QVERSION}/'
UPDTRDME = 's/Version: .*/Version: ${VERSION}/'

MAKEFILE= Makefile

PYTHON=python3
SETUP= setup.py
Expand All @@ -20,17 +30,33 @@ SED = sed
RM = rm
MV = mv

UPDTINIT = 's/__version__.*=.*/__version__ = ${QVERSION}/'
UPDTRDME = 's/Version: .*/Version: ${VERSION}/'

all:
@echo "make update - updates the version VERSION=${VERSION}"
@echo "make sdist - creates a source distribution"
@echo "make bdist - creates a binary distribution"
@echo "make wheel - creates a wheel distribution"
@echo "make test - runs unit tests"
@echo "make upload - uploads bdist_wheel to PYPI=${PYPI}"
@echo "make clean - removes all derived files and directories"
@echo "make sdist - creates a source distribution"
@echo "make bdist - creates a binary distribution"
@echo "make wheel - creates a wheel distribution"
@echo "make test - runs unit tests"
@echo "make upload - uploads bdist_wheel to PYPI=${PYPI}"
@echo "make clean - removes all derived files and directories"
@echo "make bump_major - increment the major version number MAJOR=${MAJOR}"
@echo "make bump_minor - increment the minor version number MINOR=${MINOR}"
@echo "make bump_point - increment the point version number POINT=${POINT}"
@echo "make update - updates the version VERSION=${VERSION}"


bump_major:
@${SED} "s/^MAJOR[ \t]*=[ \t]*[0-9]*/MAJOR=$(NEWMAJOR)/" \
${MAKEFILE} > ${MAKEFILE}.tmp
@${MV} ${MAKEFILE}.tmp ${MAKEFILE}

bump_minor:
@${SED} "s/^MINOR[ \t]*=[ \t]*[0-9]*/MINOR=$(NEWMINOR)/" \
${MAKEFILE} > ${MAKEFILE}.tmp
@${MV} ${MAKEFILE}.tmp ${MAKEFILE}

bump_point:
@${SED} "s/^POINT[ \t]*=[ \t]*[0-9]*/POINT=$(NEWPOINT)/" \
${MAKEFILE} > ${MAKEFILE}.tmp
@${MV} ${MAKEFILE}.tmp ${MAKEFILE}

update:
@echo ${VERSION} > ${VERSION_FILE}
Expand All @@ -39,9 +65,8 @@ update:
@${SED} -e ${UPDTRDME} ${README} > ${README}.tmp
@${MV} ${README}.tmp ${README}


tag:
git add ${PKG_INIT}
git commit -m "Version ${VERSION}"
git tag ${VERSION}
git push origin ${VERSION}

Expand All @@ -55,14 +80,13 @@ bdist:
${PYSETUP} build bdist

test:
${PYSETUP} test
${PYSETUP} test -q

# switch to twine?

upload:
$(PYSETUP) bdist_wheel upload -r ${PYPI}


clean:
@${PYSETUP} clean
@${RM} -rf ${TMPFILES}

0 comments on commit ca68822

Please sign in to comment.