Skip to content

Commit db9c599

Browse files
fix(android): missing consumer-rules.pro (#3531)
* fix(android): missing `consumer-rules.pro` * setup android test * copy right too new * build api first * we're still on gradle 8 right now... * restore the right host on mac
1 parent 9c93437 commit db9c599

28 files changed

Lines changed: 105 additions & 117 deletions

File tree

.changes/android-consumer-rules.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
"barcode-scanner": patch
3+
"barcode-scanner-js": patch
4+
"biometric": patch
5+
"biometric-js": patch
6+
"clipboard-manager": patch
7+
"clipboard-manager-js": patch
8+
"deep-link": patch
9+
"deep-link-js": patch
10+
"dialog": patch
11+
"dialog-js": patch
12+
"fs": patch
13+
"fs-js": patch
14+
"geolocation": patch
15+
"geolocation-js": patch
16+
"haptics": patch
17+
"haptics-js": patch
18+
"nfc": patch
19+
"nfc-js": patch
20+
"notification": patch
21+
"notification-js": patch
22+
"opener": patch
23+
"opener-js": patch
24+
"shell": patch
25+
"shell-js": patch
26+
---
27+
28+
Fix missing `consumer-rules.pro` on Gradle v9.

.github/workflows/test-android.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: test android
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- '.github/workflows/test-android.yml'
11+
- '**/android/**'
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
test:
20+
runs-on: ${{ matrix.platform }}
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
platform: [ubuntu-latest, macos-latest, windows-latest]
26+
27+
steps:
28+
- uses: actions/checkout@v7
29+
30+
- uses: dtolnay/rust-toolchain@1.77.2
31+
32+
- uses: actions/setup-node@v7
33+
with:
34+
node-version: 'lts/*'
35+
36+
- uses: pnpm/action-setup@v6
37+
with:
38+
run_install: true
39+
40+
- uses: actions/setup-java@v5
41+
with:
42+
distribution: temurin
43+
java-version: 21
44+
cache: gradle
45+
46+
- name: Setup NDK
47+
uses: nttld/setup-ndk@v1
48+
id: setup-ndk
49+
with:
50+
ndk-version: r25
51+
local-cache: true
52+
53+
# TODO check after https://github.com/nttld/setup-ndk/issues/518 is fixed
54+
- name: Restore Android Symlinks
55+
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
56+
env:
57+
NDK_HOST: ${{ matrix.platform == 'ubuntu-latest' && 'linux-x86_64' || 'darwin-x86_64' }}
58+
run: |
59+
directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/$NDK_HOST/bin"
60+
find "$directory" -type l | while read link; do
61+
current_target=$(readlink "$link")
62+
new_target="$directory/$(basename "$current_target")"
63+
ln -sf "$new_target" "$link"
64+
echo "Changed $(basename "$link") from $current_target to $new_target"
65+
done
66+
67+
- uses: Swatinem/rust-cache@v2
68+
69+
- name: build API
70+
run: pnpm build
71+
72+
- name: build APK
73+
working-directory: ./examples/api
74+
run: pnpm tauri android build
75+
env:
76+
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

plugins/barcode-scanner/android/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ android {
1414
consumerProguardFiles("consumer-rules.pro")
1515
}
1616

17-
buildTypes {
18-
release {
19-
isMinifyEnabled = false
20-
proguardFiles(
21-
getDefaultProguardFile("proguard-android-optimize.txt"),
22-
"proguard-rules.pro"
23-
)
24-
}
25-
}
2617
compileOptions {
2718
sourceCompatibility = JavaVersion.VERSION_1_8
2819
targetCompatibility = JavaVersion.VERSION_1_8
File renamed without changes.

plugins/biometric/android/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ android {
1414
consumerProguardFiles("consumer-rules.pro")
1515
}
1616

17-
buildTypes {
18-
release {
19-
isMinifyEnabled = false
20-
proguardFiles(
21-
getDefaultProguardFile("proguard-android-optimize.txt"),
22-
"proguard-rules.pro"
23-
)
24-
}
25-
}
2617
compileOptions {
2718
sourceCompatibility = JavaVersion.VERSION_1_8
2819
targetCompatibility = JavaVersion.VERSION_1_8
File renamed without changes.

plugins/clipboard-manager/android/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ android {
1414
consumerProguardFiles("consumer-rules.pro")
1515
}
1616

17-
buildTypes {
18-
release {
19-
isMinifyEnabled = false
20-
proguardFiles(
21-
getDefaultProguardFile("proguard-android-optimize.txt"),
22-
"proguard-rules.pro"
23-
)
24-
}
25-
}
2617
compileOptions {
2718
sourceCompatibility = JavaVersion.VERSION_1_8
2819
targetCompatibility = JavaVersion.VERSION_1_8
File renamed without changes.

plugins/deep-link/android/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ android {
1414
consumerProguardFiles("consumer-rules.pro")
1515
}
1616

17-
buildTypes {
18-
release {
19-
isMinifyEnabled = false
20-
proguardFiles(
21-
getDefaultProguardFile("proguard-android-optimize.txt"),
22-
"proguard-rules.pro"
23-
)
24-
}
25-
}
2617
compileOptions {
2718
sourceCompatibility = JavaVersion.VERSION_1_8
2819
targetCompatibility = JavaVersion.VERSION_1_8
File renamed without changes.

0 commit comments

Comments
 (0)