mirror of
https://github.com/Michatec/Radio.git
synced 2026-05-30 22:52:40 +02:00
build: migrate Gradle build files to Kotlin DSL (KTS)
This commit is contained in:
@@ -10,7 +10,7 @@ on:
|
||||
|
||||
env:
|
||||
ANDROID_HOME: /usr/local/lib/android/sdk/
|
||||
APK_PATH: app/build/outputs/apk/release/Radio.apk
|
||||
APK_PATH: app/build/outputs/apk/release/app-release.apk
|
||||
APKSIGNER: /usr/local/lib/android/sdk/build-tools/34.0.0/apksigner
|
||||
ZIPALIGN: /usr/local/lib/android/sdk/build-tools/34.0.0/zipalign
|
||||
|
||||
@@ -31,15 +31,12 @@ jobs:
|
||||
cache: gradle
|
||||
|
||||
- name: Cache Android SDK
|
||||
#id: cache-android-sdk
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.ANDROID_HOME }}
|
||||
key: ${{ runner.os }}-android-sdk
|
||||
|
||||
- name: Setup Android SDK
|
||||
## It is not necessary to check for cache hit as it
|
||||
## will not download Android SDK again
|
||||
#if: steps.cache-android-sdk.outputs.cache-hit != 'true'
|
||||
uses: android-actions/setup-android@v4
|
||||
with:
|
||||
@@ -67,10 +64,10 @@ jobs:
|
||||
echo "$SIGN_KEY" | base64 -d > key.der
|
||||
${{ env.APKSIGNER }} sign --key key.der --cert cert.der app-release-aligned.apk
|
||||
rm cert.der key.der
|
||||
mv app-release-aligned.apk app-release.apk
|
||||
mv app-release-aligned.apk Radio.apk
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: app-release
|
||||
path: app-release.apk
|
||||
name: Radio
|
||||
path: Radio.apk
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
plugins {
|
||||
alias libs.plugins.android.application
|
||||
id 'kotlin-parcelize'
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
onVariants(selector().all()) { variant ->
|
||||
variant.outputs.forEach { output ->
|
||||
output.outputFileName.set("Radio.apk")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.michatec.radio'
|
||||
compileSdk 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'com.michatec.radio'
|
||||
minSdk 28
|
||||
targetSdk 36
|
||||
versionCode 145
|
||||
versionName '14.5'
|
||||
resourceConfigurations += ['en', 'de', 'el', 'nl', 'pl', 'ru','uk', 'ja', 'da', 'fr']
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
crunchPngs false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
applicationIdSuffix = ".debug"
|
||||
}
|
||||
|
||||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
crunchPngs true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
ndkVersion "29.0.14206865"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('src/main/cpp/CMakeLists.txt')
|
||||
version '3.22.1'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// Google Stuff //
|
||||
implementation libs.material
|
||||
implementation libs.gson
|
||||
implementation libs.play.services.cast.framework
|
||||
|
||||
// AndroidX Stuff //
|
||||
implementation libs.core.ktx
|
||||
implementation libs.activity.ktx
|
||||
implementation libs.palette.ktx
|
||||
implementation libs.preference.ktx
|
||||
implementation libs.media
|
||||
implementation libs.media3.exoplayer
|
||||
implementation libs.media3.exoplayer.hls
|
||||
implementation libs.media3.session
|
||||
implementation libs.media3.cast
|
||||
implementation libs.media3.datasource.okhttp
|
||||
implementation libs.navigation.fragment.ktx
|
||||
implementation libs.navigation.ui.ktx
|
||||
implementation libs.work.runtime.ktx
|
||||
implementation libs.leanback
|
||||
|
||||
implementation libs.freedroidwarn
|
||||
|
||||
// Volley HTTP request //
|
||||
implementation libs.volley
|
||||
implementation libs.material3
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
id("kotlin-parcelize")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.michatec.radio"
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.michatec.radio"
|
||||
minSdk = 28
|
||||
targetSdk = 36
|
||||
versionCode = 145
|
||||
versionName = "14.5"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
isCrunchPngs = false
|
||||
proguardFiles.addAll(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro")))
|
||||
applicationIdSuffix = ".debug"
|
||||
}
|
||||
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
isCrunchPngs = true
|
||||
proguardFiles.addAll(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro")))
|
||||
}
|
||||
}
|
||||
|
||||
ndkVersion = "29.0.14206865"
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path = file("src/main/cpp/CMakeLists.txt")
|
||||
version = "3.22.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Google Stuff //
|
||||
implementation(libs.material)
|
||||
implementation(libs.gson)
|
||||
implementation(libs.play.services.cast.framework)
|
||||
|
||||
// AndroidX Stuff //
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.activity.ktx)
|
||||
implementation(libs.palette.ktx)
|
||||
implementation(libs.preference.ktx)
|
||||
implementation(libs.media)
|
||||
implementation(libs.media3.exoplayer)
|
||||
implementation(libs.media3.exoplayer.hls)
|
||||
implementation(libs.media3.session)
|
||||
implementation(libs.media3.cast)
|
||||
implementation(libs.media3.datasource.okhttp)
|
||||
implementation(libs.navigation.fragment.ktx)
|
||||
implementation(libs.navigation.ui.ktx)
|
||||
implementation(libs.work.runtime.ktx)
|
||||
implementation(libs.leanback)
|
||||
|
||||
implementation(libs.freedroidwarn)
|
||||
|
||||
// Volley HTTP request //
|
||||
implementation(libs.volley)
|
||||
implementation(libs.material3)
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
plugins {
|
||||
alias libs.plugins.android.application apply false
|
||||
alias libs.plugins.android.library apply false
|
||||
alias libs.plugins.jetbrains.kotlin.android apply false
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete layout.buildDirectory
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Top-level build file where you can add configuration options common to all subprojects/modules.
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.android.library) apply false
|
||||
alias(libs.plugins.jetbrains.kotlin.android) apply false
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(layout.buildDirectory)
|
||||
}
|
||||
@@ -15,7 +15,7 @@ paletteKtx = "1.0.0"
|
||||
preferenceKtx = "1.2.1"
|
||||
volley = "1.2.1"
|
||||
workRuntimeKtx = "2.11.2"
|
||||
playServicesCastFramework = "22.3.0"
|
||||
playServicesCastFramework = "22.3.1"
|
||||
|
||||
[libraries]
|
||||
activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activityKtx" }
|
||||
|
||||
@@ -3,20 +3,22 @@ pluginManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
|
||||
}
|
||||
@Suppress("UnstableApiUsage")
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
}
|
||||
}
|
||||
|
||||
include ':app'
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
}
|
||||
|
||||
include(":app")
|
||||
Reference in New Issue
Block a user