fieldnotes/Makefile

81 lines
2.2 KiB
Makefile

export PATH := $(PATH):./node_modules/.bin
ANDROID_RELEASE_STOREPASS ?= NotSoSecret
ANDROID_RELEASE_KEYPASS ?= NotSoSecret
init: clear
# Install gomobile
GO111MODULE=off go get -u golang.org/x/mobile/cmd/gomobile
npm install
audit:
npm audit
serve:
npm start
install-android:
adb reverse tcp:8081 tcp:8081
react-native run-android --appIdSuffix debug
android-debug:
adb shell input keyevent 82
android-bridge:
rm -rf build/android build/reachview-sources.jar
mkdir -p build/android
gomobile bind -v -javapkg com.pyxis.orion -target android -o build/android/reachview.aar forge.cadoles.com/Pyxis/fieldnotes/bridge/reachview
cp build/android/reachview.aar android/app/libs/reachview.aar
rm -rf build/android/jar
mkdir -p build/android/jar
unzip -d build/android/jar build/android/reachview-sources.jar
android-release:
rm -rf ./android/.gradle ./android/.idea
cd ./android && ./gradlew cleanBuildCache
cd ./android && ./gradlew build --refresh-dependencies
cd ./android && ./gradlew assembleRelease --info --stacktrace
ci-image:
docker build -t pyxis-fieldnotes-ci containers/ci
ci-release: ci-image
docker run \
--rm -it \
-v $(PWD):/project:ro \
-e "ANDROID_RELEASE_KEY_STOREPASS=NotSoSecret" \
-e "ANDROID_RELEASE_KEY_KEYPASS=NotSoSecret" \
pyxis-fieldnotes-ci:latest \
bash -c "\
mkdir /workdir \
&& cp -rT /project /workdir \
&& rm -f /workdir/android/local.properties \
&& rm -f /workdir/android/app/release.keystore \
&& rm -rf /workdir/node_modules \
&& cd /workdir \
&& make init \
&& npm cache clean --force \
&& /usr/local/bin/configure-gradle-keystore \
&& make android-release \
"
android-log:
adb logcat -s 'fieldnotes:*'
clear:
# Fix https://github.com/facebook/react-native/issues/4968
rm -rf ./node_modules ./build
rm -rf /tmp/metro-bundler-cache-*
rm -rf /tmp/haste-map-react-native-packager-*
changelog:
git-chglog --next-tag develop > CHANGELOG.md
new-keystore:
keytool -genkey -noprompt \
-alias fieldnotes \
-dname "CN=cadoles.com, OU=Dev, O=Cadoles, L=Dijon, S=Bourgogne-FrancheComté, C=FR" \
-keystore "build/new.keystore" \
-storepass "$(ANDROID_RELEASE_STOREPASS)" \
-keypass "$(ANDROID_RELEASE_KEYPASS)"
.PHONY: serve init clear