2020-05-02 08:56:19 +00:00
|
|
|
plugins {
|
2021-03-23 20:39:35 +00:00
|
|
|
id("io.github.gradle-nexus.publish-plugin").version(Dependencies.nexusPublishPluginVersion)
|
2020-11-15 13:10:13 +00:00
|
|
|
id("io.gitlab.arturbosch.detekt").version(Dependencies.detektVersion)
|
2021-03-23 20:39:35 +00:00
|
|
|
id("org.jetbrains.dokka").version(Dependencies.dokkaVersion)
|
2020-05-02 08:56:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Versioning
|
|
|
|
allprojects {
|
2021-03-19 18:18:00 +00:00
|
|
|
group = "org.jellyfin.sdk"
|
2021-03-10 21:47:18 +00:00
|
|
|
version = getProperty("jellyfin.version")?.removePrefix("v") ?: "latest-SNAPSHOT"
|
2020-05-02 08:56:19 +00:00
|
|
|
}
|
|
|
|
|
2019-01-24 15:05:32 +00:00
|
|
|
buildscript {
|
2021-03-10 21:47:18 +00:00
|
|
|
repositories.defaultRepositories()
|
2016-02-03 17:09:03 +00:00
|
|
|
|
2020-04-30 14:54:31 +00:00
|
|
|
dependencies {
|
2020-10-09 11:07:07 +00:00
|
|
|
classpath(Dependencies.Android.buildTools)
|
2020-09-09 18:23:15 +00:00
|
|
|
classpath(Dependencies.Kotlin.gradlePlugin)
|
2020-04-30 14:54:31 +00:00
|
|
|
}
|
2016-02-03 17:09:03 +00:00
|
|
|
}
|
|
|
|
|
2021-03-10 21:47:18 +00:00
|
|
|
// Add Sonatype publishing repository
|
|
|
|
nexusPublishing.repositories.sonatype {
|
|
|
|
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
|
|
|
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
|
|
|
|
2021-03-12 21:50:24 +00:00
|
|
|
username.set(getProperty("ossrh.username"))
|
|
|
|
password.set(getProperty("ossrh.password"))
|
2021-03-10 21:47:18 +00:00
|
|
|
}
|
2020-05-02 08:56:19 +00:00
|
|
|
|
2021-03-10 21:47:18 +00:00
|
|
|
subprojects {
|
|
|
|
// Enable required plugins
|
|
|
|
apply<SigningPlugin>()
|
2021-03-12 21:50:24 +00:00
|
|
|
apply<MavenPublishPlugin>()
|
2021-03-10 21:47:18 +00:00
|
|
|
apply<io.gitlab.arturbosch.detekt.DetektPlugin>()
|
2021-03-23 19:12:49 +00:00
|
|
|
apply<org.jetbrains.dokka.gradle.DokkaPlugin>()
|
2021-03-10 21:47:18 +00:00
|
|
|
|
|
|
|
// Add dependency repositories
|
|
|
|
repositories.defaultRepositories()
|
|
|
|
|
|
|
|
// Run block after creating project specific configuration
|
|
|
|
afterEvaluate {
|
|
|
|
// Add signing config
|
|
|
|
configure<SigningExtension> {
|
2021-03-12 21:50:24 +00:00
|
|
|
val signingKey = getProperty("signing.key")
|
|
|
|
val signingPassword = getProperty("signing.password") ?: ""
|
2021-03-10 21:47:18 +00:00
|
|
|
|
2021-03-11 16:00:06 +00:00
|
|
|
if (signingKey != null) {
|
|
|
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
|
|
|
val publishing: PublishingExtension by project
|
|
|
|
sign(publishing.publications)
|
|
|
|
}
|
2021-03-10 21:47:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Add POM to projects that use publishing
|
|
|
|
configure<PublishingExtension> {
|
|
|
|
val publication = publications.findByName("default") as? MavenPublication
|
|
|
|
publication?.defaultPom()
|
|
|
|
}
|
|
|
|
}
|
2020-06-01 14:48:57 +00:00
|
|
|
|
2021-03-10 21:47:18 +00:00
|
|
|
// Detekt linting
|
2020-06-01 14:48:57 +00:00
|
|
|
detekt {
|
|
|
|
buildUponDefaultConfig = true
|
2020-06-01 14:51:28 +00:00
|
|
|
ignoreFailures = true
|
2020-06-01 14:48:57 +00:00
|
|
|
config = files("$rootDir/detekt.yml")
|
|
|
|
}
|
2020-05-02 08:56:19 +00:00
|
|
|
}
|