Add VERRSION_CATALOGS feature to gradle

This commit is contained in:
Sylwester Zieliński
2021-09-08 11:52:48 +02:00
parent b7cc2fe223
commit 419aaf7e5b
3 changed files with 46 additions and 28 deletions

View File

@@ -49,17 +49,15 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation libs.bundles.compose
implementation libs.androidx.core
implementation libs.material
implementation libs.lifecycle
implementation libs.compose.activity
testImplementation libs.test.junit
androidTestImplementation libs.android.test.junit
androidTestImplementation libs.android.test.espresso
androidTestImplementation libs.android.test.compose.ui
debugImplementation libs.android.test.compose.tooling
}

View File

@@ -17,13 +17,6 @@ buildscript {
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: "io.spring.dependency-management"
task clean(type: Delete) {

View File

@@ -1,11 +1,38 @@
//dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories {
// google()
// mavenCentral()
// jcenter() // Warning: this repository is going to shut down soon
// }
//}
enableFeaturePreview("VERSION_CATALOGS")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
versionCatalogs {
libs {
version('compose', '1.0.2')
alias('androidx-core').to('androidx.core:core-ktx:1.6.0')
alias('material').to('com.google.android.material:material:1.4.0')
alias('lifecycle').to('androidx.lifecycle:lifecycle-runtime-ktx:2.3.1')
alias('compose-activity').to('androidx.activity:activity-compose:1.3.1')
alias('compose-ui').to('androidx.compose.ui', 'ui').versionRef('compose')
alias('compose-material').to('androidx.compose.material', 'material').versionRef('compose')
alias('compose-tooling-preview').to('androidx.compose.ui', 'ui-tooling-preview').versionRef('compose')
bundle('compose', ['compose-ui', 'compose-material', 'compose-tooling-preview'])
//-- Test ------------------------------------------------------------------------------
alias('test-junit').to('junit:junit:4.13.2')
alias('android-test-junit').to('androidx.test.ext:junit:1.1.3')
alias('android-test-espresso').to('androidx.test.espresso:espresso-core:3.4.0')
alias('android-test-compose-ui').to('androidx.compose.ui', 'ui-test-junit4').versionRef('compose')
alias('android-test-compose-tooling').to('androidx.compose.ui', 'ui-tooling').versionRef('compose')
}
}
}
rootProject.name = "Test"
include ':app'