@@ -4,6 +4,7 @@ plugins {
44 id ' java'
55 id ' java-library'
66 id ' maven-publish'
7+ id ' signing'
78}
89
910sourceCompatibility = JavaVersion . VERSION_1_8
@@ -23,11 +24,25 @@ repositories {
2324dependencies {
2425}
2526
26- task sourceJar (type : Jar ) {
27+ javadoc {
28+ source = sourceSets. main. allJava
29+ classpath = configurations. compileClasspath
30+
31+ if (JavaVersion . current(). isJava9Compatible()) {
32+ options. addBooleanOption(' html5' , true )
33+ }
34+ }
35+
36+ task sourcesJar (type : Jar ) {
2737 classifier ' sources'
2838 from sourceSets. main. allJava
2939}
3040
41+ task packageJavadoc (type : Jar ) {
42+ classifier ' javadoc'
43+ from javadoc
44+ }
45+
3146publishing {
3247 repositories {
3348 maven {
@@ -38,6 +53,14 @@ publishing {
3853 password = System . getenv(" GITHUB_TOKEN" )
3954 }
4055 }
56+ maven {
57+ name = " Sonatype"
58+ url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
59+ credentials {
60+ username = System . getenv(" SONATYPE_USERNAME" )
61+ password = System . getenv(" SONATYPE_PASSWORD" )
62+ }
63+ }
4164 }
4265
4366 publications {
@@ -47,7 +70,36 @@ publishing {
4770 artifactId = rootProject. name
4871
4972 from components. java
50- artifact tasks. sourceJar
73+ artifact sourcesJar
74+ artifact packageJavadoc
75+
76+ pom {
77+ name = ' Polybool Java'
78+ description = ' Boolean operations on polygons (union, intersection, difference, xor).'
79+ url = ' https://github.com/menecats/polybool-java'
80+ licenses {
81+ license {
82+ name = ' MIT'
83+ url = ' https://opensource.org/licenses/MIT'
84+ }
85+ }
86+ developers {
87+ developer {
88+ id = ' menecats'
89+ name = ' Davide Menegatti'
90+ email = ' d.menegatti@recrosoftware.com'
91+ }
92+ }
93+ scm {
94+ connection = ' scm:https://github.com/Menecats/polybool-java.git'
95+ developerConnection = ' scm:git://github.com/Menecats/polybool-java.git'
96+ url = ' https://github.com/menecats/polybool-java'
97+ }
98+ }
5199 }
52100 }
101+
102+ signing {
103+ sign publishing. publications. polybool
104+ }
53105}
0 commit comments