Skip to content

Commit 83040af

Browse files
Add release target
1 parent 8e3fa78 commit 83040af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ LIBRARY_ROOT := libs
44
JNI_DIR := ${CURDIR}/jni
55
EXTERNAL_DIR := ${CURDIR}/external
66
SQLCIPHER_DIR := ${EXTERNAL_DIR}/sqlcipher
7+
LICENSE := SQLCIPHER_LICENSE
8+
ASSETS_DIR := assets
9+
LATEST_TAG := $(shell git tag | sort -r | head -1)
10+
SECOND_LATEST_TAG := $(shell git tag | sort -r | head -2 | tail -1)
11+
RELEASE_DIR := "SQLCipher for Android ${LATEST_TAG}"
12+
CHANGE_LOG_HEADER := "Changes included in the ${LATEST_TAG} release of SQLCipher for Android:"
13+
README := ${RELEASE_DIR}/README
714

815
init:
916
git submodule update --init
@@ -26,7 +33,20 @@ build-java:
2633
cd ${CURDIR}/bin/classes && \
2734
jar -cvf sqlcipher.jar .
2835

36+
release:
37+
-rm -rf ${RELEASE_DIR}
38+
-rm ${RELEASE_DIR}.zip
39+
mkdir ${RELEASE_DIR}
40+
cp -R ${LIBRARY_ROOT} ${RELEASE_DIR}
41+
cp -R ${ASSETS_DIR} ${RELEASE_DIR}
42+
cp ${LICENSE} ${RELEASE_DIR}
43+
printf "%s\n\n" ${CHANGE_LOG_HEADER} > ${README}
44+
git log --pretty=format:' * %s' ${SECOND_LATEST_TAG}..${LATEST_TAG} >> ${README}
45+
zip -r ${RELEASE_DIR}.zip ${RELEASE_DIR}
46+
rm -rf ${RELEASE_DIR}
47+
2948
clean:
49+
-rm SQLCipher\ for\ Android\*.zip
3050
ant clean
3151
cd ${EXTERNAL_DIR} && ndk-build clean
3252
-cd ${SQLCIPHER_DIR} && make clean

0 commit comments

Comments
 (0)