@@ -15,8 +15,7 @@ plugins {
1515 `java- gradle- plugin`
1616 alias(libs.plugins.gradle.plugin.publish)
1717 alias(libs.plugins.kotlinter)
18- `maven- publish`
19- signing
18+ alias(libs.plugins.vanniktech.publish)
2019}
2120
2221// See https://github.com/slackhq/keeper/pull/11#issuecomment-579544375 for context
@@ -57,66 +56,37 @@ gradlePlugin {
5756 }
5857}
5958
60- val isReleaseBuild : Boolean = ! version.toString().endsWith(" SNAPSHOT" )
59+ java {
60+ withJavadocJar()
61+ withSourcesJar()
62+ }
6163
62- val sonatypeUsername : String? by project
63- val sonatypePassword : String? by project
64+ mavenPublishing {
65+ publishToMavenCentral()
66+ signAllPublications()
6467
65- publishing {
66- repositories {
67- repositories {
68- maven {
69- val releasesRepoUrl = uri(" https://central.sonatype.com/api/v1/publisher/deployments/upload/" )
70- val snapshotsRepoUrl = uri(" https://central.sonatype.com/repository/maven-snapshots/" )
71- url = if (isReleaseBuild) releasesRepoUrl else snapshotsRepoUrl
72- credentials {
73- username = sonatypeUsername
74- password = sonatypePassword
75- }
68+ pom {
69+ name.set(" Fladle" )
70+ description.set(project.description)
71+ url.set(" https://github.com/runningcode/fladle" )
72+ licenses {
73+ license {
74+ name.set(" The Apache License, Version 2.0" )
75+ url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
7676 }
7777 }
78- }
79- publications {
80- afterEvaluate {
81- named<MavenPublication >(" fladlePluginMarkerMaven" ) {
82- pom.configureForFladle(" Fladle" )
78+ developers {
79+ developer {
80+ id.set(" runningcode" )
81+ name.set(" Nelson Osacky" )
8382 }
84-
85- named<MavenPublication >(" pluginMaven" ) {
86- pom.configureForFladle(" Fladle" )
87- }
88- named<MavenPublication >(" fulladlePluginMarkerMaven" ) {
89- pom.configureForFladle(" Fulladle" )
90- }
91- }
92- }
93- }
94-
95- signing {
96- isRequired = isReleaseBuild
97- }
98-
99- fun org.gradle.api.publish.maven.MavenPom.configureForFladle (pluginName : String ) {
100- name.set(pluginName)
101- description.set(project.description)
102- url.set(" https://github.com/runningcode/fladle" )
103- licenses {
104- license {
105- name.set(" The Apache License, Version 2.0" )
106- url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
10783 }
108- }
109- developers {
110- developer {
111- id.set(" runningcode" )
112- name.set(" Nelson Osacky" )
84+ scm {
85+ connection.set(" scm:git:git://github.com/runningcode/fladle.git" )
86+ developerConnection.set(" scm:git:ssh://github.com/runningcode/fladle.git" )
87+ url.set(" https://github.com/runningcode/fladle" )
11388 }
11489 }
115- scm {
116- connection.set(" scm:git:git://github.com/runningcode/fladle.git" )
117- developerConnection.set(" scm:git:ssh://github.com/runningcode/fladle.git" )
118- url.set(" https://github.com/runningcode/fladle" )
119- }
12090}
12191
12292tasks.withType(Test ::class .java).configureEach {
@@ -134,10 +104,10 @@ tasks.withType(ValidatePlugins::class.java).configureEach {
134104
135105// Ensure Java 11 Compatibility. See https://github.com/runningcode/fladle/issues/246
136106tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ::class .java).configureEach {
137- kotlinOptions {
138- jvmTarget = " 11 "
139- languageVersion = " 1.7 "
140- apiVersion = " 1.7 "
107+ compilerOptions {
108+ jvmTarget.set(org.jetbrains.kotlin.gradle.dsl. JvmTarget . JVM_11 )
109+ languageVersion.set(org.jetbrains.kotlin.gradle.dsl. KotlinVersion . KOTLIN_1_7 )
110+ apiVersion.set(org.jetbrains.kotlin.gradle.dsl. KotlinVersion . KOTLIN_1_7 )
141111 }
142112}
143113
0 commit comments