Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrating to version catalogs #1491

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
val vCode: Int by rootProject.extra
val vName: String by rootProject.extra

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin)
}

android {
Expand All @@ -14,8 +11,8 @@ android {
applicationId = "com.pedro.streamer"
minSdk = 16
targetSdk = 34
versionCode = vCode
versionName = vName
versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.versionName.get()
multiDexEnabled = true
}
buildTypes {
Expand All @@ -38,13 +35,8 @@ android {

dependencies {
implementation(project(":library"))
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
//noinspection GradleDependency, version 1.7.0 need min sdk 21
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.multidex:multidex:2.0.1")

val cameraxVersion = "1.3.4"
implementation("androidx.camera:camera-core:$cameraxVersion")
implementation("androidx.camera:camera-camera2:$cameraxVersion")
implementation("androidx.camera:camera-lifecycle:$cameraxVersion")
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.multidex)
implementation(libs.bundles.androidx.camera)
}
13 changes: 4 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
val libraryGroup by rootProject.extra { "com.github.pedroSG94" }
val vCode by rootProject.extra { 245 }
val vName by rootProject.extra { "2.4.5" }
val coroutinesVersion by rootProject.extra { "1.7.3" }
val junitVersion by rootProject.extra { "4.13.2" }
val mockitoVersion by rootProject.extra { "5.2.1" }

plugins {
id("com.android.application") version "8.5.0" apply false
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("org.jetbrains.dokka") version "1.9.20" apply true
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jetbrains.kotlin) apply false
alias(libs.plugins.jetbrains.dokka) apply true
}

tasks.register("clean") {
Expand Down
26 changes: 10 additions & 16 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra
val junitVersion: String by rootProject.extra
val mockitoVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -47,17 +41,17 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "common"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoVersion")
implementation(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
}
20 changes: 8 additions & 12 deletions encoder/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val junitVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -44,16 +40,16 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "encoder"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
testImplementation("junit:junit:$junitVersion")
api("androidx.annotation:annotation:1.8.0")
testImplementation(libs.junit)
api(libs.androidx.annotation)
api(project(":common"))
}
43 changes: 43 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[versions]
libraryGroup = "com.github.pedroSG94"
versionCode = "245"
versionName = "2.4.5"

#plugins versions
agp = "8.5.0"
kotlin = "2.0.0"
dokka = "1.9.20"

#dependencies versions
#noinspection GradleDependency, version 1.7.0 need min sdk 21
appcompat = "1.6.1"
constraintlayout = "2.1.4"
camerax = "1.3.4"
multidex = "2.0.1"
annotation = "1.8.0"
coroutines = "1.7.3"
junit = "4.13.2"
mockito = "5.2.1"

[libraries]
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "annotation" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-camera-core = { module = "androidx.camera:camera-core", version.ref = "camerax" }
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "camerax" }
androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "camerax" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
junit = { module = "junit:junit", version.ref = "junit" }
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" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
maven-publish = { id = "maven-publish", version.ref = "agp" }
jetbrains-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }

[bundles]
androidx-camera = ["androidx-camera-core", "androidx-camera-camera2", "androidx-camera-lifecycle"]
18 changes: 7 additions & 11 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -44,16 +40,16 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "library"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
implementation(libs.kotlinx.coroutines.android)
api(project(":encoder"))
api(project(":rtmp"))
api(project(":rtsp"))
Expand Down
26 changes: 10 additions & 16 deletions rtmp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra
val junitVersion: String by rootProject.extra
val mockitoVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -46,18 +40,18 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "rtmp"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoVersion")
implementation(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
api(project(":common"))
}
26 changes: 10 additions & 16 deletions rtsp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra
val junitVersion: String by rootProject.extra
val mockitoVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -49,18 +43,18 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "rtsp"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoVersion")
implementation(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
api(project(":common"))
}
26 changes: 10 additions & 16 deletions srt/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
val libraryGroup: String by rootProject.extra
val vName: String by rootProject.extra
val coroutinesVersion: String by rootProject.extra
val junitVersion: String by rootProject.extra
val mockitoVersion: String by rootProject.extra

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin)
id(libs.plugins.maven.publish.get().pluginId)
alias(libs.plugins.jetbrains.dokka)
}

android {
Expand Down Expand Up @@ -46,18 +40,18 @@ afterEvaluate {
from(components["release"])

// You can then customize attributes of the publication as shown below.
groupId = libraryGroup
groupId = libs.versions.libraryGroup.get()
artifactId = "srt"
version = vName
version = libs.versions.versionName.get()
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoVersion")
implementation(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
api(project(":common"))
}
Loading
Loading