|
| 1 | +plugins { |
| 2 | + id 'java-library' |
| 3 | + id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' |
| 4 | + id 'maven-publish' |
| 5 | + id 'signing' |
| 6 | +} |
| 7 | + |
| 8 | +repositories { |
| 9 | + mavenCentral() |
| 10 | +} |
| 11 | + |
| 12 | +dependencies { |
| 13 | + api libs.org.slf4j.slf4j.api |
| 14 | + testImplementation libs.org.junit.jupiter.junit.jupiter.api |
| 15 | + testImplementation libs.org.junit.jupiter.junit.jupiter.engine |
| 16 | + testImplementation libs.org.junit.jupiter.junit.jupiter |
| 17 | + testImplementation libs.org.slf4j.slf4j.simple |
| 18 | +} |
| 19 | + |
| 20 | +group = 'org.purejava' |
| 21 | +version = '1.4.3-SNAPSHOT' |
| 22 | +description = 'Java bindings for libayatana-appindicator and libappindicator-gtk3 in 100% pure Java' |
| 23 | +java.sourceCompatibility = JavaVersion.VERSION_22 |
| 24 | + |
| 25 | +def sonatypeUsername = System.getenv("SONATYPE_USERNAME") ?: '' |
| 26 | +def sonatypePassword = System.getenv("SONATYPE_PASSWORD") ?: '' |
| 27 | + |
| 28 | +java { |
| 29 | + withSourcesJar() |
| 30 | + withJavadocJar() |
| 31 | +} |
| 32 | + |
| 33 | +test { |
| 34 | + useJUnitPlatform() |
| 35 | + filter { |
| 36 | + includeTestsMatching "AppIndicatorTest" |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +publishing { |
| 41 | + publications { |
| 42 | + mavenJava(MavenPublication) { |
| 43 | + from(components.java) |
| 44 | + pom { |
| 45 | + name = 'libappindicator-gtk3-java-minimal' |
| 46 | + description = 'Java bindings for libayatana-appindicator and libappindicator-gtk3 in 100% pure Java' |
| 47 | + url = 'https://github.com/purejava/appindicator-gtk3-java' |
| 48 | + licenses { |
| 49 | + license { |
| 50 | + name = 'MIT License' |
| 51 | + url = 'https://opensource.org/licenses/MIT' |
| 52 | + } |
| 53 | + } |
| 54 | + developers { |
| 55 | + developer { |
| 56 | + id = 'purejava' |
| 57 | + name = 'Ralph Plawetzki' |
| 58 | + |
| 59 | + } |
| 60 | + } |
| 61 | + scm { |
| 62 | + connection = 'scm:git:git://github.com/purejava/appindicator-gtk3-java.git' |
| 63 | + developerConnection = 'scm:git:ssh://github.com/purejava/appindicator-gtk3-java.git' |
| 64 | + url = 'https://github.com/purejava/appindicator-gtk3-java/tree/minimal' |
| 65 | + } |
| 66 | + issueManagement { |
| 67 | + system = 'GitHub Issues' |
| 68 | + url = 'https://github.com/purejava/appindicator-gtk3-java/issues' |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | +} |
| 74 | + |
| 75 | +nexusPublishing { |
| 76 | + repositories { |
| 77 | + sonatype { //only for users registered in Sonatype after 24 Feb 2021 |
| 78 | + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) |
| 79 | + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) |
| 80 | + username = sonatypeUsername |
| 81 | + password = sonatypePassword |
| 82 | + } |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +if (!version.toString().endsWith("-SNAPSHOT")) { |
| 87 | + signing { |
| 88 | + useGpgCmd() |
| 89 | + sign configurations.runtimeElements |
| 90 | + sign publishing.publications.mavenJava |
| 91 | + } |
| 92 | +} |
| 93 | + |
| 94 | +javadoc { |
| 95 | + if(JavaVersion.current().isJava9Compatible()) { |
| 96 | + options.addBooleanOption('html5', true) |
| 97 | + } |
| 98 | +} |
| 99 | + |
| 100 | +tasks.withType(Javadoc) { |
| 101 | + failOnError = false |
| 102 | +} |
| 103 | + |
| 104 | +tasks.withType(JavaCompile) { |
| 105 | + options.encoding = 'UTF-8' |
| 106 | +} |
| 107 | + |
| 108 | +tasks.withType(Javadoc) { |
| 109 | + options.encoding = 'UTF-8' |
| 110 | +} |
0 commit comments