@@ -4,8 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4
4
plugins {
5
5
`kotlin- dsl`
6
6
`java- gradle- plugin`
7
- `maven- publish`
8
- signing
7
+ alias(libs.plugins.com.vanniktech.maven.publish)
9
8
}
10
9
11
10
version = " 2.3.0"
@@ -26,9 +25,6 @@ dependencies {
26
25
java {
27
26
sourceCompatibility = JavaVersion .VERSION_1_8
28
27
targetCompatibility = JavaVersion .VERSION_1_8
29
-
30
- withJavadocJar()
31
- withSourcesJar()
32
28
}
33
29
34
30
tasks.withType<Test > {
@@ -54,55 +50,46 @@ gradlePlugin {
54
50
}
55
51
}
56
52
57
- publishing {
58
- publications {
59
- create<MavenPublication >(" pluginMaven" ) {
60
- pom {
53
+
54
+ afterEvaluate {
55
+ publishing {
56
+ publications {
57
+ named<MavenPublication >(" pluginMaven" ) {
61
58
groupId = " io.github.luca992.multiplatform-swiftpackage"
62
59
artifactId = " io.github.luca992.multiplatform-swiftpackage.gradle.plugin"
63
-
64
- name.set(" Multiplatform Swift Package" )
65
- description.set(" Gradle plugin to generate a Swift.package file and XCFramework to distribute a Kotlin Multiplatform iOS library" )
66
- url.set(" https://github.com/luca992/multiplatform-swiftpackage" )
67
-
68
- licenses {
69
- license {
70
- name.set(" Apache License, Version 2.0" )
71
- url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
72
- }
73
- }
74
- developers {
75
- developer {
76
- name.set(" Georg Dresler" )
77
- }
78
- }
79
- scm {
80
- connection.set(" scm:git: https://github.com/luca992/multiplatform-swiftpackage.git" )
81
- developerConnection.set(" scm:git:ssh://github.com/luca992/multiplatform-swiftpackage.git" )
82
- url.set(" https://github.com/luca992/multiplatform-swiftpackage" )
83
- }
84
60
}
85
61
}
86
62
}
63
+ }
64
+
65
+ mavenPublishing {
66
+ pom {
67
+ name.set(" Multiplatform Swift Package" )
68
+ description.set(" Gradle plugin to generate a Swift.package file and XCFramework to distribute a Kotlin Multiplatform iOS library" )
69
+ url.set(" https://github.com/luca992/multiplatform-swiftpackage" )
87
70
88
- repositories {
89
- maven {
90
- val releasesUrl = " https://central.sonatype.com/api/v1/publisher/upload"
91
- val snapshotsUrl = " https://central.sonatype.com/repository/maven-snapshots/"
92
- name = " mavencentral"
93
- url = uri(if (version.toString().endsWith(" SNAPSHOT" )) snapshotsUrl else releasesUrl)
94
- credentials {
95
- username = System .getenv(" ossrh.username" ) ? : properties[" ossrh.username" ].toString()
96
- password = System .getenv(" ossrh.password" ) ? : properties[" ossrh.password" ].toString()
71
+ licenses {
72
+ license {
73
+ name.set(" Apache License, Version 2.0" )
74
+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
97
75
}
98
76
}
77
+ developers {
78
+ developer {
79
+ name.set(" Georg Dresler" )
80
+ }
81
+ developer {
82
+ name.set(" Luca Spinazzola" )
83
+ }
84
+ }
85
+ scm {
86
+ connection.set(" scm:git:https://github.com/luca992/multiplatform-swiftpackage.git" )
87
+ developerConnection.set(" scm:git:ssh://github.com/luca992/multiplatform-swiftpackage.git" )
88
+ url.set(" https://github.com/luca992/multiplatform-swiftpackage" )
89
+ }
99
90
}
100
91
}
101
92
102
- signing {
103
- sign(publishing.publications[" pluginMaven" ])
104
- }
105
-
106
93
tasks.javadoc {
107
94
if (JavaVersion .current().isJava9Compatible) {
108
95
(options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
0 commit comments