|
| 1 | +plugins { |
| 2 | + id 'java' |
| 3 | + id 'signing' |
| 4 | + id 'maven-publish' |
| 5 | +} |
| 6 | + |
| 7 | +version = '0.10.2' + (project.hasProperty("version_snapshot") ? "-SNAPSHOT" : "") |
| 8 | +group = 'io.github.CDAGaming' |
| 9 | +description = 'Connect locally to the Discord client using IPC for a subset of RPC features like Rich Presence and Activity Join/Spectate' |
| 10 | +base.archivesName = 'DiscordIPC' |
| 11 | + |
| 12 | +JavaVersion targetVersion = JavaVersion.VERSION_1_8 |
| 13 | +int targetVersionInt = Integer.parseInt(targetVersion.majorVersion) |
| 14 | + |
| 15 | +[java].each { |
| 16 | + it.toolchain { |
| 17 | + languageVersion.set(JavaLanguageVersion.of(targetVersionInt)) |
| 18 | + } |
| 19 | + it.withSourcesJar() |
| 20 | + it.withJavadocJar() |
| 21 | +} |
| 22 | + |
| 23 | +repositories { |
| 24 | + mavenCentral() |
| 25 | +} |
| 26 | + |
| 27 | +dependencies { |
| 28 | + implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0' |
| 29 | + implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16' |
| 30 | + implementation group: 'com.kohlschutter.junixsocket', name: 'junixsocket-common', version: '2.10.1' |
| 31 | + implementation group: 'com.kohlschutter.junixsocket', name: 'junixsocket-native-common', version: '2.10.1' |
| 32 | + implementation group: 'net.lenni0451', name: 'Reflect', version: '1.4.0' |
| 33 | +} |
| 34 | + |
| 35 | +jar.manifest.mainAttributes([ |
| 36 | + 'Implementation-Title' : project.name, |
| 37 | + 'Implementation-Version': project.version |
| 38 | +]) |
| 39 | + |
| 40 | +[compileJava].each { |
| 41 | + it.options.encoding = 'UTF-8' |
| 42 | + it.options.deprecation = true |
| 43 | + it.options.fork = true |
| 44 | +} |
| 45 | + |
| 46 | +publishing { |
| 47 | + publications { |
| 48 | + mavenJava(MavenPublication) { |
| 49 | + from components.java |
| 50 | + |
| 51 | + pom { |
| 52 | + name = rootProject.name |
| 53 | + artifactId = rootProject.name |
| 54 | + packaging = 'jar' |
| 55 | + description = project.description |
| 56 | + url = 'https://github.com/CDAGaming/DiscordIPC' |
| 57 | + |
| 58 | + scm { |
| 59 | + connection = 'scm:git:git://github.com/CDAGaming/DiscordIPC.git' |
| 60 | + developerConnection = 'scm:git:ssh://github.com/CDAGaming/DiscordIPC.git' |
| 61 | + url = 'https://github.com/CDAGaming/DiscordIPC' |
| 62 | + } |
| 63 | + licenses { |
| 64 | + license { |
| 65 | + name = 'Apache License 2.0' |
| 66 | + url = 'https://github.com/CDAGaming/DiscordIPC/blob/master/LICENSE' |
| 67 | + } |
| 68 | + } |
| 69 | + developers { |
| 70 | + developer { |
| 71 | + id = 'cdagaming' |
| 72 | + name = 'CDAGaming' |
| 73 | + email = 'cstack2011@yahoo.com' |
| 74 | + } |
| 75 | + developer { |
| 76 | + id = 'jagrosh' |
| 77 | + name = 'John Grosh' |
| 78 | + email = 'j@gro.sh' |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + repositories { |
| 85 | + maven { |
| 86 | + credentials { |
| 87 | + username = project.findProperty("mvn.user") ?: System.getenv("OSSRH_USERNAME") |
| 88 | + password = project.findProperty("mvn.key") ?: System.getenv("OSSRH_PASSWORD") |
| 89 | + } |
| 90 | + |
| 91 | + def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" |
| 92 | + def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" |
| 93 | + url = version.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
| 94 | + } |
| 95 | + } |
| 96 | +} |
| 97 | + |
| 98 | +signing { |
| 99 | + useGpgCmd() |
| 100 | + sign publishing.publications.mavenJava |
| 101 | +} |
0 commit comments