mirror of
https://github.com/jellyfin/jellyfin-sdk-kotlin.git
synced 2025-02-21 08:40:44 +00:00
Publish to Sonatype OSS
This commit is contained in:
parent
90c9e86771
commit
2298cf9f04
@ -1,19 +1,16 @@
|
||||
plugins {
|
||||
id("maven-publish")
|
||||
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
|
||||
id("io.gitlab.arturbosch.detekt").version(Dependencies.detektVersion)
|
||||
}
|
||||
|
||||
// Versioning
|
||||
allprojects {
|
||||
group = "org.jellyfin.apiclient"
|
||||
version = getProperty("jellyfin.version")?.removePrefix("v") ?: "SNAPSHOT"
|
||||
version = getProperty("jellyfin.version")?.removePrefix("v") ?: "latest-SNAPSHOT"
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
repositories.defaultRepositories()
|
||||
|
||||
dependencies {
|
||||
classpath(Dependencies.Android.buildTools)
|
||||
@ -21,18 +18,44 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
// 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/"))
|
||||
|
||||
username.set(project.properties["ossrh.username"].toString())
|
||||
password.set(project.properties["ossrh.password"].toString())
|
||||
}
|
||||
|
||||
subprojects {
|
||||
// Enable required plugins
|
||||
apply<MavenPublishPlugin>()
|
||||
apply<SigningPlugin>()
|
||||
apply<io.gitlab.arturbosch.detekt.DetektPlugin>()
|
||||
|
||||
// Add dependency repositories
|
||||
repositories.defaultRepositories()
|
||||
|
||||
// Run block after creating project specific configuration
|
||||
afterEvaluate {
|
||||
// Add signing config
|
||||
configure<SigningExtension> {
|
||||
val signingKey = project.properties["signing.key"]?.toString()
|
||||
val signingPassword = project.properties["signing.password"]?.toString()
|
||||
|
||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||
val publishing: PublishingExtension by project
|
||||
sign(publishing.publications)
|
||||
}
|
||||
|
||||
// Add POM to projects that use publishing
|
||||
configure<PublishingExtension> {
|
||||
val publication = publications.findByName("default") as? MavenPublication
|
||||
publication?.defaultPom()
|
||||
}
|
||||
}
|
||||
|
||||
// Publishing
|
||||
plugins.apply("maven-publish")
|
||||
publishing.repositories.jellyfinBintray(this)
|
||||
|
||||
// Detekt
|
||||
plugins.apply("io.gitlab.arturbosch.detekt")
|
||||
// Detekt linting
|
||||
detekt {
|
||||
buildUponDefaultConfig = true
|
||||
ignoreFailures = true
|
||||
|
@ -1,6 +1,13 @@
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||
import org.gradle.kotlin.dsl.project
|
||||
|
||||
fun RepositoryHandler.defaultRepositories() {
|
||||
google()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
object Dependencies {
|
||||
object Kotlin {
|
||||
const val version = "1.4.30"
|
||||
|
28
buildSrc/src/main/kotlin/Pom.kt
Normal file
28
buildSrc/src/main/kotlin/Pom.kt
Normal file
@ -0,0 +1,28 @@
|
||||
import org.gradle.api.publish.maven.MavenPublication
|
||||
|
||||
fun MavenPublication.defaultPom() = pom {
|
||||
name.set("jellyfin-apiclient-java")
|
||||
description.set("Kotlin API Client for Jellyfin")
|
||||
url.set("https://github.com/jellyfin/jellyfin-apiclient-java")
|
||||
|
||||
scm {
|
||||
url.set("https://github.com/jellyfin/jellyfin-apiclient-java")
|
||||
connection.set("scm:git:git@github.com:jellyfin/jellyfin-apiclient-java.git")
|
||||
developerConnection.set("scm:git:git@github.com/jellyfin/jellyfin-apiclient-java.git")
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name.set("GNU Lesser General Public License v3.0")
|
||||
url.set("https://www.gnu.org/licenses/lgpl-3.0.txt")
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id.set("nielsvanvelzen")
|
||||
name.set("Niels van Velzen")
|
||||
url.set("https://github.com/nielsvanvelzen")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||
|
||||
fun RepositoryHandler.jellyfinBintray(project: Project) = maven {
|
||||
name = "bintray"
|
||||
url = project.uri("https://api.bintray.com/maven/jellyfin/jellyfin-apiclient-java/jellyfin-apiclient-java/;publish=1;override=1")
|
||||
|
||||
credentials {
|
||||
username = project.getProperty("bintray.user")
|
||||
password = project.getProperty("bintray.key")
|
||||
}
|
||||
}
|
@ -1,7 +1,2 @@
|
||||
android.useAndroidX=true
|
||||
kotlin.incremental=true
|
||||
|
||||
# When publishing the "secure" checksums Bintray is unable to correctly identify the versions
|
||||
# and will use the artifact names (modules) as version names
|
||||
# See https://github.com/gradle/gradle/issues/11412
|
||||
systemProp.org.gradle.internal.publish.checksums.insecure=true
|
||||
|
Loading…
x
Reference in New Issue
Block a user