diff --git a/build.gradle.kts b/build.gradle.kts index 6798c68072..1a4acfc9ff 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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() } diff --git a/buildScripts/gradle/publishing.gradle.kts b/buildScripts/gradle/publishing.gradle.kts new file mode 100644 index 0000000000..b6cff92ebc --- /dev/null +++ b/buildScripts/gradle/publishing.gradle.kts @@ -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("ExposedJars") { + artifactId = project.name + from(project.components["java"]) + pom { + configureMavenCentralMetadata(project) + } + signPublicationIfKeyPresent(project) + } + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 64b1767cd3..ab9c97f503 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -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 } diff --git a/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Publishing.kt b/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Publishing.kt new file mode 100644 index 0000000000..82c098aa50 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/exposed/gradle/Publishing.kt @@ -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 Property.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:git@github.com: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("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) +} \ No newline at end of file diff --git a/exposed-core/build.gradle.kts b/exposed-core/build.gradle.kts index 948a6da2bf..9dfe5836db 100644 --- a/exposed-core/build.gradle.kts +++ b/exposed-core/build.gradle.kts @@ -1,12 +1,11 @@ import org.jetbrains.exposed.gradle.Versions -import tanvd.kosogor.proxy.publishJar plugins { kotlin("jvm") apply true } repositories { - jcenter() + mavenCentral() } dependencies { @@ -14,23 +13,4 @@ dependencies { 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" - } - } } \ No newline at end of file diff --git a/exposed-dao/build.gradle.kts b/exposed-dao/build.gradle.kts index 0d0c42188b..7d2d9cf3fb 100644 --- a/exposed-dao/build.gradle.kts +++ b/exposed-dao/build.gradle.kts @@ -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" - } - } } \ No newline at end of file diff --git a/exposed-java-time/build.gradle.kts b/exposed-java-time/build.gradle.kts index 5c594826a9..871193e46b 100644 --- a/exposed-java-time/build.gradle.kts +++ b/exposed-java-time/build.gradle.kts @@ -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 @@ -38,25 +37,6 @@ tasks.withType { } } -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 { diff --git a/exposed-jdbc/build.gradle.kts b/exposed-jdbc/build.gradle.kts index 170c423519..a4cf6a9bf9 100644 --- a/exposed-jdbc/build.gradle.kts +++ b/exposed-jdbc/build.gradle.kts @@ -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" - } - } } \ No newline at end of file diff --git a/exposed-jodatime/build.gradle.kts b/exposed-jodatime/build.gradle.kts index 676357bd46..0999b4bc22 100644 --- a/exposed-jodatime/build.gradle.kts +++ b/exposed-jodatime/build.gradle.kts @@ -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 @@ -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) \ No newline at end of file diff --git a/exposed-money/build.gradle.kts b/exposed-money/build.gradle.kts index b6650a1891..89e913e2d9 100644 --- a/exposed-money/build.gradle.kts +++ b/exposed-money/build.gradle.kts @@ -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 @@ -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) \ No newline at end of file diff --git a/exposed-spring-boot-starter/README.md b/exposed-spring-boot-starter/README.md index 82182106c4..2aaf5b4bc3 100644 --- a/exposed-spring-boot-starter/README.md +++ b/exposed-spring-boot-starter/README.md @@ -8,9 +8,9 @@ This starter will give you the latest version of [Exposed](https://github.com/Je ```mxml - jcenter - jcenter - http://jcenter.bintray.com + mavenCentral + mavenCentral + https://repo1.maven.org/maven2/ @@ -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' diff --git a/exposed-spring-boot-starter/build.gradle.kts b/exposed-spring-boot-starter/build.gradle.kts index 4f94eb4cc3..3c8c4d332d 100644 --- a/exposed-spring-boot-starter/build.gradle.kts +++ b/exposed-spring-boot-starter/build.gradle.kts @@ -1,16 +1,13 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.exposed.gradle.Versions -import tanvd.kosogor.proxy.publishJar plugins { kotlin("jvm") apply true } repositories { - jcenter() mavenCentral() - maven("https://dl.bintray.com/jfrog/jfrog-jars") } dependencies { @@ -26,25 +23,6 @@ dependencies { testImplementation("com.h2database", "h2", Versions.h2) } -publishJar { - publication { - artifactId = "exposed-spring-boot-starter" - } - - 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") diff --git a/exposed-tests/build.gradle.kts b/exposed-tests/build.gradle.kts index c9c12b47a2..1cbbad7126 100644 --- a/exposed-tests/build.gradle.kts +++ b/exposed-tests/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } repositories { - jcenter() + mavenCentral() } val dialect: String by project diff --git a/exposed/build.gradle.kts b/exposed/build.gradle.kts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c05355..e708b1c023 100755 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 186b71557c..442d9132ea 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c51583..4f906e0c81 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index a9f778a7a9..ac1b06f938 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/spring-transaction/build.gradle.kts b/spring-transaction/build.gradle.kts index 673a165adf..b2307d0319 100644 --- a/spring-transaction/build.gradle.kts +++ b/spring-transaction/build.gradle.kts @@ -1,16 +1,13 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.exposed.gradle.Versions -import tanvd.kosogor.proxy.publishJar plugins { kotlin("jvm") apply true } repositories { - jcenter() mavenCentral() - maven("https://dl.bintray.com/jfrog/jfrog-jars") } dependencies { @@ -32,25 +29,6 @@ dependencies { testImplementation("com.h2database", "h2", Versions.h2) } -publishJar { - publication { - artifactId = "spring-transaction" - } - - 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 {