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

Update dependencies and tidy up build configuration #1

Merged
merged 8 commits into from
Jan 24, 2022
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
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