|
1 | 1 | plugins {
|
2 | 2 | id 'java-library'
|
3 |
| - id 'com.github.johnrengelman.shadow' version '7.0.0' |
4 | 3 | id 'maven-publish'
|
5 | 4 | id 'signing'
|
| 5 | + id 'com.github.johnrengelman.shadow' version '7.0.0' |
| 6 | + id 'xyz.jpenilla.run-waterfall' version '2.3.1' |
| 7 | + id 'com.modrinth.minotaur' version '2.8.7' |
| 8 | + id 'io.papermc.hangar-publish-plugin' version '0.1.2' |
6 | 9 | }
|
7 | 10 |
|
8 | 11 | group 'com.exaroton'
|
9 |
| -version '1.5.2' |
| 12 | + |
| 13 | +version = project.hasProperty('release') ? project.getProperty('release') : 'dev' |
| 14 | +java.sourceCompatibility = JavaVersion.VERSION_11 |
| 15 | +java.targetCompatibility = JavaVersion.VERSION_11 |
10 | 16 |
|
11 | 17 | repositories {
|
12 | 18 | maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
13 | 19 | mavenCentral()
|
14 | 20 | }
|
15 | 21 |
|
16 | 22 | dependencies {
|
17 |
| - shadow group: 'net.md-5', name: 'bungeecord-api', version: '1.16-R0.5-SNAPSHOT' |
| 23 | + shadow "net.md-5:bungeecord-api:${minecraftVersion}-R0.1-SNAPSHOT" |
18 | 24 | testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
19 | 25 | testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
20 |
| - implementation 'com.exaroton:api:1.4.2' |
| 26 | + implementation 'com.exaroton:api:1.6.2' |
21 | 27 | }
|
22 | 28 |
|
23 |
| -ext.isReleaseVersion = !version.endsWith("SNAPSHOT") |
| 29 | +ext.isReleaseVersion = project.version != "dev" |
24 | 30 |
|
25 | 31 | java {
|
26 | 32 | withJavadocJar()
|
27 | 33 | withSourcesJar()
|
28 | 34 | }
|
29 | 35 |
|
| 36 | +processResources { |
| 37 | + filter { |
| 38 | + it.replace('${project.version}', project.version) |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +shadowJar { |
| 43 | + archiveClassifier.set('') |
| 44 | +} |
| 45 | + |
| 46 | +tasks { |
| 47 | + runWaterfall { |
| 48 | + waterfallVersion(minecraftVersion) |
| 49 | + } |
| 50 | +} |
| 51 | + |
30 | 52 | publishing {
|
31 | 53 | repositories {
|
32 | 54 | maven {
|
33 | 55 | def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
34 | 56 | def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
|
35 | 57 | url = isReleaseVersion ? releaseRepo : snapshotRepo
|
36 | 58 | credentials {
|
37 |
| - username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user" |
38 |
| - password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password" |
| 59 | + username = findProperty('OSSRH_USERNAME') |
| 60 | + password = findProperty('OSSRH_PASSWORD') |
39 | 61 | }
|
40 | 62 | }
|
41 | 63 | }
|
@@ -72,18 +94,55 @@ publishing {
|
72 | 94 | }
|
73 | 95 |
|
74 | 96 | signing {
|
| 97 | + def signingKey = findProperty("SIGNING_KEY").toString() |
| 98 | + def signingPassword = findProperty("SIGNING_PASSPHRASE").toString() |
| 99 | + useInMemoryPgpKeys(signingKey, signingPassword) |
75 | 100 | sign publishing.publications.mavenJava
|
76 | 101 | }
|
| 102 | + |
77 | 103 | tasks.withType(Sign) {
|
78 | 104 | onlyIf { isReleaseVersion }
|
79 | 105 | }
|
80 | 106 |
|
81 |
| -processResources { |
82 |
| - filter { |
83 |
| - it.replace('${project.version}', project.version) |
84 |
| - } |
| 107 | +modrinth { |
| 108 | + token = System.getenv("MODRINTH_TOKEN") |
| 109 | + projectId = "h9yHzOys" |
| 110 | + uploadFile = shadowJar |
| 111 | + gameVersions = [ |
| 112 | + "1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", |
| 113 | + "1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6", |
| 114 | + "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4", |
| 115 | + "1.18", "1.18.1", "1.18.2", |
| 116 | + "1.17", "1.17.1", |
| 117 | + "1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5", |
| 118 | + "1.15", "1.15.1", "1.15.2", |
| 119 | + "1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4", |
| 120 | + "1.13", "1.13.1", "1.13.2", |
| 121 | + "1.12", "1.12.1", "1.12.2", |
| 122 | + "1.11", "1.11.1", "1.11.2", |
| 123 | + "1.10", "1.10.1", "1.10.2", |
| 124 | + "1.9", "1.9.1", "1.9.2", "1.9.3", "1.9.4", |
| 125 | + "1.8", "1.8.1", "1.8.2", "1.8.3", "1.8.4", "1.8.5", "1.8.6", "1.8.7", "1.8.8", "1.8.9", |
| 126 | + "1.7", "1.7.1", "1.7.2", "1.7.3", "1.7.4", "1.7.5", "1.7.6", "1.7.7", "1.7.8", "1.7.9", "1.7.10" |
| 127 | + ] |
| 128 | + loaders = ["bungeecord", "waterfall"] |
| 129 | + changelog = rootProject.file("CHANGELOG.md").text |
85 | 130 | }
|
86 | 131 |
|
87 |
| -shadowJar { |
88 |
| - archiveClassifier.set('') |
| 132 | +hangarPublish { |
| 133 | + publications.register("plugin") { |
| 134 | + version.set(project.version as String) |
| 135 | + channel.set("Release") |
| 136 | + id.set("exaroton-proxy-plugin") |
| 137 | + apiKey.set(System.getenv("HANGAR_TOKEN")) |
| 138 | + platforms { |
| 139 | + register(io.papermc.hangarpublishplugin.model.Platforms.WATERFALL) { |
| 140 | + // Set the JAR file to upload |
| 141 | + jar.set(tasks.shadowJar.outputs.files.singleFile) |
| 142 | + |
| 143 | + platformVersions.set(project.hangarWaterfallVersions.split(",").collect { it.trim() }) |
| 144 | + changelog.set(rootProject.file("CHANGELOG.md").text) |
| 145 | + } |
| 146 | + } |
| 147 | + } |
89 | 148 | }
|
0 commit comments