@ -3,7 +3,7 @@
# license that can be found in the LICENSE file.
# license that can be found in the LICENSE file.
## For signed release build JKS_PASSWORD must be set to the password for the jks keystore
## For signed release build JKS_PASSWORD must be set to the password for the jks keystore
## and tailscale.jks must be present in the repo root .
## and JKS_PATH must be set to the path to the jks keystore .
DEBUG_APK = tailscale-debug.apk
DEBUG_APK = tailscale-debug.apk
RELEASE_AAB = tailscale-release.aab
RELEASE_AAB = tailscale-release.aab
@ -84,8 +84,8 @@ apk: $(DEBUG_APK) ## Build the debug APK
tailscale-debug : $( DEBUG_APK ) ## Build the debug APK
tailscale-debug : $( DEBUG_APK ) ## Build the debug APK
.PHONY : release
.PHONY : release
release : tailscale.jks $( RELEASE_AAB ) ## Build the release AAB
release : jarsign-env $( RELEASE_AAB ) ## Build the release AAB
jarsigner -sigalg SHA256withRSA -digestalg SHA-256 -keystore tailscale.jks -storepass $( JKS_PASSWORD) $( RELEASE_AAB) tailscale
jarsigner -sigalg SHA256withRSA -digestalg SHA-256 -keystore $( JKS_PATH) -storepass $( JKS_PASSWORD) $( RELEASE_AAB) tailscale
# gradle-dependencies groups together the android sources and libtailscale needed to assemble tests/debug/release builds.
# gradle-dependencies groups together the android sources and libtailscale needed to assemble tests/debug/release builds.
.PHONY : gradle -dependencies
.PHONY : gradle -dependencies
@ -140,6 +140,21 @@ env:
@echo JAVA_HOME = $( JAVA_HOME)
@echo JAVA_HOME = $( JAVA_HOME)
@echo TOOLCHAINDIR = $( TOOLCHAINDIR)
@echo TOOLCHAINDIR = $( TOOLCHAINDIR)
# Ensure that JKS_PATH and JKS_PASSWORD are set before we attempt a build
# that requires signing.
.PHONY : jarsign -env
jarsign-env :
i f e q ( $( JKS_PATH ) , )
$( error JKS_PATH is not set. export JKS_PATH = /path/to/tailcale.jks)
e n d i f
i f e q ( $( JKS_PASSWORD ) , )
$( error JKS_PASSWORD is not set. export JKS_PASSWORD = passwordForTailcale.jks)
e n d i f
i f e q ( $( wildcard $ ( JKS_PATH ) ) , )
$( error JKS_PATH does not point to a file)
e n d i f
@echo " keystore path set to $( JKS_PATH) "
.PHONY : androidpath
.PHONY : androidpath
androidpath :
androidpath :
@echo " export ANDROID_HOME= $( ANDROID_HOME) "
@echo " export ANDROID_HOME= $( ANDROID_HOME) "
@ -204,8 +219,8 @@ docker-build-image: ## Builds the docker image for the android build environment
docker build -f docker/DockerFile.amd64-build -t tailscale-android-build-amd64 .
docker build -f docker/DockerFile.amd64-build -t tailscale-android-build-amd64 .
.PHONY : docker -run -build
.PHONY : docker -run -build
docker-run-build : tailscale.jks docker -build -image ## Runs the docker image for the android build environment and builds release
docker-run-build : jarsign-env docker -build -image ## Runs the docker image for the android build environment and builds release
@docker run -v $( CURDIR) :/build/tailscale-android --env JKS_PASSWORD = $( JKS_PASSWORD) tailscale-android-build-amd64
@docker run -v $( CURDIR) :/build/tailscale-android --env JKS_PASSWORD = $( JKS_PASSWORD) --env JKS_PATH = $( JKS_PATH) tailscale-android-build-amd64
.PHONY : docker -remove -build -image
.PHONY : docker -remove -build -image
docker-remove-build-image : ## Removes all docker build image
docker-remove-build-image : ## Removes all docker build image