Skip to content

Commit cafe471

Browse files
committed
Build improvements
- Remove JCenter repo since it's no longer available - Created new version catalog for tool versions - Added setupRustAndroidLocal task for easier setup environment for compiling Rust module in file_operations - Update NDK to current stable version 29
1 parent 033dcb7 commit cafe471

15 files changed

Lines changed: 71 additions & 20 deletions

.github/workflows/android-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up NDK
2525
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
2626
with:
27-
ndk-version: r28c
27+
ndk-version: r29
2828
link-to-sdk: true
2929
local-cache: true
3030
- name: Install Rust

.github/workflows/android-debug-artifact-ondemand.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up NDK
4444
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
4545
with:
46-
ndk-version: r28c
46+
ndk-version: r29
4747
link-to-sdk: true
4848
local-cache: true
4949
- name: Install Rust

.github/workflows/android-debug-artifact-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up NDK
1818
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
1919
with:
20-
ndk-version: r28c
20+
ndk-version: r29
2121
link-to-sdk: true
2222
local-cache: true
2323
- name: Install Rust

.github/workflows/android-feature.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: setup-ndk
2727
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
2828
with:
29-
ndk-version: r28c
29+
ndk-version: r29
3030
link-to-sdk: true
3131
local-cache: true
3232
- name: Check formatting using spotless

.github/workflows/android-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up NDK
2626
uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410
2727
with:
28-
ndk-version: r28c
28+
ndk-version: r29
2929
link-to-sdk: true
3030
local-cache: true
3131
- name: Check formatting using spotless

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apply plugin: 'com.google.devtools.ksp'
88

99
android {
1010
namespace "com.amaze.filemanager"
11-
compileSdk libs.versions.compileSdk.get().toInteger()
11+
compileSdk tools.versions.compileSdk.get().toInteger()
1212
packagingOptions {
1313
resources {
1414
excludes += ['proguard-project.txt', 'project.properties', 'META-INF/LICENSE.txt', 'META-INF/LICENSE', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/DEPENDENCIES.txt', 'META-INF/DEPENDENCIES', 'META-INF/versions/9/OSGI-INF/MANIFEST.MF']
@@ -99,7 +99,7 @@ android {
9999
}
100100

101101
kotlinOptions {
102-
jvmTarget = '17'
102+
jvmTarget = tools.versions.jvmTarget.get()
103103
}
104104

105105
testOptions {
@@ -338,5 +338,4 @@ repositories {
338338
google()
339339
mavenCentral()
340340
maven { url "https://jitpack.io" }
341-
maven { url "https://jcenter.bintray.com" }
342341
}

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ allprojects {
2727
google()
2828
mavenCentral()
2929
maven { url "https://jitpack.io" }
30-
maven { url "https://jcenter.bintray.com" }
3130
maven { url "https://repository.liferay.com/nexus/content/repositories/public/"}
3231
}
3332
tasks.withType(Test).tap {

commons_compress_7z/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
33

44
android {
55
namespace "com.amaze.filemanager.filesystem.compressed.sevenz"
6-
compileSdk libs.versions.compileSdk.get().toInteger()
6+
compileSdk tools.versions.compileSdk.get().toInteger()
77

88
defaultConfig {
99
minSdkVersion libs.versions.minSdk.get().toInteger()

file_operations/build.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'com.google.devtools.ksp'
44
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
5+
apply from: "../gradle/setupRustAndroidLocal.gradle"
56

67
android {
78
namespace "com.amaze.filemanager.fileoperations"
8-
compileSdk libs.versions.compileSdk.get().toInteger()
9-
ndkVersion libs.versions.ndk.get()
9+
compileSdk tools.versions.compileSdk.get().toInteger()
10+
ndkVersion tools.versions.ndk.get()
1011

1112
defaultConfig {
1213
minSdkVersion libs.versions.minSdk.get().toInteger()
13-
ndkVersion libs.versions.ndk.get()
14+
ndkVersion tools.versions.ndk.get()
1415

1516
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1617
consumerProguardFiles "consumer-rules.pro"
@@ -43,7 +44,7 @@ android {
4344
}
4445

4546
kotlinOptions {
46-
jvmTarget = '17'
47+
jvmTarget = tools.versions.jvmTarget.get()
4748
}
4849
}
4950

@@ -61,7 +62,7 @@ cargo {
6162
}
6263

6364
kotlin {
64-
jvmToolchain(17)
65+
jvmToolchain(tools.versions.jvmTarget.get().toInteger())
6566
}
6667

6768
// Ensure Rust libraries are built before Android tasks
@@ -135,4 +136,10 @@ dependencies {
135136

136137
implementation fileTree(dir: "libs", include: ["*.jar"])
137138
implementation libs.androidX.appcompat
139+
}
140+
141+
tasks.matching {
142+
it.name.startsWith('cargoBuild')
143+
}.configureEach {
144+
it.dependsOn 'setupRustAndroidOnLocal'
138145
}

file_operations/setup_rust_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Setup script for Rust Android development
44
# This script:

0 commit comments

Comments
 (0)