Skip to content

Kotlin DSL - 'maven-central' #1953

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

Merged
merged 1 commit into from
Apr 27, 2020
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
42 changes: 42 additions & 0 deletions buildSrc/src/main/kotlin/MavenCentral.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.publish.maven.MavenPom

// --------------- pom configuration ---------------

fun MavenPom.configureMavenCentralMetadata(project: Project) {
name by project.name
description by "Coroutines support libraries for Kotlin"
url by "https://github.com/Kotlin/kotlinx.coroutines"

licenses {
license {
name by "The Apache Software License, Version 2.0"
url by "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution by "repo"
}
}

developers {
developer {
id by "JetBrains"
name by "JetBrains Team"
organization by "JetBrains"
organizationUrl by "https://www.jetbrains.com"
}
}

scm {
url by "https://github.com/Kotlin/kotlinx.coroutines"
}
}

private infix fun <T> Property<T>.by(value: T) {
set(value)
}
37 changes: 0 additions & 37 deletions gradle/maven-central.gradle

This file was deleted.

4 changes: 1 addition & 3 deletions gradle/publish-bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'

apply from: project.rootProject.file('gradle/maven-central.gradle')

// ------------- tasks

def isMultiplatform = project.name == "kotlinx-coroutines-core"
Expand Down Expand Up @@ -64,7 +62,7 @@ publishing {
}

publications.all {
pom.withXml(configureMavenCentralMetadata)
MavenCentralKt.configureMavenCentralMetadata(pom, project)

// add empty javadocs (no need for MPP root publication which publishes only pom file)
if (it.name != 'kotlinMultiplatform' && !isBom) {
Expand Down