Skip to content

Commit 53be876

Browse files
authored
Makefile: bump API level to 36 (#826)
Sets gradle.properties for API level that is shared across various tooling steps. updates tailscale/corp#40476 Signed-off-by: Will Hannah <willh@tailscale.com>
1 parent 235e986 commit 53be876

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# with this name, it will be used.
1111
#
1212
# The convention here is tailscale-android-build-amd64-<date>
13-
DOCKER_IMAGE := tailscale-android-build-amd64-070325-1
13+
DOCKER_IMAGE := tailscale-android-build-amd64-072226-2
1414

1515
# The integration test image contains the Android emulator, system image, SDK,
1616
# build-tools, NDK, adb, and helper tools needed to run the emulator-backed Go
@@ -27,6 +27,15 @@ export TS_USE_TOOLCHAIN=1
2727
# affordances for debugging it.
2828
GOMOBILE_BUILD_TAGS := ts_omit_cachenetmap
2929

30+
# Pull androidApiLevel from gradle.properties.
31+
ANDROID_API_LEVEL := $(shell grep '^androidApiLevel=' android/gradle.properties | cut -d'=' -f2)
32+
33+
ifeq ($(ANDROID_API_LEVEL),)
34+
$(error androidApiLevel missing from android/gradle.properties)
35+
endif
36+
37+
ANDROID_BUILD_TOOLS_VERSION := $(shell grep '^androidBuildToolsVersion=' android/gradle.properties | cut -d'=' -f2)
38+
3039
DEBUG_APK := tailscale-debug.apk
3140
RELEASE_AAB := tailscale-release.aab
3241
RELEASE_TV_AAB := tailscale-tv-release.aab
@@ -47,7 +56,7 @@ else
4756
ANDROID_TOOLS_URL := "https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip"
4857
ANDROID_TOOLS_SUM := "2072ffce4f54cdc0e6d2074d2f381e7e579b7d63e915c220b96a7db95b2900ee commandlinetools-mac-9477386_latest.zip"
4958
endif
50-
ANDROID_SDK_PACKAGES := 'platforms;android-34' 'extras;android;m2repository' 'ndk;23.1.7779620' 'platform-tools' 'build-tools;34.0.0'
59+
ANDROID_SDK_PACKAGES := 'platforms;android-$(ANDROID_API_LEVEL)' 'extras;android;m2repository' 'ndk;23.1.7779620' 'platform-tools' 'build-tools;$(ANDROID_BUILD_TOOLS_VERSION)'
5160

5261
# Attempt to find an ANDROID_SDK_ROOT / ANDROID_HOME based either from
5362
# preexisting environment or common locations.
@@ -91,7 +100,7 @@ else
91100
export PATH := $(JAVA_HOME)/bin:$(PATH)
92101
endif
93102

94-
AVD_BASE_IMAGE := "system-images;android-33;google_apis;"
103+
AVD_BASE_IMAGE := 'system-images;android-$(ANDROID_API_LEVEL);google_apis;'
95104
export HOST_ARCH := $(shell uname -m)
96105
ifeq ($(HOST_ARCH),aarch64)
97106
AVD_IMAGE := "$(AVD_BASE_IMAGE)arm64-v8a"

android/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
3232
apply plugin: 'com.ncorti.ktfmt.gradle'
3333

3434
android {
35+
def androidApiLevel = providers.gradleProperty("androidApiLevel").get().toInteger()
36+
3537
ndkVersion "23.1.7779620"
36-
compileSdkVersion 36
38+
compileSdkVersion androidApiLevel
3739
defaultConfig {
3840
minSdkVersion 26
39-
targetSdkVersion 36
41+
targetSdkVersion androidApiLevel
4042
// versionCode is written here by `make bumposs` / `make tag_release`
4143
// (base = major*100000000 + minor*100000 + patch*10). AndroidTV builds
4244
// increment this by 1 in the Makefile's release-tv target so the two

android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
androidApiLevel=36
2+
androidBuildToolsVersion=36.0.0
13
android.defaults.buildfeatures.buildconfig=true
24
android.nonFinalResIds=false
35
android.nonTransitiveRClass=true

docker/DockerFile.amd64-build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is a Dockerfile for creating a build environment for
22
# tailscale-android.
33

4-
FROM --platform=linux/amd64 eclipse-temurin:21
4+
FROM --platform=linux/amd64 eclipse-temurin:21-jdk-jammy
55

66
ENV HOME /build
77
ENV ANDROID_HOME $HOME/android-sdk
@@ -24,13 +24,14 @@ RUN chmod 755 /tmp/docker-build-apt-get.sh && \
2424
# to run "go run tailscale.com/cmd/printdep" to figure out which Tailscale Go
2525
# version we need later, but otherwise this toolchain isn't used:
2626
RUN \
27-
curl -L https://go.dev/dl/go1.24.1.linux-amd64.tar.gz | tar -C /usr/local -zxv && \
27+
curl -L https://go.dev/dl/go1.26.5.linux-amd64.tar.gz | tar -C /usr/local -zxv && \
2828
ln -s /usr/local/go/bin/go /usr/bin
2929

3030
RUN git config --global --add safe.directory $HOME/tailscale-android
3131
WORKDIR $HOME/tailscale-android
3232

3333
COPY Makefile Makefile
34+
COPY android/gradle.properties android/gradle.properties
3435

3536
# Get android sdk, ndk, and rest of the stuff needed to build the android app.
3637
RUN make androidsdk

0 commit comments

Comments
 (0)