|
1 | 1 | plugins {
|
2 | 2 | id "architectury-plugin" version "3.4-SNAPSHOT"
|
3 | 3 | id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
|
| 4 | + id "me.modmuss50.mod-publish-plugin" version "0.5.1" |
4 | 5 | }
|
5 | 6 |
|
6 | 7 | architectury {
|
@@ -81,14 +82,93 @@ allprojects {
|
81 | 82 | }
|
82 | 83 | }
|
83 | 84 |
|
84 |
| - tasks.withType(JavaCompile) { |
| 85 | + tasks.withType(JavaCompile).configureEach { |
85 | 86 | options.encoding = "UTF-8"
|
86 | 87 | options.release = 21
|
87 | 88 | }
|
88 | 89 |
|
89 | 90 | java {
|
90 | 91 | withSourcesJar()
|
91 | 92 | }
|
| 93 | + |
| 94 | + publishing { |
| 95 | + repositories { |
| 96 | + if (ftbPublishing.ftbToken) { |
| 97 | + maven { |
| 98 | + url ftbPublishing.ftbURL |
| 99 | + credentials { |
| 100 | + username = ftbPublishing.ftbUser |
| 101 | + password = ftbPublishing.ftbToken |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + |
| 106 | + if (ftbPublishing.sapsToken) { |
| 107 | + maven { |
| 108 | + url ftbPublishing.sapsURL |
| 109 | + credentials { |
| 110 | + username = ftbPublishing.sapsUser |
| 111 | + password = ftbPublishing.sapsToken |
| 112 | + } |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + } |
92 | 117 | }
|
93 | 118 |
|
94 |
| -task curseforgePublish |
| 119 | +publishMods { |
| 120 | + dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null |
| 121 | + changelog = providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided") |
| 122 | + version = "${mod_version}" |
| 123 | + |
| 124 | + // TODO: Migrate to something else |
| 125 | + def tag = providers.environmentVariable("TAG").getOrElse("release") |
| 126 | + type = tag == "beta" ? BETA : (tag == "alpha" ? ALPHA : STABLE) |
| 127 | + |
| 128 | + def createOptions = (String projectName) -> { |
| 129 | + publishOptions { |
| 130 | + file = project.provider { project(":$projectName").tasks.remapJar }.flatMap { it.archiveFile } |
| 131 | + displayName = "[${projectName.toUpperCase()}][${minecraft_version}] ${readable_name} ${mod_version}" |
| 132 | + modLoaders.add(projectName.toLowerCase()) |
| 133 | + } |
| 134 | + } |
| 135 | + |
| 136 | + def fabricOptions = createOptions("fabric") |
| 137 | + def neoForgeOptions = createOptions("neoforge") |
| 138 | +// def forgeOptions = createOptions("forge") |
| 139 | + |
| 140 | + def curseForgeOptions = curseforgeOptions { |
| 141 | + accessToken = providers.environmentVariable("CURSEFORGE_KEY") |
| 142 | + projectId = curseforge_id |
| 143 | + minecraftVersions.add("${minecraft_version}") |
| 144 | + requires('architectury-api') |
| 145 | + optional('jei') |
| 146 | + optional('roughly-enough-items') |
| 147 | + } |
| 148 | + |
| 149 | + curseforge("curseforgeFabric") { |
| 150 | + from(curseForgeOptions, fabricOptions) |
| 151 | + requires('fabric-api') |
| 152 | + requires('ftb-library-fabric') |
| 153 | + optional('ftb-quests-fabric') |
| 154 | + optional('ftb-ranks-fabric') |
| 155 | + optional('waystones-fabric') |
| 156 | + } |
| 157 | + |
| 158 | + curseforge("curseforgeNeoForge") { |
| 159 | + from(curseForgeOptions, neoForgeOptions) |
| 160 | + requires('ftb-library-neoforge') |
| 161 | + optional('ftb-quests-neoforge') |
| 162 | + optional('ftb-ranks-neoforge') |
| 163 | + optional('waystones') |
| 164 | + optional('kubejs') |
| 165 | + } |
| 166 | + |
| 167 | +// curseforge("curseforgeForge") { |
| 168 | +// from(curseForgeOptions, forgeOptions) |
| 169 | +// requires('ftb-library-forge') |
| 170 | +// optional('ftb-quests-forge') |
| 171 | +// optional('ftb-ranks-forge') |
| 172 | +// optional('waystones') |
| 173 | +// } |
| 174 | +} |
0 commit comments