File tree Expand file tree Collapse file tree 4 files changed +37
-10
lines changed Expand file tree Collapse file tree 4 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 2
2
# # Notion Makefile
3
3
# #
4
4
5
+ export NOTION_RELEASE = $(shell ./version.sh)
6
+
5
7
# Include system-specific configuration: auto-generated and optionally local
6
8
include build/system-inc.mk
7
9
@@ -49,16 +51,8 @@ snapshot:
49
51
git checkout version.h
50
52
51
53
dist :
52
- PWD=` pwd` ; \
53
- DIR=` basename " $$ PWD" ` ; \
54
54
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
62
56
63
57
.PHONY : test
64
58
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ LIBMAINLOOP_DIR = $(TOPDIR)/libmainloop
4
4
LIBMAINLOOP_INCLUDES = -I$(TOPDIR )
5
5
LIBMAINLOOP_LIBS = -L$(LIBMAINLOOP_DIR ) -lmainloop
6
6
7
+ CFLAGS += -DNOTION_RELEASE='"$(NOTION_RELEASE ) "'
8
+
7
9
ifeq ($(wildcard $(TOPDIR ) /libtu/obj.h) ,)
8
10
9
11
# External libtu, feel free to edit
Original file line number Diff line number Diff line change 1
- #define NOTION_RELEASE "snapshot"
2
1
#define NOTION_VERSION NOTION_RELEASE
3
2
#define NOTION_API_VERSION NOTION_RELEASE
4
3
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