Update dependencies (build.gradle) and add kapt

features/retrofit/1
Jordan ARTZET 2 years ago
parent b11f460187
commit c55abc271a

@ -1,16 +1,17 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}
android {
namespace 'fr.iut.pm.movieapplication'
compileSdk 32
compileSdk 33
defaultConfig {
applicationId "fr.iut.pm.movieapplication"
minSdk 16
targetSdk 32
targetSdk 33
versionCode 1
versionName "1.0"
@ -27,6 +28,11 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/atomicfu.kotlin_module'
}
kotlinOptions {
jvmTarget = '1.8'
}
@ -34,12 +40,35 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.room:room-common:2.4.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.appcompat:appcompat:$rootProject.appCompatVersion"
implementation "androidx.activity:activity-ktx:$rootProject.activityVersion"
// Room components
implementation "androidx.room:room-ktx:$rootProject.roomVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
// Lifecycle components
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$rootProject.lifecycleVersion"
// Kotlin components
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutines"
// UI
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
implementation "com.google.android.material:material:$rootProject.materialVersion"
// Testing
testImplementation "junit:junit:$rootProject.junitVersion"
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"
androidTestImplementation ("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation "androidx.test.ext:junit:$rootProject.androidxJunitVersion"
}

@ -0,0 +1,15 @@
package fr.iut.pm.movieapplication.data.dao
import androidx.room.Dao
import androidx.room.Query
import fr.iut.pm.movieapplication.model.Movie
import kotlinx.coroutines.flow.Flow
@Dao
interface MovieDAO {
@Query("SELECT * FROM movies_table ORDER BY original_title ASC")
fun getMovieByAlphabetizeMovie() : Flow<List<Movie>>
}

@ -6,4 +6,17 @@
android:layout_height="match_parent"
tools:context=".ui.activity.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="299dp"
android:layout_marginRight="299dp"
android:layout_marginBottom="712dp"
android:text="@string/app_name"
android:textColor="@color/design_default_color_primary_variant"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -5,3 +5,19 @@ plugins {
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}
ext {
activityVersion = '1.6.1'
appCompatVersion = '1.6.0'
constraintLayoutVersion = '2.1.4'
coreTestingVersion = '2.1.0'
coroutines = '1.6.4'
lifecycleVersion = '2.5.1'
materialVersion = '1.7.0'
roomVersion = '2.5.0'
kotlin_version = '1.7.20'
// testing
junitVersion = '4.13.2'
espressoVersion = '3.1.0'
androidxJunitVersion = '1.1.5'
}

@ -21,3 +21,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
kapt.use.jvm.ir=true
Loading…
Cancel
Save