Skip to content

Commit

Permalink
Merge pull request #1 from kingsley/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies and tidy up build configuration
  • Loading branch information
kingsleyadio committed Jan 24, 2022
2 parents 27aa139 + cd5a862 commit 8d42e58
Show file tree
Hide file tree
Showing 15 changed files with 208 additions and 283 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ captures/
# Local configuration file (sdk path, etc)
local.properties
library.properties
gradle.properties


# Android studio
Expand Down
102 changes: 74 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,92 @@
* limitations under the License.
*/

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()
jcenter()

}
dependencies {
classpath(Dependencies.androidGradlePlugin)
classpath(kotlin("gradle-plugin", version = Versions.kotlin))
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
classpath(libs.agp)
classpath(libs.kotlinGradle)
classpath(libs.unmockGradle)
classpath(libs.mavenPublishGradle)
}
}

plugins {
id("io.gitlab.arturbosch.detekt") version Versions.detekt
id("com.vanniktech.android.junit.jacoco") version Versions.junitJacoco
alias(libs.plugins.detekt)
alias(libs.plugins.dokka).apply(false)
alias(libs.plugins.junitJacoco)
}

allprojects {
repositories {
google()
jcenter()
}
}

tasks.withType<KotlinCompile>().configureEach {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

detekt {
input = files("src/main/kotlin")
filters = ".*/resources/.*,.*/build/.*"
buildUponDefaultConfig = true
}

tasks.withType<io.gitlab.arturbosch.detekt.Detekt> {
reports {
xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins
sarif.required.set(false) // support integrations with Github Code Scanning
}
}

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

junitJacoco {
jacocoVersion = "0.8.2"
excludes = Excludes.jacocoAndroid
}
jacocoVersion = libs.versions.jacoco.get()
excludes = listOf(
// Android
"**/R.class",
"**/R$*.class",
"**/BuildConfig.*",
"**/Manifest*.*",
// Others
"**/*\$Companion.class",
"**/*Lambda$*.*", // Jacoco can not handle several "$" in class name.
"**/*$*$*.*" // Anonymous classes generated by kotlin)
)
}

subprojects {
group = extra.getValue("GROUP")
version = extra.getValue("VERSION_NAME")

tasks.withType<org.jetbrains.dokka.gradle.DokkaTask> {
dokkaSourceSets.all {
noAndroidSdkLink.set(false)
}
}

plugins.withId("com.vanniktech.maven.publish.base") {
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.S01)
signAllPublications()
pom {
name.set(project.name)
description.set("Deeplink processing library")
url.set("https://github.com/kingsleyadio/android-deeplink")

licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("kingsleyadio")
name.set("Kingsley Adio")
email.set("adiksonline@gmail.com")
}
}
}
}
}
}

inline fun <reified T> ExtraPropertiesExtension.getValue(key: String) = get(key) as T
23 changes: 0 additions & 23 deletions buildSrc/build.gradle.kts

This file was deleted.

58 changes: 0 additions & 58 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

30 changes: 0 additions & 30 deletions buildSrc/src/main/kotlin/Excludes.kt

This file was deleted.

Loading

0 comments on commit 8d42e58

Please sign in to comment.