app/build.gradle
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'jacoco'
id 'com.google.gms.google-services'
id 'kotlin-kapt'
id 'com.google.devtools.ksp' version '1.5.31-1.0.0'
}
android {
namespace 'com.github.orkest'
compileSdk 33
defaultConfig {
manifestPlaceholders = [redirectSchemeName: "spotify-sdk", redirectHostName: "auth"]
applicationId "com.github.orkest"
minSdk 27
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
testCoverageEnabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation 'androidx.compose.material:material:1.3.1'
implementation 'androidx.compose.ui:ui-tooling-preview:1.3.3'
implementation 'junit:junit:4.12'
implementation 'junit:junit:4.12'
implementation 'androidx.test:core-ktx:1.5.0'
implementation 'androidx.test.ext:junit-ktx:1.1.5'
implementation 'androidx.room:room-common:2.5.1'
debugImplementation 'androidx.compose.ui:ui-tooling:1.3.3'
implementation "androidx.compose.material3:material3:1.1.0-alpha08"
implementation 'com.google.android.gms:play-services-auth:20.4.1'
implementation 'androidx.annotation:annotation:1.6.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation "androidx.room:room-runtime:2.5.1"
kapt "androidx.room:room-compiler:2.5.1"
// for Spotify remote App
implementation files('../libs/spotify-app-remote-release-0.7.2.aar')
// for spotify authorization
implementation 'com.spotify.android:auth:1.2.5' // Maven dependency
implementation "com.google.code.gson:gson:2.9.0"
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'androidx.activity:activity-compose:1.6.1'
//noinspection GradleDependency
implementation "androidx.compose.ui:ui:$compose_ui_version"
//noinspection GradleDependency
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.3.1'
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.mockito:mockito-inline:3.12.4'
testImplementation "io.mockk:mockk:1.12.0"
androidTestImplementation 'org.mockito:mockito-android:3.10.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.3.3"
debugImplementation "androidx.compose.ui:ui-test-manifest:1.3.3"
androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
// Test rules and transitive dependencies:
//noinspection GradleDependency
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
// Needed for createAndroidComposeRule, but not createComposeRule:
//noinspection GradleDependency
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
implementation platform('com.google.firebase:firebase-bom:31.2.3')
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
//noinspection GradleDependency
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
//noinspection GradleDependency
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
//noinspection GradleDependency
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:31.2.2')
// Add the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth-ktx'
// Also add the dependency for the Google Play services library and specify its version
implementation 'com.google.android.gms:play-services-auth:20.4.1'
//noinspection GradleDependency
implementation "androidx.compose.ui:ui:$compose_version"
//noinspection GradleDependency
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.compose.material3:material3:1.0.1'
implementation 'androidx.activity:activity-compose:1.6.1'
//noinspection GradleDependency
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
//noinspection GradleDependency
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
//noinspection GradleDependency
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
// Test rules and transitive dependencies:
//noinspection GradleDependency
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
// Needed for createAndroidComposeRule, but not createComposeRule:
//noinspection GradleDependency
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
// Test rules and transitive dependencies:
//noinspection GradleDependency
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
// Needed for createAndroidComposeRule, but not createComposeRule:
//noinspection GradleDependency
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
//Compose dependencies
var composeBom = platform("androidx.compose:compose-bom:2023.01.00")
implementation composeBom
androidTestImplementation composeBom
// Choose one of the following:
// Material Design 3
implementation("androidx.compose.material3:material3")
// or Material Design 2
implementation("androidx.compose.material:material")
// or skip Material Design and build directly on top of foundational components
implementation("androidx.compose.foundation:foundation")
// or only import the main APIs for the underlying toolkit systems,
// such as input and measurement/layout
implementation("androidx.compose.ui:ui")
// Android Studio Preview support
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")
// UI Tests
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-test-manifest")
// Optional - Included automatically by material, only add when you need
// the icons but not the material library (e.g. when using Material3 or a
// custom design system based on Foundation)
implementation("androidx.compose.material:material-icons-core")
// Optional - Add full set of material icons
implementation("androidx.compose.material:material-icons-extended")
// Optional - Add window size utils
implementation("androidx.compose.material3:material3-window-size-class")
// Optional - Integration with activities
implementation("androidx.activity:activity-compose:1.6.1")
// Optional - Integration with ViewModels
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0")
// Optional - Integration with LiveData
implementation("androidx.compose.runtime:runtime-livedata")
// Optional - Integration with RxJava
implementation("androidx.compose.runtime:runtime-rxjava2")
implementation("androidx.navigation:navigation-compose:$nav_version")
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.compose.material3:material3:1.0.1'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation("androidx.compose.material:material:1.3.1")
implementation 'androidx.navigation:navigation-compose:2.6.0-alpha07'
implementation 'io.coil-kt:coil-compose:1.3.2' // TODO: use a more recent version ?
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
// Test rules and transitive dependencies:
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
// Needed for createAndroidComposeRule, but not createComposeRule:
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
implementation "androidx.navigation:navigation-compose:2.6.0-alpha07"
androidTestImplementation('androidx.test.espresso:espresso-intents:3.4.0')
//Dependencies for shazamKit
implementation files('../libs/shazamkit-android-release.aar')
//implementation(name: "shazamkit-android-release", ext: "aar")
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// Room components
var room_version = "2.5.1"
implementation("androidx.room:room-runtime:$room_version")
annotationProcessor("androidx.room:room-compiler:$room_version")
// To use Kotlin annotation processing tool (kapt)
kapt("androidx.room:room-compiler:$room_version")
// To use Kotlin Symbol Processing (KSP)
ksp("androidx.room:room-compiler:$room_version")
// optional - Kotlin Extensions and Coroutines support for Room
implementation("androidx.room:room-ktx:$room_version")
// optional - RxJava2 support for Room
implementation("androidx.room:room-rxjava2:$room_version")
// optional - RxJava3 support for Room
implementation("androidx.room:room-rxjava3:$room_version")
// optional - Guava support for Room, including Optional and ListenableFuture
implementation("androidx.room:room-guava:$room_version")
// optional - Test helpers
testImplementation("androidx.room:room-testing:$room_version")
// optional - Paging 3 Integration
implementation("androidx.room:room-paging:$room_version")
//Camera dependencies
implementation "androidx.camera:camera-core:1.2.2"
implementation "androidx.camera:camera-camera2:1.2.2"
implementation "androidx.camera:camera-lifecycle:1.2.2"
implementation "androidx.camera:camera-view:1.3.0-alpha06"
implementation "androidx.camera:camera-video:1.2.2"
implementation "androidx.camera:camera-view:1.2.2"
implementation "androidx.camera:camera-extensions:1.2.2"
implementation 'com.google.android.exoplayer:exoplayer:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.6'
//refreshing
implementation 'com.google.accompanist:accompanist-swiperefresh:0.25.1'
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.required = true
html.required = true
}
def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*',
]
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
'outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec',
'outputs/code_coverage/debugAndroidTest/connected/*/coverage.ec'
]))
}
connectedCheck {
finalizedBy jacocoTestReport
}
configurations.all {
resolutionStrategy.force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
}