Skip to content

Commit e2f128d

Browse files
committed
build: publish all LuckPerms platform/loader modules to OLF repo
Adds a shared publishing convention so every remaining platform and loader module (bukkit/bungee/velocity/fabric/forge/neoforge/sponge/ nukkit/standalone/hytale + loaders, common:minecraft) is deployed to the OneLiteFeather repository as net.luckperms:<dashed-path>, publishing the shadowJar for loader modules and the java component otherwise. The six modules with bespoke publications (api, common, loader-utils, minestom, minestom-app, minestom-loader) are excluded and unchanged. https://claude.ai/code/session_01S76fk9ma5Szkf9r1W44RVP
1 parent 46fd233 commit e2f128d

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,64 @@ subprojects {
6969
maven { url 'https://libraries.minecraft.net/' }
7070
}
7171
}
72+
73+
// Publish every remaining LuckPerms platform/loader module to the
74+
// OneLiteFeather repository as net.luckperms:<dashed-path>. The six modules
75+
// that already define their own publication (api, common, loader-utils,
76+
// minestom, minestom-app, minestom-loader) are intentionally excluded.
77+
def olfExtraPublishPaths = [
78+
':bukkit', ':bukkit:loader', ':bukkit-legacy', ':bukkit-legacy:loader',
79+
':bungee', ':bungee:loader', ':velocity',
80+
':fabric', ':forge', ':forge:loader', ':neoforge', ':neoforge:loader',
81+
':sponge', ':sponge:loader', ':sponge:sponge-service', ':sponge:sponge-service-proxy',
82+
':nukkit', ':nukkit:loader',
83+
':standalone', ':standalone:app', ':standalone:loader',
84+
':hytale', ':hytale:loader', ':hytale:loader-with-deps',
85+
':common:minecraft'
86+
] as Set
87+
88+
subprojects {
89+
afterEvaluate { proj ->
90+
if (!olfExtraPublishPaths.contains(proj.path)) {
91+
return
92+
}
93+
94+
def shadowTask = proj.tasks.findByName('shadowJar')
95+
def hasJavaComponent = proj.components.findByName('java') != null
96+
if (shadowTask == null && !hasJavaComponent) {
97+
return
98+
}
99+
100+
proj.publishing {
101+
publications {
102+
if (findByName('mavenJava') == null && findByName('maven') == null && findByName('olf') == null) {
103+
olf(MavenPublication) {
104+
groupId = 'net.luckperms'
105+
artifactId = proj.path.substring(1).replace(':', '-')
106+
version = proj.version
107+
if (shadowTask != null) {
108+
artifact(shadowTask)
109+
} else {
110+
from proj.components.java
111+
}
112+
}
113+
}
114+
}
115+
repositories {
116+
maven {
117+
name = 'OneLiteFeatherRepository'
118+
def snapshotsRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-snapshots')
119+
def releasesRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-releases')
120+
url = proj.version.toString().contains('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
121+
credentials(PasswordCredentials) {
122+
username = System.getenv('ONELITEFEATHER_MAVEN_USERNAME')
123+
password = System.getenv('ONELITEFEATHER_MAVEN_PASSWORD')
124+
}
125+
authentication {
126+
basic(BasicAuthentication)
127+
}
128+
}
129+
}
130+
}
131+
}
132+
}

0 commit comments

Comments
 (0)