Skip to content

Commit

Permalink
libs.versions.toml cleanup and updated usages
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Apr 22, 2024
1 parent 92921b0 commit d5cbe79
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 194 deletions.
38 changes: 13 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
import com.vanniktech.maven.publish.SonatypeHost
import com.vanniktech.maven.publish.MavenPublishBaseExtension

allprojects {
buildscript {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
google()
gradlePluginPortal()
}
}

configurations.all {
val conf = this
conf.resolutionStrategy.eachDependency {
val isWasm = conf.name.contains("wasm", true)
val isJs = conf.name.contains("js", true)
val isComposeGroup = requested.module.group.startsWith("org.jetbrains.compose")
val isComposeCompiler = requested.module.group.startsWith("org.jetbrains.compose.compiler")
if (isComposeGroup && !isComposeCompiler && !isWasm && !isJs) {
val composeVersion = project.property("compose.version") as String
useVersion(composeVersion)
}
if (requested.module.name.startsWith("kotlin-stdlib")) {
val kotlinVersion = project.property("kotlin.version") as String
useVersion(kotlinVersion)
}
}
allprojects {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}

}

plugins {
kotlin("multiplatform") apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.jetbrains.compose) apply false
alias(libs.plugins.vanniktech.maven.publish) apply false
kotlin("plugin.serialization") version "1.9.0" apply false
id("org.jetbrains.compose") apply false
id("com.autonomousapps.dependency-analysis") version "1.22.0"
}

if (hasProperty("buildScan")) {
extensions.findByName("buildScan")?.withGroovyBuilder {
setProperty("termsOfServiceUrl", "https://gradle.com/terms-of-service")
setProperty("termsOfServiceAgree", "yes")
}

}

subprojects
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
org.gradle.jvmargs=-Xmx3g
kotlin.code.style=official
android.useAndroidX=true
agp.version=7.3.0
compose.version=1.6.0-alpha01
kotlin.version=2.0.0-Beta1
org.gradle.unsafe.configuration-cache=false
org.gradle.configuration-cache=false

Expand Down
144 changes: 11 additions & 133 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,146 +3,24 @@
# Do not add a dependency to an individual sample, edit the global version instead.
#####
[versions]
accompanist = "0.30.1"
androidGradlePlugin = "7.4.2"
androidx-activity-compose = "1.7.2"
androidx-appcompat = "1.6.1"
androidx-benchmark = "1.1.0"
androidx-benchmark-junit4 = "1.1.0-beta04"
androidx-compose-bom = "2023.09.00"
androidx-constraintlayout = "1.0.1"
androidx-corektx = "1.12.0"
androidx-lifecycle-compose = "2.6.2"
androidx-lifecycle-runtime-compose = "2.6.2"
androidx-navigation = "2.7.2"
androidx-palette = "1.0.0"
androidx-test = "1.5.0"
androidx-test-espresso = "3.5.1"
androidx-test-ext-junit = "1.1.5"
androidx-test-ext-truth = "1.5.0"
androidx-window = "1.2.0-beta01"
androidxHiltNavigationCompose = "1.0.0"
androix-test-uiautomator = "2.2.0"
coil = "2.2.0"
# @keep
compileSdk = "33"
compose-compiler = "1.5.1"
coroutines = "1.8.0-RC"
google-maps = "18.1.0"
gradle-versions = "0.46.0"
gson = "2.10.1"
hilt = "2.43.2"
hiltExt = "1.0.0"
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
jdkDesugar = "1.2.2"
junit = "4.13.2"
# @pin Update in conjuction with Compose Compiler
kotlin = "2.0.0-beta02"
kotlinx-serialization = "1.6.0"
ksp = "1.8.0-1.0.9"
maps-compose = "2.5.3"
material = "1.11.0-alpha02"
# @keep
minSdk = "21"
okhttp = "4.11.0"
robolectric = "4.9.2"
rome = "1.18.0"
room = "2.5.0"
secrets = "2.0.1"
# @keep
targetSdk = "33"
kotlin = "2.0.0-RC1"
kotlinx-serialization = "1.6.3"
vanniktech-maven-publish = "0.28.0"
version-catalog-update = "0.8.0"
jetbrains-compose = "1.6.10-beta01"
# kotlin("multiplatform").version(extra["kotlin.version"] as String)
# kotlin("android").version(extra["kotlin.version"] as String)
# id("com.android.application").version(extra["agp.version"] as String)
# id("com.android.library").version(extra["agp.version"] as String)
# id("org.jetbrains.compose").version(extra["compose.version"] as String)

[libraries]
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
accompanist-pager = { module = "com.google.accompanist:accompanist-pager", version.ref = "accompanist" }
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
accompanist-swiperefresh = { module = "com.google.accompanist:accompanist-swiperefresh", version.ref = "accompanist" }
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity-compose" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-benchmark-macrobenchmark = { module = "androidx.benchmark:benchmark-macro", version.ref = "androidx-benchmark" }
androidx-benchmark-macrobenchmark-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "androidx-benchmark-junit4" }
androidx-compose-animation = { module = "androidx.compose.animation:animation" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" }
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-materialWindow = { module = "androidx.compose.material3:material3-window-size-class" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" }
androidx-compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts" }
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test" }
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" }
androidx-compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding" }
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" }
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-runtime = "androidx.lifecycle:lifecycle-runtime-ktx:2.6.0-alpha04"
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle-runtime-compose" }
androidx-lifecycle-viewModelCompose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle-compose" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "androidx-navigation" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "androidx-navigation" }
androidx-palette = { module = "androidx.palette:palette", version.ref = "androidx-palette" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" }
androidx-test-ext-truth = { module = "androidx.test.ext:truth", version.ref = "androidx-test-ext-truth" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
androidx-test-runner = "androidx.test:runner:1.5.2"
androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androix-test-uiautomator" }
androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" }
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" }
hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
hilt-ext-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltExt" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
rometools-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
rometools-rome = { module = "com.rometools:rome", version.ref = "rome" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" }
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" }
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose" }
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish.base", version.ref = "vanniktech-maven-publish" }
38 changes: 19 additions & 19 deletions invert-models/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
kotlin("multiplatform")
id("kotlinx-serialization")
alias(libs.plugins.vanniktech.maven.publish)
kotlin("multiplatform")
kotlin("plugin.serialization")
alias(libs.plugins.vanniktech.maven.publish)
}

kotlin {
js {
browser()
}
jvm {
withSourcesJar()
}
js {
browser()
}
jvm {
withSourcesJar()
}

sourceSets {
val commonMain by getting {
dependencies {
api(libs.kotlinx.serialization.core)
api(libs.kotlinx.serialization.json)
}
sourceSets {
val commonMain by getting {
dependencies {
api(libs.kotlinx.serialization.core)
api(libs.kotlinx.serialization.json)
}
}
}
}
}

mavenPublishing {
pomFromGradleProperties()
signAllPublications()
publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
pomFromGradleProperties()
signAllPublications()
publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
}
19 changes: 15 additions & 4 deletions invert-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import com.vanniktech.maven.publish.SonatypeHost

plugins {
kotlin("jvm")
id("kotlinx-serialization")
kotlin("plugin.serialization")
id("java-gradle-plugin")
alias(libs.plugins.vanniktech.maven.publish)
}
Expand Down Expand Up @@ -35,7 +35,18 @@ kotlin {
}

mavenPublishing {
pomFromGradleProperties()
signAllPublications()
publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
pomFromGradleProperties()
signAllPublications()
publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
}

// Allow overwriting of HTML & JS files in resources/META-INF during publishing
tasks {
named<Copy>("processResources") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
named<Jar>("sourcesJar") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}

10 changes: 0 additions & 10 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ pluginManagement {
google()
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}

plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
kotlin("android").version(extra["kotlin.version"] as String)
id("com.android.application").version(extra["agp.version"] as String)
id("com.android.library").version(extra["agp.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

Expand Down

0 comments on commit d5cbe79

Please sign in to comment.