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 { dependencies {
implementation 'androidx.core:core-ktx:1.6.0' implementation libs.bundles.compose
implementation 'androidx.appcompat:appcompat:1.3.1' implementation libs.androidx.core
implementation 'com.google.android.material:material:1.4.0' implementation libs.material
implementation "androidx.compose.ui:ui:$compose_version" implementation libs.lifecycle
implementation "androidx.compose.material:material:$compose_version" implementation libs.compose.activity
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' testImplementation libs.test.junit
implementation 'androidx.activity:activity-compose:1.3.1' androidTestImplementation libs.android.test.junit
testImplementation 'junit:junit:4.+' androidTestImplementation libs.android.test.espresso
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation libs.android.test.compose.ui
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' debugImplementation libs.android.test.compose.tooling
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
} }

View File

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

View File

@@ -1,11 +1,38 @@
//dependencyResolutionManagement { enableFeaturePreview("VERSION_CATALOGS")
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories { dependencyResolutionManagement {
// google() repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// mavenCentral() repositories {
// jcenter() // Warning: this repository is going to shut down soon 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" rootProject.name = "Test"
include ':app' include ':app'