Skip to content

Commit

Permalink
Migrate to version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussein Aladeen committed Jan 12, 2024
1 parent fef6a95 commit aab8d5e
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 204 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
.DS_Store
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A small Jetpack Compose library that provides Compose support for different imag
To add Glide support, import the Neon Glide library:

```groovy
implementation 'com.husseinala.neon:glide:0.1.6'
implementation 'com.husseinala.neon:glide:1.0.0'
```

Provide a Glide `RequestManager` instance to your root Compose tree:
Expand Down Expand Up @@ -41,7 +41,7 @@ fun GlideApp(requestManager: RequestManager) {
To add Picasso support, import the Neon Picasso library:

```groovy
implementation 'com.husseinala.neon:picasso:0.1.6'
implementation 'com.husseinala.neon:picasso:1.0.0'
```

Provide a `Picasso` instance to your root Compose tree:
Expand Down
42 changes: 6 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
import com.husseinala.neon.Deps
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath Deps.Android.GRADLE_PLUGIN
classpath Deps.Kotlin.GRADLE_PLUGIN
classpath Deps.MAVEN_PUBLISH
classpath Deps.Kotlin.DOKKA

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id "com.diffplug.spotless" version "6.23.3"
alias libs.plugins.android.application apply false
alias libs.plugins.android.library apply false
alias libs.plugins.kotlin.gradle apply false
alias libs.plugins.maven.publish apply false
alias libs.plugins.spotless apply false
alias libs.plugins.dokka apply true
}

allprojects {
repositories {
google()
mavenCentral()
}

group = project.property("GROUP") as String
version = project.property("VERSION_NAME") as String

tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
}

clean {
delete rootProject.buildDir
}
7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

58 changes: 0 additions & 58 deletions buildSrc/src/main/java/com/husseinala/neon/Dependencies.kt

This file was deleted.

42 changes: 22 additions & 20 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import com.husseinala.neon.Deps
import com.husseinala.neon.Versions
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.diffplug.spotless'
id 'com.vanniktech.maven.publish'
alias libs.plugins.android.library
alias libs.plugins.kotlin.gradle
alias libs.plugins.spotless
alias libs.plugins.maven.publish
}

spotless {
kotlin {
target "**/*.kt"
ktlint(Versions.KT_LINT)
ktlint(libs.versions.ktlint.get())
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
}

android {
namespace "com.husseinala.neon.core"

defaultConfig {
compileSdkVersion Versions.COMPILE_SDK
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
compileSdk libs.versions.androidCompileSdk.get().toInteger()
minSdkVersion libs.versions.androidMinSdk.get().toInteger()
targetSdkVersion libs.versions.androidTargetSdk.get().toInteger()

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -34,24 +38,22 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion Versions.COMPOSE_COMPILER
kotlinCompilerExtensionVersion libs.versions.composeKotlinCompiler.get()
}
}

kotlin {
jvmToolchain(17)
}

dependencies {
implementation Deps.Kotlin.STD_LIB
implementation Deps.Compose.FOUNDATION
implementation Deps.Compose.LAYOUT
implementation libs.compose.foundation
implementation libs.compose.layout

testImplementation Deps.Testing.JUNIT
testImplementation libs.testing.junit
}
43 changes: 23 additions & 20 deletions glide/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import com.husseinala.neon.Versions
import com.husseinala.neon.Deps
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.diffplug.spotless'
id 'com.vanniktech.maven.publish'
alias libs.plugins.android.library
alias libs.plugins.kotlin.gradle
alias libs.plugins.spotless
alias libs.plugins.maven.publish
}

spotless {
kotlin {
target "**/*.kt"
ktlint(Versions.KT_LINT)
ktlint(libs.versions.ktlint.get())
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
}

android {
namespace "com.husseinala.neon.glide"
compileSdkVersion Versions.COMPILE_SDK
compileSdk libs.versions.androidCompileSdk.get().toInteger()

defaultConfig {
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
minSdkVersion libs.versions.androidMinSdk.get().toInteger()
targetSdkVersion libs.versions.androidTargetSdk.get().toInteger()

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -33,28 +37,27 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
compose true
}

composeOptions {
kotlinCompilerExtensionVersion Versions.COMPOSE
kotlinCompilerExtensionVersion libs.versions.composeKotlinCompiler.get()
}
}

kotlin {
jvmToolchain(17)
}

dependencies {
api project(':core')

api Deps.GLIDE
api libs.glide

implementation Deps.Kotlin.STD_LIB
implementation Deps.Compose.FOUNDATION
implementation Deps.Compose.LAYOUT
implementation libs.compose.foundation
implementation libs.compose.layout

testImplementation Deps.Testing.JUNIT
testImplementation libs.testing.junit
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ android.enableJetifier=true

kotlin.code.style=official

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

# Maven
GROUP=com.husseinala.neon
VERSION_NAME=1.0.0
Expand Down
48 changes: 48 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[versions]
androidMinSdk = "21"
androidCompileSdk = "34"
androidTargetSdk = "34"

androidGradlePlugin = "8.2.1"

kotlin = "1.9.20"
spotless = "6.23.3"
ktlint = "1.1.1"
mavenPublish = "0.27.0"
dokka = "1.9.10"

compose = "1.5.4"
composeKotlinCompiler = "1.5.5"
activityCompose = "1.8.2"

ktx = "1.12.0"

picasso = "2.8"
picassoTransformations = "2.4.0"

glide = "4.12.0"

junit = "4.13.2"

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-gradle = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }

[libraries]
compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "compose" }
compose-layout = { group = "androidx.compose.foundation", name = "foundation-layout", version.ref = "compose" }
compose-material = { group = "androidx.compose.material", name = "material", version.ref = "compose" }

androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }

picasso-core = { group = "com.squareup.picasso", name = "picasso", version.ref = "picasso" }
picasso-transformations = { group = "jp.wasabeef", name = "picasso-transformations", version.ref = "picassoTransformations" }

glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }

testing-junit = { group = "junit", name = "junit", version.ref = "junit" }
Loading

0 comments on commit aab8d5e

Please sign in to comment.