1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-11 22:52:53 +00:00

Build android in CI

This commit is contained in:
Geoffrey Bonneville 2023-11-07 11:40:10 +01:00
parent 26017e0425
commit 08d224c9f3
6 changed files with 121 additions and 0 deletions

View file

@ -7,6 +7,9 @@ cmake-build-*/*
libtransmission/version.h
web/node_modules/*
# android
android/*
# third-party maintained projects
third-party/*

View file

@ -793,3 +793,33 @@ jobs:
with:
name: binaries-${{ github.job }}
path: pfx/**/*
android:
needs: [ what-to-make ]
runs-on: ubuntu-22.04
steps:
- name: Get Source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install NDK
run: sdkmanager "ndk;26.1.10909125"
- name: Build Transmission
working-directory: ./android
run: gradle build

3
.gitignore vendored
View file

@ -23,6 +23,9 @@ node_modules/
/third-party/miniupnp/miniupnpcstrings.h
/third-party/suffixes_dafsa.h
/web/public_html/transmission-app.js.map
/android/.cxx
/android/.gradle
/android/build
# CLion IDE build directory
/cmake-build-*/

73
android/build.gradle Normal file
View file

@ -0,0 +1,73 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
}
}
apply plugin: "com.android.library"
def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Transmission_" + name]
}
def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Transmission_" + name]).toInteger()
}
android {
ndkVersion getExtOrDefault("ndkVersion")
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
externalNativeBuild {
cmake {
abiFilters "x86_64"
arguments "-DANDROID_STL=c++_shared", "-DWITH_CRYPTO=openssl", "-DCMAKE_CXX_FLAGS=-lz"
}
}
}
externalNativeBuild {
cmake {
path "../CMakeLists.txt"
}
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
disable "GradleCompatible"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
prefab true
}
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation "com.android.ndk.thirdparty:openssl:1.1.1q-beta-1"
implementation "com.android.ndk.thirdparty:curl:7.85.0-beta-1"
}

View file

@ -0,0 +1,6 @@
Transmission_kotlinVersion=1.7.0
# quotactl is defined from >= 26
Transmission_minSdkVersion=26
Transmission_targetSdkVersion=31
Transmission_compileSdkVersion=31
Transmission_ndkversion=21.4.7075529

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.transmissionbt.transmission">
<application android:label="Transmission">
</application>
</manifest>