@@ -5,6 +5,9 @@ plugins {
55 kotlin(" jvm" ) version " 1.8.20"
66 id(" org.ajoberstar.grgit" ) version " 5.2.0"
77 `java- library`
8+ `maven- publish`
9+ signing
10+ id(" org.jetbrains.dokka" ) version " 1.8.10"
811}
912
1013if (! File (" $rootDir /.git" ).exists()) {
@@ -60,4 +63,79 @@ kotlin {
6063 languageVersion = " 2.0"
6164 }
6265 }
63- }
66+ }
67+
68+ val sourceJar by tasks.register<Jar >(" kotlinJar" ) {
69+ from(sourceSets.main.get().allSource)
70+ archiveClassifier.set(" sources" )
71+ }
72+ val dokkaJavadocJar by tasks.register<Jar >(" dokkaHtmlJar" ) {
73+ dependsOn(rootProject.tasks.dokkaHtml)
74+ from(rootProject.tasks.dokkaHtml.flatMap { it.outputDirectory })
75+ archiveClassifier.set(" html-docs" )
76+ }
77+
78+ val dokkaHtmlJar by tasks.register<Jar >(" dokkaJavadocJar" ) {
79+ dependsOn(rootProject.tasks.dokkaJavadoc)
80+ from(rootProject.tasks.dokkaJavadoc.flatMap { it.outputDirectory })
81+ archiveClassifier.set(" javadoc" )
82+ }
83+
84+ publishing {
85+ publications {
86+ create<MavenPublication >(" mavenJava" ) {
87+ from(components.findByName(" java" ))
88+ groupId = " dev.themeinerlp"
89+ artifactId = " plugin-debug"
90+ version = rootProject.version.toString()
91+ artifact(dokkaJavadocJar)
92+ artifact(dokkaHtmlJar)
93+ artifact(sourceJar)
94+ pom {
95+ name.set(" Plugin debug" )
96+ description.set(" A simple library to upload plugin debugs" )
97+ url.set(" https://github.com/OneLiteFeatherNET/Plugin-Debug" )
98+ licenses {
99+ license {
100+ name.set(" AGPL-3.0" )
101+ url.set(" https://github.com/OneLiteFeatherNET/Plugin-Debug/blob/main/LICENSE" )
102+ }
103+ }
104+ issueManagement {
105+ system.set(" Github" )
106+ url.set(" https://github.com/OneLiteFeatherNET/Plugin-Debug/issues" )
107+ }
108+ developers {
109+ developer {
110+ id.set(" TheMeinerLP" )
111+ name.set(" Phillipp Glanz" )
112+ 113+ }
114+ }
115+ scm {
116+ connection.set(
" scm:[email protected] :OneLiteFeatherNET/Plugin-Debug.git" )
117+ developerConnection.set(
" scm:[email protected] :OneLiteFeatherNET/Plugin-Debug.git" )
118+ url.set(" https://github.com/OneLiteFeatherNET/Plugin-Debug" )
119+ }
120+ }
121+ }
122+ }
123+ repositories {
124+ maven {
125+ val releasesRepoUrl = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
126+ val snapshotsRepoUrl = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
127+ url = if (version.toString().contains(" SNAPSHOT" )) uri(snapshotsRepoUrl) else uri(releasesRepoUrl)
128+ credentials {
129+ username = System .getenv(" OSSRH_USERNAME" )
130+ password = System .getenv(" OSSRH_PASSWORD" )
131+ }
132+ }
133+ }
134+ }
135+
136+ signing {
137+ val signingKey: String? by project
138+ val signingPassword: String? by project
139+ useInMemoryPgpKeys(signingKey, signingPassword)
140+ sign(publishing.publications)
141+ }
0 commit comments