Skip to content

Commit

Permalink
Please consider moving to maven central JetBrains#1160
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac authored and SchweinchenFuntik committed Oct 23, 2021
1 parent a83e038 commit ad00553
Show file tree
Hide file tree
Showing 19 changed files with 128 additions and 204 deletions.
22 changes: 17 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
plugins {
kotlin("jvm") version "1.4.21" apply true
id("tanvd.kosogor") version "1.0.9" apply true
kotlin("jvm") version "1.4.31" apply true
id("io.github.gradle-nexus.publish-plugin") apply true
}

subprojects {
apply(plugin = "tanvd.kosogor")
allprojects {
if (this.name != "exposed-tests" && this != rootProject) {
apply(from = rootProject.file("buildScripts/gradle/publishing.gradle.kts"))
}
}

nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("exposed.sonatype.user"))
password.set(System.getenv("exposed.sonatype.password"))
useStaging.set(true)
}
}
}

repositories {
jcenter()
mavenCentral()
}
24 changes: 24 additions & 0 deletions buildScripts/gradle/publishing.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import org.jetbrains.exposed.gradle.*

apply(plugin = "java-library")
apply(plugin = "maven")
apply(plugin = "maven-publish")
apply(plugin = "signing")

_java {
withJavadocJar()
withSourcesJar()
}

_publishing {
publications {
create<MavenPublication>("ExposedJars") {
artifactId = project.name
from(project.components["java"])
pom {
configureMavenCentralMetadata(project)
}
signPublicationIfKeyPresent(project)
}
}
}
7 changes: 4 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
repositories {
jcenter()
mavenCentral()
gradlePluginPortal()
}

dependencies {
gradleApi()
compile("com.avast.gradle", "gradle-docker-compose-plugin", "0.9.3")
compile("com.avast.gradle", "gradle-docker-compose-plugin", "0.14.2")
compile("io.github.gradle-nexus", "publish-plugin", "1.0.0")
}

plugins {
`kotlin-dsl` apply true
id("tanvd.kosogor") version "1.0.9" apply true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@file:Suppress("UnstableApiUsage")

package org.jetbrains.exposed.gradle

import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPom
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.plugins.signing.SigningExtension
import io.github.gradlenexus.publishplugin.*
import org.gradle.api.plugins.JavaPlatformExtension
import org.gradle.api.plugins.JavaPluginExtension

infix fun <T> Property<T>.by(value: T) {
set(value)
}


fun MavenPom.configureMavenCentralMetadata(project: Project) {
name by project.name
description by "Exposed, an ORM framework for Kotlin"
url by "https://github.com/JetBrains/Exposed"

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/JetBrains/Exposed"
connection by "scm:git:git://github.com/JetBrains/Exposed.git"
developerConnection by "scm:git:[email protected]:JetBrains/Exposed.git"
}
}

fun MavenPublication.signPublicationIfKeyPresent(project: Project) {
val keyId = System.getenv("exposed.sign.key.id")
val signingKey = System.getenv("exposed.sign.key.private")
val signingKeyPassphrase = System.getenv("exposed.sign.passphrase")
if (!signingKey.isNullOrBlank()) {
project.extensions.configure<SigningExtension>("signing") {
useInMemoryPgpKeys(keyId, signingKey.replace(" ", "\r\n"), signingKeyPassphrase)
sign(this@signPublicationIfKeyPresent)
}
}
}

fun Project._publishing(configure: PublishingExtension.() -> Unit) {
extensions.configure("publishing", configure)
}

fun Project._java(configure: JavaPluginExtension.() -> Unit) {
extensions.configure("java", configure)
}
22 changes: 1 addition & 21 deletions exposed-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
import org.jetbrains.exposed.gradle.Versions
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

dependencies {
api(kotlin("stdlib"))
api(kotlin("reflect"))
api("org.jetbrains.kotlinx", "kotlinx-coroutines-core", Versions.kotlinCoroutines)
api("org.slf4j", "slf4j-api", "1.7.25")
}

publishJar {
publication {
artifactId = "exposed-core"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}
22 changes: 1 addition & 21 deletions exposed-dao/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.exposed.gradle.setupDialectTest
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

dependencies {
api(project(":exposed-core"))
}

publishJar {
publication {
artifactId = "exposed-dao"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}
22 changes: 1 addition & 21 deletions exposed-java-time/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.exposed.gradle.setupDialectTest
import org.jetbrains.exposed.gradle.setupTestDriverDependencies
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

val dialect: String by project
Expand Down Expand Up @@ -38,25 +37,6 @@ tasks.withType<KotlinJvmCompile> {
}
}

publishJar {
publication {
artifactId = "exposed-java-time"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}

tasks.withType(Test::class.java) {
jvmArgs = listOf("-XX:MaxPermSize=256m")
testLogging {
Expand Down
23 changes: 1 addition & 22 deletions exposed-jdbc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

dependencies {
api(project(":exposed-core"))
}

publishJar {
publication {
artifactId = "exposed-jdbc"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}
22 changes: 1 addition & 21 deletions exposed-jodatime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import org.jetbrains.exposed.gradle.setupDialectTest
import org.jetbrains.exposed.gradle.setupTestDriverDependencies
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

val dialect: String by project
Expand All @@ -28,23 +27,4 @@ dependencies {
}
}

publishJar {
publication {
artifactId = "exposed-jodatime"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}

setupDialectTest(dialect)
22 changes: 1 addition & 21 deletions exposed-money/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import org.jetbrains.exposed.gradle.setupDialectTest
import org.jetbrains.exposed.gradle.setupTestDriverDependencies
import tanvd.kosogor.proxy.publishJar

plugins {
kotlin("jvm") apply true
}

repositories {
jcenter()
mavenCentral()
}

val dialect: String by project
Expand All @@ -31,23 +30,4 @@ dependencies {
}
}

publishJar {
publication {
artifactId = "exposed-money"
}

bintray {
username = project.properties["bintrayUser"]?.toString() ?: System.getenv("BINTRAY_USER")
secretKey = project.properties["bintrayApiKey"]?.toString() ?: System.getenv("BINTRAY_API_KEY")
repository = "exposed"
info {
publish = false
githubRepo = "https://github.com/JetBrains/Exposed.git"
vcsUrl = "https://github.com/JetBrains/Exposed.git"
userOrg = "kotlin"
license = "Apache-2.0"
}
}
}

setupDialectTest(dialect)
8 changes: 4 additions & 4 deletions exposed-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This starter will give you the latest version of [Exposed](https://github.com/Je
```mxml
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter</name>
<url>http://jcenter.bintray.com</url>
<id>mavenCentral</id>
<name>mavenCentral</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>

Expand All @@ -25,7 +25,7 @@ This starter will give you the latest version of [Exposed](https://github.com/Je
### Gradle
```groovy
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation 'org.jetbrains.exposed:exposed-spring-boot-starter:0.29.1'
Expand Down
Loading

0 comments on commit ad00553

Please sign in to comment.