forked from JetBrains/Exposed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Please consider moving to maven central JetBrains#1160
- Loading branch information
1 parent
a83e038
commit ad00553
Showing
19 changed files
with
128 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
67 changes: 67 additions & 0 deletions
67
buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Publishing.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.