Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ $(RELEASE_AAB): version gradle-dependencies

$(RELEASE_TV_AAB): version gradle-dependencies
@echo "Building TV release AAB"
(cd android && ./gradlew test bundleRelease_tv)
(cd android && ./gradlew test bundleTvRelease -PPLATFORM=1)
install -C ./android/build/outputs/bundle/release_tv/android-release_tv.aab $@

tailscale-test.apk: version gradle-dependencies
Expand Down Expand Up @@ -279,9 +279,12 @@ bumposs: update-oss tailscale.version
source tailscale.version && git commit -sm "android: bump OSS" -m "OSS and Version updated to $${VERSION_LONG}" go.toolchain.rev android/build.gradle go.mod go.sum
source tailscale.version && git tag -a "$${VERSION_LONG}" -m "OSS and Version updated to $${VERSION_LONG}"

.PHONY: bump_version_code ## Bump the version code in build.gradle
bump_version_code:
sed -i'.bak' "s/versionCode .*/versionCode $$(expr $$(awk '/versionCode ([0-9]+)/{print $$2}' android/build.gradle) + 1)/" android/build.gradle && rm android/build.gradle.bak
## Set the version code for Android TV builds (platform=1)
.PHONY: set_version_code_tv
set_version_code_tv: tailscale.version
@source tailscale.version && \
sed -i'.bak' "s/versionCode .*/versionCode $$(( VERSION_MAJOR * 100000000 + VERSION_MINOR * 100000 + VERSION_PATCH * 10 + 1 ))/" android/build.gradle && \
rm android/build.gradle.bak

.PHONY: update-oss ## Update the tailscale.com go module
update-oss:
Expand Down
14 changes: 13 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
defaultConfig {
minSdkVersion 26
targetSdkVersion 35
versionCode 615
versionCode computeVersionCode()
versionName getVersionProperty("VERSION_LONG")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -195,3 +195,15 @@ def getVersionProperty(key) {
versionProps.load(project.file('../tailscale.version').newDataInputStream())
return versionProps.getProperty(key).replaceAll('^\"|\"$', '')
}

def computeVersionCode() {
def versionProps = new Properties()
versionProps.load(project.file('../tailscale.version').newDataInputStream())

def major = versionProps.getProperty('VERSION_MAJOR') as int
def minor = versionProps.getProperty('VERSION_MINOR') as int
def patch = versionProps.getProperty('VERSION_PATCH') as int
def platform = (project.findProperty('PLATFORM') ?: '0') as int

return major * 100000000 + minor * 100000 + patch * 10 + platform
}
2 changes: 1 addition & 1 deletion docker/DockerFile.amd64-build
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ RUN chmod 755 android/gradlew && \
./android/gradlew

# Build the android app, bump the playstore version code, and make the tv release
CMD make clean && make release && make bump_version_code && make release-tv
CMD make clean && make release && make release-tv
Loading