From 259a85fd7a38c20e97dd398853475f92840790c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0m=C3=ADd?= Date: Sun, 20 Sep 2020 15:54:20 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9E=96=20Remove=20unused=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/build.gradle.kts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 67bbc17..f991d74 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -5,12 +5,10 @@ import org.gradle.kotlin.dsl.* import org.gradle.api.tasks.bundling.Jar plugins { - id("java-library") + id("java-gradle-plugin") kotlin("jvm") id("org.jetbrains.dokka") - id("java-gradle-plugin") id("maven-publish") - id("maven") id("com.jfrog.bintray") } From 8dc165240f2f37905b7ecc95b9c9db9a9f5aa4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0m=C3=ADd?= Date: Sun, 20 Sep 2020 15:58:22 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Clean=20buildscript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 7 +------ lib/build.gradle.kts | 21 +++------------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f8f8cb7..ce58f39 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,6 @@ -import org.gradle.kotlin.dsl.repositories - buildscript { repositories { - google() jcenter() - mavenCentral() } dependencies { @@ -17,7 +13,6 @@ buildscript { allprojects { repositories { - google() jcenter() // For OpenApi generator snapshot @@ -28,4 +23,4 @@ allprojects { tasks.create("clean") { delete(rootProject.buildDir) -} \ No newline at end of file +} diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index f991d74..7f220e4 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -1,8 +1,6 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import org.jetbrains.dokka.gradle.DokkaTask import com.jfrog.bintray.gradle.BintrayExtension -import org.gradle.kotlin.dsl.* -import org.gradle.api.tasks.bundling.Jar +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("java-gradle-plugin") @@ -13,19 +11,12 @@ plugins { } dependencies { -// implementation(fileTree(args = *arrayOf(Pair("dir", "libs"), Pair("include", arrayOf("*.jar"))))) implementation(gradleApi()) - - // Kotlin implementation(Dependencies.Kotlin.kotlinStbLib) - - // OpenAPI implementation(Dependencies.Libs.openApiCodegen) - // Tests testImplementation(Dependencies.TestLibs.junit) testImplementation(Dependencies.TestLibs.kotlinTest) - implementation(kotlin("stdlib-jdk8")) } tasks.withType { @@ -35,7 +26,7 @@ tasks.withType { } val dokka by tasks.getting(DokkaTask::class) { - outputFormat = "html" // html, md, javadoc, + outputFormat = "html" outputDirectory = "$buildDir/dokka/html" configuration { moduleName = "lib" @@ -63,7 +54,6 @@ gradlePlugin { } group = Artifact.groupId -version = "${project.version}" val productionPublicName = "production" @@ -102,7 +92,6 @@ publishing { from(components["java"]) artifact(tasks["sourcesJar"]) artifact(tasks["dokkaHtmlJar"]) - //artifact(sourcesJar.get()) } } @@ -110,7 +99,3 @@ publishing { maven(url = "http://dl.bintray.com/emanprague/maven") } } - -repositories { - mavenCentral() -} \ No newline at end of file From c3c2ec825c5df8967460b9bf3a9270d6798d8923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0m=C3=ADd?= Date: Sun, 20 Sep 2020 16:11:33 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20publishing=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 + lib/build.gradle.kts | 43 ++++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ce58f39..849d8ca 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,6 +19,7 @@ allprojects { maven(url = "https://oss.sonatype.org/content/repositories/snapshots") } + group = Artifact.groupId } tasks.create("clean") { diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 7f220e4..d393e7f 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -29,18 +29,18 @@ val dokka by tasks.getting(DokkaTask::class) { outputFormat = "html" outputDirectory = "$buildDir/dokka/html" configuration { - moduleName = "lib" + moduleName = Artifact.artifactId } } -tasks.create("sourcesJar") { - from(files("src/main/kotlin")) +val sourcesJar by tasks.creating(Jar::class) { archiveClassifier.set("sources") + from(files("src/main/kotlin")) } -tasks.create("dokkaHtmlJar") { +val dokkaHtmlJar by tasks.creating(Jar::class) { archiveClassifier.set("kdoc-html") - from("$buildDir/dokka/html") + from(dokka.outputDirectory) dependsOn(dokka) } @@ -53,15 +53,27 @@ gradlePlugin { } } -group = Artifact.groupId +val releasePublication = "release" +publishing { + publications { + create(releasePublication) { + artifactId = Artifact.artifactId + from(components["java"]) + artifact(sourcesJar) + artifact(dokkaHtmlJar) + } + } -val productionPublicName = "production" + repositories { + maven(url = "https://dl.bintray.com/emanprague/maven") { name = "bintray" } + } +} bintray { user = findPropertyOrNull("bintray.user") key = findPropertyOrNull("bintray.apikey") publish = true - setPublications(productionPublicName) + setPublications(releasePublication) pkg(delegateClosureOf { repo = "maven" name = "cz.eman.swagger.codegen" @@ -84,18 +96,3 @@ bintray { desc = description }) } - -publishing { - publications { - register("production", MavenPublication::class) { - artifactId = Artifact.artifactId - from(components["java"]) - artifact(tasks["sourcesJar"]) - artifact(tasks["dokkaHtmlJar"]) - } - } - - repositories { - maven(url = "http://dl.bintray.com/emanprague/maven") - } -} From 7f42bc3c73ef11ffb804584487f3a080b3a55e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0m=C3=ADd?= Date: Sun, 20 Sep 2020 16:15:56 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A7=20Add=20metadata=20to=20the=20?= =?UTF-8?q?POM=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/build.gradle.kts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index d393e7f..5abaa04 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -61,6 +61,32 @@ publishing { from(components["java"]) artifact(sourcesJar) artifact(dokkaHtmlJar) + + pom { + name.set("Swagger Codegen") + description.set("A fork of the swagger-codegen by eMan") + url.set("https://github.com/eManPrague/swagger-codegen") + + licenses { + license { + name.set("MIT License") + url.set("https://opensource.org/licenses/MIT") + } + } + + developers { + developer { + name.set("eMan a.s.") + email.set("info@eman.cz") + } + } + + scm { + connection.set("scm:git:git://github.com/eManPrague/swagger-codegen.git") + developerConnection.set("scm:git:ssh://git@github.com/eManPrague/swagger-codegen.git") + url.set("https://github.com/eManPrague/swagger-codegen") + } + } } }