Skip to content

Commit 54bc19a

Browse files
committed
Made version catalog changes in toml file
Signed-off-by: Abhijit Naik <[email protected]>
1 parent 22f044c commit 54bc19a

6 files changed

+93
-44
lines changed

app/build.gradle.kts

+31-39
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
plugins {
2-
id("com.android.application")
3-
id("org.jetbrains.kotlin.android")
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
44
}
55

66
android {
7+
compileSdk = libs.versions.compileSdk.get().toInt()
78
namespace = "com.compose.weatherapplite"
8-
compileSdk = 34
9+
testNamespace = "test.com.compose.weatherapplite"
910

1011
defaultConfig {
1112
applicationId = "com.compose.weatherapplite"
12-
minSdk = 26
13-
targetSdk = 34
13+
minSdk = libs.versions.minSdk.get().toInt()
14+
targetSdk = libs.versions.targetSdk.get().toInt()
1415
versionCode = 1
1516
versionName = "1.0"
16-
17+
vectorDrawables.useSupportLibrary = true
1718
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18-
vectorDrawables {
19-
useSupportLibrary = true
20-
}
2119
}
2220

2321
buildTypes {
@@ -29,19 +27,20 @@ android {
2927
)
3028
}
3129
}
30+
3231
compileOptions {
33-
sourceCompatibility = JavaVersion.VERSION_1_8
34-
targetCompatibility = JavaVersion.VERSION_1_8
35-
}
36-
kotlinOptions {
37-
jvmTarget = "1.8"
32+
sourceCompatibility = JavaVersion.VERSION_17
33+
targetCompatibility = JavaVersion.VERSION_17
3834
}
35+
3936
buildFeatures {
4037
compose = true
4138
}
39+
4240
composeOptions {
43-
kotlinCompilerExtensionVersion = "1.4.3"
41+
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
4442
}
43+
4544
packaging {
4645
resources {
4746
excludes += "/META-INF/{AL2.0,LGPL2.1}"
@@ -50,34 +49,27 @@ android {
5049
}
5150

5251
dependencies {
53-
// Tooling - Preview
54-
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
55-
debugImplementation("androidx.compose.ui:ui-tooling")
56-
implementation("androidx.compose.ui:ui-tooling-preview")
52+
// Compose - BOM - (Bill of Materials)
53+
val composeBom = platform(libs.androidx.compose.bom)
54+
implementation(composeBom)
55+
androidTestImplementation(composeBom)
5756

58-
// Compose UI
59-
implementation("androidx.compose.ui:ui")
60-
implementation("androidx.compose.ui:ui-graphics")
61-
62-
// Compose Jetpack Core
63-
implementation("androidx.activity:activity-compose:1.8.0")
64-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
65-
implementation("androidx.core:core-ktx:1.12.0")
57+
// Tooling - Preview
58+
debugImplementation(libs.androidx.compose.ui.tooling)
59+
implementation(libs.androidx.compose.ui.tooling.preview)
6660

67-
// Compose UI - Material 3
68-
implementation("androidx.compose.material3:material3")
61+
// Compose - Jetpack Core
62+
implementation(libs.androidx.activity.compose)
63+
implementation(libs.androidx.lifecycle.runtime)
64+
implementation(libs.androidx.core.ktx)
6965

70-
// Unit & UI Tests
71-
testImplementation("junit:junit:4.13.2")
72-
androidTestImplementation("androidx.test.ext:junit:1.1.5")
73-
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
74-
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
75-
debugImplementation("androidx.compose.ui:ui-test-manifest")
66+
// Compose - UI
67+
implementation(libs.androidx.compose.ui)
7668

77-
// Compose - BOM(Bill of Materials)
78-
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
69+
// Compose - UI - Material 3
70+
implementation(libs.androidx.compose.material3)
7971

8072
// Retrofit
81-
implementation("com.squareup.retrofit2:retrofit:2.9.0")
82-
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
73+
implementation(libs.retrofit)
74+
implementation(libs.converter.gson)
8375
}

build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id("com.android.application") version "8.1.2" apply false
4-
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
3+
alias(libs.plugins.gradle.versions)
4+
alias(libs.plugins.version.catalog.update)
55
}

gradle.properties

+10-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1515
# Android operating system, and which are packaged with your app's APK
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1717
android.useAndroidX=true
18+
19+
# Turn on parallel compilation, caching and on-demand configuration
20+
org.gradle.configureondemand=true
21+
org.gradle.caching=true
22+
org.gradle.parallel=true
23+
1824
# Kotlin code style for this project: "official" or "obsolete":
1925
kotlin.code.style=official
2026
# Enables namespacing of each library's R class so that its R class includes only the
2127
# resources declared in the library itself and none from the library's dependencies,
2228
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
29+
android.nonTransitiveRClass=true
30+
31+
# Enable R8 full mode.
32+
android.enableR8.fullMode=true

gradle/libs.versions.toml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[versions]
2+
androidGradlePlugin = "8.1.2"
3+
androidx-activity-compose = "1.8.0"
4+
androidx-compose-bom = "2023.10.01"
5+
androidx-corektx = "1.13.0-alpha01"
6+
converterGson = "2.9.0"
7+
gradle-versions = "0.49.0"
8+
kotlin = "1.8.0"
9+
lifecycle-runtime-ktx = "2.6.2"
10+
okhttp = "4.11.0"
11+
retrofit = "2.9.0"
12+
version-catalog-update = "0.8.1"
13+
14+
minSdk = "26"
15+
targetSdk = "34"
16+
compileSdk = "34"
17+
compose-compiler = "1.4.0"
18+
19+
20+
[libraries]
21+
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
22+
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
23+
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
24+
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
25+
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts" }
26+
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test" }
27+
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
28+
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
29+
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
30+
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
31+
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" }
32+
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
33+
converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "converterGson" }
34+
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
35+
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
36+
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
37+
38+
[plugins]
39+
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
40+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
41+
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }
42+
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Oct 31 18:52:48 IST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

settings.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")
2+
13
pluginManagement {
24
repositories {
5+
gradlePluginPortal()
36
google()
47
mavenCentral()
5-
gradlePluginPortal()
68
}
79
}
810
dependencyResolutionManagement {
911
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
1012
repositories {
13+
snapshotVersion?.let {
14+
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
15+
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
16+
}
1117
google()
1218
mavenCentral()
1319
}

0 commit comments

Comments
 (0)