File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# # Notion Makefile
33# #
44
5+ export NOTION_RELEASE = $(shell ./version.sh)
6+
57# Include system-specific configuration: auto-generated and optionally local
68include build/system-inc.mk
79
@@ -49,16 +51,8 @@ snapshot:
4951 git checkout version.h
5052
5153dist :
52- PWD=` pwd` ; \
53- DIR=` basename " $$ PWD" ` ; \
5454 RELEASE=` ./nextversion.sh` ; \
55- perl -p -i -e " s/^#define NOTION_RELEASE.*/#define NOTION_RELEASE \" $$ RELEASE\" /" version.h ; \
56- git add version.h; git commit -m " Releasing version $$ RELEASE" ; \
57- git tag -s -m " Release $$ RELEASE" $$ RELEASE ; git push --tags ; \
58- git archive --prefix notion-$$ RELEASE/ --format=tar.gz $$ RELEASE > ../notion-$$ RELEASE-src.tar.gz ; \
59- git archive --prefix notion-$$ RELEASE/ --format=tar $$ RELEASE | bzip2 > ../notion-$$ RELEASE-src.tar.bz2 ; \
60- perl -p -i -e " s/^#define NOTION_RELEASE.*/#define NOTION_RELEASE \" snapshot\" /" version.h ; \
61- git add version.h; git commit -m " Released version $$ RELEASE" ; git push
55+ git tag -s -m " Release $$ RELEASE" $$ RELEASE ; git push --tags
6256
6357.PHONY : test
6458
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ LIBMAINLOOP_DIR = $(TOPDIR)/libmainloop
44LIBMAINLOOP_INCLUDES = -I$(TOPDIR )
55LIBMAINLOOP_LIBS = -L$(LIBMAINLOOP_DIR ) -lmainloop
66
7+ CFLAGS += -DNOTION_RELEASE='"$(NOTION_RELEASE ) "'
8+
79ifeq ($(wildcard $(TOPDIR ) /libtu/obj.h) ,)
810
911# External libtu, feel free to edit
Original file line number Diff line number Diff line change 1- #define NOTION_RELEASE "snapshot"
21#define NOTION_VERSION NOTION_RELEASE
32#define NOTION_API_VERSION NOTION_RELEASE
43
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Determines the currently checked-out version of Notion.
4+
5+ # Notion is distributed in source form through Git. Official releases are
6+ # identified by signed tags. This script will use the git command-line tool
7+ # to determine the version based on the latest tag and commit history.
8+
9+ # If the working directory is not a tag, the last tag is prepended to
10+ # the number of commits since the last tag plus the git hash.
11+
12+ # If the working directory is dirty, a timestamp is appended.
13+
14+ # If you absolutely require a source tarball, you can use the 'Download ZIP'
15+ # functionality. That zip will contain a directory called `notion-[xxx]`,
16+ # where `[xxx]` denotes the tag or branch from which the tarball was derived.
17+
18+ # Returns 0 and prints the version on stdout on success, without newline.
19+ # Returns a non-0 value on failure
20+
21+ set -e
22+
23+ if [ -e " .git" ]; then
24+ # Git:
25+ echo -n ` git describe`
26+ if [[ -n $( git status -s) ]]; then
27+ echo -n ` date +" +%Y%m%d-%H%M" `
28+ fi
29+ else
30+ # Not git, derive name from current directory as per github naming conventions:
31+ basename ` pwd` | sed ' /^notion-/!{q1}; {s/^notion-//}' | tr -d ' \\n'
32+ fi
You can’t perform that action at this time.
0 commit comments