Skip to content

Commit

Permalink
Migrate build configuration from Groovy to Kotlin and upgrade Kotlin …
Browse files Browse the repository at this point in the history
…to 2.0
  • Loading branch information
aidewoode committed Jun 12, 2024
1 parent 3098f72 commit b4bbc07
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 110 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ local.properties
.env
.idea
/app/release/
/fastlane/report.xml
/fastlane/report.xml
.kotlin
94 changes: 0 additions & 94 deletions app/build.gradle

This file was deleted.

91 changes: 91 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0"
}

android {
namespace = "org.blackcandy.android"
compileSdk = 34

defaultConfig {
applicationId = "org.blackcandy.android"
minSdk = 26
targetSdk = 34
versionCode = 3
versionName = "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

lint {
abortOnError = true
}

buildTypes {
getByName("release") {
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

buildFeatures {
viewBinding = true
compose = true
}
}

dependencies {
val ktorVersion = "2.3.4"
val media3Version = "1.3.1"

implementation(platform("androidx.compose:compose-bom:2024.05.00"))
implementation("androidx.activity:activity-compose:1.9.0")
implementation("androidx.compose.material3:material3:1.2.1")
implementation("androidx.compose.material3:material3-window-size-class-android:1.2.1")
implementation("androidx.compose.ui:ui-tooling")
implementation("androidx.compose.ui:ui:1.6.7")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.window:window:1.2.0")
implementation("androidx.window:window-core:1.2.0")
implementation("androidx.navigation:navigation-compose:2.7.7")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.security:security-crypto:1.0.0")
implementation("androidx.datastore:datastore-preferences:1.1.1")

implementation("androidx.media3:media3-exoplayer:$media3Version")
implementation("androidx.media3:media3-session:$media3Version")
implementation("androidx.media3:media3-datasource-okhttp:$media3Version")

implementation("com.google.android.material:material:1.12.0")
implementation("com.google.accompanist:accompanist-themeadapter-material3:0.30.1")

implementation("dev.hotwire:turbo:7.0.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
implementation("io.insert-koin:koin-androidx-compose:3.5.0")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-client-auth:$ktorVersion")
implementation("io.coil-kt:coil-compose:2.5.0")
implementation("sh.calvin.reorderable:reorderable:1.3.3")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 0 additions & 11 deletions build.gradle

This file was deleted.

7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.2" apply false
id("com.android.library") version "8.1.2" apply false
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
}
4 changes: 2 additions & 2 deletions fastlane/actions/get_version_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module Fastlane
module Actions
class GetVersionNameAction < Action
def self.run(params)
File.open("app/build.gradle", "r") do |file|
File.open("app/build.gradle.kts", "r") do |file|
version_name_line = file.find { |line| line.include?("versionName") }
matched_data = version_name_line&.match(/versionName\s+"(.+)"/)
matched_data = version_name_line&.match(/versionName\s+=\s+"(.+)"/)

matched_data[1] if matched_data
end
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencyResolutionManagement {
}
}
rootProject.name = "BlackCandy"
include ':app'
include(":app")

0 comments on commit b4bbc07

Please sign in to comment.