Commit Graph

67 Commits (26e5e796fad5735f1d9290290170369c94c67c4b)

Author SHA1 Message Date
Jonathan Nobels 716152b57d
makefile: add bump_version_code recipe back (#464)
updates tailscale/corp#21644

The docker build sill requires the recipe for bumping
the version code by one before we run the second
androidTV build.  This was removed, which breaks the
build.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
3 months ago
Jonathan Nobels 76ab7eab92
makefile: fix bumposs to properly set version and tag (#456)
Updates #cleanup

bumposs was not properly setting the version.  Split the tasks
into separate recipes.  Simply calling make bumposs should
now generate a single commit with the proper versioning
in build.gradle.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels 32e48dc78e
makefile: consolidate bump/tag (#453)
Updates #cleanup

Bumping oss and tagging the release are now combined into a single step.   make bumposs will
now bump to the latest OSS, tag the commit and update the version number in build.gradle in
a single step.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels 6deb61a20e
android/docker: combine CMD invocations into a single line (#448)
android/docker: combine CMD into a single line

 updates tailscale/corp#21644

docker ignores all but the last CMD invocation.  These
have to be combined into a single line.  The clean is
redundant.  We run a clean on the mounted directory
before we kick off make docker-run-build.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels b9477c64a8
android/gradle: separate release and release_tv (#447)
updates tailscale/corp#21644

release_tv should init with the release target or it doesn't
build the right thing.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels 2f59feef20
android/makefile: add tv-specific build variant (#445)
android/makefile: add tv-specific build

 updates tailscale/corp#21644

This will build a second tailscale-release-tv.aab with the leanback flag set
suitable for submission for android-tv.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels 66fa3c41a6
docs/makefile: update docker build instructions (#442)
#cleanup

Updated the notes on refreshing docker build containers
Removed the jarsign output from the build as it contains
the jks password.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels dfda774dc0
makefile: reuse image and remove container for builds (#440)
Updates tailscale/corp#19670

Build optimization to reuse the existing build image and to
remove the individual containers post build.   Image name
is parameterized.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
4 months ago
Jonathan Nobels 80864fec12
android/makefile: make keystore path a parameter (#420)
Updates tailscale/corp#19670

This makes the keystore path a paramater so it's not
expected to be at the repo root, allowing the builder to
leave it where ever it lhappens to get written.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
5 months ago
Jonathan Nobels a74e30d4e2
android/docker: update makefile and dockerfile for build automation (#394)
android/docker: update makefile for build automation

Updates tailsale/corp#19670

Added a dockerfile to run the full release build in addition to the
shell environment.

The build will now look for JKS_PASSWORD in the environment for
completing the signing step without user interaction.

Several smaller recipes added to the makefile for building the
docker builder image, running and cleaning it up independently
to make debugging issues quicker.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
5 months ago
James Tucker 3f864b28c7
Makefile: clean up the Makefile (#354)
The Makefile has been through a lot of change in recent iterations and
is overdue another cleaning.

- Variables still in use are moved to the variable definition area at
  the top of the file
- Added three distinct sections separated by comment: android build, go
  build and utility tasks.
- Relocated tasks into one of those three sections as appropriate
- Removed intermediate phony targets from the APK builds, as they're
  just making the build harder to trace file wise.
- Shifted from a central PHONY definition to incrementally defined
  dependencies to ensure every non-file task is correctly marked.
- Switch the final APK moves to use install -C to avoid updating the
  target files unless actually necessary.
- Add some missing dependencies on some tasks, centralized the gradle
  dependencies into a single task for easier re-use.
- Remove some single-use variable definitions.
- Don't promote /bin to high in $PATH when $JAVA_HOME is un-set.

Updates #cleanup

Signed-off-by: James Tucker <james@tailscale.com>
7 months ago
kari-ts 39628be8a6
libtailscale, android: fix allow LAN access (#324)
-Exclude local routes in VPNServiceBuilder
-Maybe update TUN on new state update where state >= starting
-Clean up updateTUN

Updates tailscale/corp#18984
Updates tailscale/corp#18202

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts 81acaef5b7
android: rip android_legacy (#335)
Updates #cleanup
Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts 3e32e97261
Makefile: clean up legacy builds (#316)
-Remove legacy builds
-Update version number and name using last unstable

Updates tailscale/corp#18202
Fixes tailscale/corp#19001

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
Percy Wegmann 482b350ce0 android: add smoke test
The test verifies that one can log in via the UI and hit hello.ts.net.

Updates tailscale/corp#18202

Signed-off-by: Percy Wegmann <percy@tailscale.com>
7 months ago
kari-ts 38f57b4737
build.gradle, Makefile: remove custom fdroid build (#297)
We're no longer using GoogleSignIn, so there's no need for separate product flavors
Clean up unused dependencies
Updates tailscale/corp#18202

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
Percy Wegmann 54dccff232 android/ui: strip DWARF debug information from libtailscale
Reduces total size for 4 architectures from 59517778 to 33420646

Updates tailscale/corp#18202

Signed-off-by: Percy Wegmann <percy@tailscale.com>
8 months ago
Will Norris 9fcdcfe630 Makefile: add help text to make commands
Add `make help` command, which prints available commands and their
description.  I'm not 100% sure which commands should be documented, so
took an initial attempt at it.

This also makes `make help` the default command, aligning it with the
Makefiles in corp and oss.

Updates tailscale/corp#18202

Signed-off-by: Will Norris <will@tailscale.com>
8 months ago
James Tucker 4e923a65c1 *: introduce tool/go following our common pattern
- This tool/go does not currently invoke gocross, as there's more work to
do in gocross to be fully compatible with gomobile.
- Use GOBIN to target the output destinations for gomobile and gobind.
- Remove the old toolchain targets from the Makefile.
- Use ~/.cache/tailscale-go, like the OSS repo does.
- Introduce go.toolchain.rev as we have in the OSS repo, and update it in
the bumposs task.

Updates tailscale/corp#18202

Signed-off-by: James Tucker <james@tailscale.com>
8 months ago
James Tucker 2a14964878 Makefile: cleanup the new builds more
- Provide version flags to the build
- Add the new build targets to all
- Move the old fdroid and release builds close to their siblings
- Build gomobile into android/build/go for a small reduction in linker
  wait time
- Fix the test target so it's now triggering the gomobile build
- Make the install target use the new android build
- Add missing items to the clean target

Updates tailscale/corp#18202

Signed-off-by: James Tucker <james@tailscale.com>
8 months ago
James Tucker 244221706f Makefile: cleanup go mobile builds some
No need to build into /tmp, the go cache will handle this for us, we can
just use go run.

Updates tailscale/corp#18202

Signed-off-by: James Tucker <james@tailscale.com>
8 months ago
Percy Wegmann 5e7e36e3bc android: switch to using gomobile
gomobile replaces our custom JNI bindings

Updates tailscale/corp#18202

Signed-off-by: Percy Wegmann <percy@tailscale.com>
8 months ago
kari-ts 98a72c2963 android: new backend
Create pkg/tailscale, a Go library for the new Android app which handles starting up and running the local backend
-On initialization, get the JVM and app context to make JNI work
-Send filesystem directory path

Add a logging bridge from Go to Android (copied from Gio)

Add connect function which sends request to edit prefs instead of setting prefs

Future:
-Make build.gradle more portable
-Fix connect and make sure Quick Tiles still works

Updates tailscale/corp#18202

Signed-off-by: Percy Wegmann <percy@tailscale.com>
8 months ago
Anton Tolchanov e16303e1d8 Makefile: update aab file path
Seems like something that was missed in #182

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
8 months ago
James Tucker bf7bf94b52 .github/workflows,Makefile: add a build check CI for the new app
Updates tailscale/tailscale#10992

Signed-off-by: James Tucker <james@tailscale.com>
8 months ago
Jonathan Nobels 4f46c38c99
Jonathan/notifier (#179)
android: add notifier support a data model and compose dependencies

fixes ENG-2084
fixes ENG-2086

Adds support for the ipnBusWatcher directly via a JNI API rather than HTTP via LocalAPIClient

Adds a rudimentary controller class and a model from which we can construct ViewModels

Cleans up some of the JNI bindings.  Adds hooks for ensuring the JNI setup is complete before attempting to do LocalAPIClient things.

Cleans up some wildcard imports.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
Signed-off-by: Percy Wegmann <percy@tailscale.com>
Co-authored-by: Percy Wegmann <percy@tailscale.com>
8 months ago
kari-ts 464f089388
android: restructure app (#182)
Make android_legacy for the old app and remove some of the new models from it
Modify Makefile to build the legacy app and the new app

Updates tailscale/tailscale#10992

Signed-off-by: kari-ts <kari@tailscale.com>
8 months ago
kari-ts bf9be063d7
Makefile: update go version for bumposs (#165)
Updates tailscale/tailscale#10992

Signed-off-by: kari-ts <kari@tailscale.com>
9 months ago
James Tucker cb2e7da117 Makefile: avoid setting empty JAVA_HOME to avoid SDK tools bugs
The Android SDK tools go into a CPU spin if $JAVA_HOME is empty and
never complete. This may occur if you have only an incomplete Android
SDK, and no Android Studio install, wherein we do not find an Android
JAVA_HOME.

Updates self
1 year ago
James Tucker 561ec860ed Makefile: fix JAVA_HOME detection on macOS
I had tested against an old Android Studio, newer ones should prefer the
`jbr` directory. The Makefile also required proper quotation around the
file paths that will typically contain a space.

Fixes tailscale/tailscale#8799
1 year ago
James Tucker 6a6e80db47
go.mod,cmd/tailscale: bump OSS and update logtail transport setup (#119)
Updates #cleanup
1 year ago
James Tucker 926613ddae
Makefile,Dockerfile,README.md: improve build dependency setup and documentation (#114)
- Teach Makefile to install an Android SDK and the components we need
- Make Dockerfile delegate to Makefile for Android SDK setup
- Detect Android Studio and other known SDK paths, and use them if found.
- Update documentation to more consistently point to Android Studio & make.
- Add a task that checks for the SDK components and produces a useful error.
- Build an APK by default.
- Allow TOOLCHAINDIR to be passed in, and strip the first go/ component
  so that it is the path a user would expect.

Updates #cleanup
1 year ago
Will Norris b68b3f2aeb Makefile: fix versionCode replacement and cleanup
I'm not sure why [[:digit:]] worked before but not now (BSD vs GNU sed
maybe?), but since we already have the old VERSIONCODE, just replace it
directly. Also cleanup the android/build.gradle.bak file.

Signed-off-by: Will Norris <will@tailscale.com>
1 year ago
Mihai Parparita e7efa7d1c2 Makefile: add tailscale_go to the set of build tags
We build with the tailscale Go toolchain, so we should pass in the
build tag that indicates that it's safe to use functionality contained
within it.

Updates tailscale/corp#9230
2 years ago
Denton Gentry 813b770cdf go.mod: update Gio, finish Go 1.20 support
Upstream Gio fixed https://todo.sr.ht/~eliasnaur/gio/473, which
we run into in https://github.com/tailscale/tailscale/issues/7255

https://github.com/tailscale/tailscale has moved to Go 1.20
- update go.mod to go 1.20
- go mod tidy -compat=1.20
- update go4.org/unsafe/assume-no-moving-gc

Skip over the build numbers used for 1.36.x

Fixes https://github.com/tailscale/tailscale/issues/7255

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
David Anderson 52a0509a5d go.mod: update to tailscale HEAD
And update build logic to account for the API change in
tailscale.com/version.

And apply the API change introduced by
tailscale/tailscale@04b57a371e

Signed-off-by: David Anderson <dave@natulte.net>
2 years ago
Denton Gentry e49241f40b go.mod: update from OSS.
Also update to Go 1.19 in go.mod.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry 283dd77bcc Add a unit test for DnsConfig.intToInetString
adds JUnit dependencies and basic gradle support to run unit tests,
and a test for DnsConfig.intToInetString().

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry 7203980ecc Disable vulkan.
Trying to resolve crashes on certain OpenGL hardware.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Brad Fitzpatrick 1be9000a6a Makefile: add 'bumposs' target, run go mod tidy
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
3 years ago
Brad Fitzpatrick 3b6b9acf2b Makefile: clear GOROOT, add rundebug target
Nowadays basically nobody should set GOROOT. I still do for various
reasons, but that broke this build which then ran our custom toolchain
with a mismatched GOROOT. Clear GOROOT so the default GOROOT is used
(which is the path that matches the Go toolchain in use)

Also, add a "rundebug" target to control adb (phone or emulator)
3 years ago
Brad Fitzpatrick df09d74486 Makefile: make toolchain bootstrap work on darwin and arm64
It only worked on linux/amd64 before, but we support
{linux,darwin}/{amd64,arm64} for development elsewhere.

Fixes tailscale/tailscale#3669

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
3 years ago
Brad Fitzpatrick 19822d0b94 go.mod: use Go toolchain rev from oss
And don't sha1-sum the Go toolchain cache.
Just see if its go binary works.

Updates tailscale/corp#3385
Updates tailscale/tailscale#3596
3 years ago
Denton Gentry 2d49c9ae30 Makefile: make toolchain sum not use absolute path.
This is intended as a quick fix of the immediate problem:
don't compute the checksum using absolute paths (i.e.
/home/dgentry), use relative paths.

In the future we may rationalize the versioning of the
toolchain to tie the Android toolchain to the one used
for building Linux/macOS/Windows/etc.

Fixes https://github.com/tailscale/tailscale/issues/3596

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Brad Fitzpatrick 050f4a41d4 Makefile: add fdroid-like APK target 3 years ago
Brad Fitzpatrick f8176b47a9 Makefile: remove long-obsolete -tags=xversion
That build tag hasn't been used since tailscale/tailscale's 5088af68cf
(June 2nd, 2021, for 1.10.0)
3 years ago
Denton Gentry da175ba221 go.mod: update OSS
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Denton Gentry c02078e41e Makefile: update toolchain version to use.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Denton Gentry d81f8a03b6 Switch to Go 1.17.
Matches https://github.com/tailscale/tailscale at HEAD.
3 years ago
Denton Gentry bb0494637f Makefile: download Tailscale's Go toolchain
Tailscale maintains a patched Go toolchain, pulling in
fixes early. Download the toolchain and use it to build.

Fixes https://github.com/tailscale/tailscale/issues/2450
in a better way.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago