@@ -13,6 +13,7 @@ buildscript {
13
13
14
14
plugins {
15
15
id ' org.jetbrains.kotlin.jvm' version " $kotlinVersion "
16
+ id ' maven-publish'
16
17
}
17
18
18
19
apply plugin : ' net.minecraftforge.gradle'
@@ -61,8 +62,9 @@ minecraft {
61
62
62
63
configurations {
63
64
jarLibs
65
+ onlyJarLibs
64
66
// Force choosing the correct nightly build because Mac OS chooses an invalid one
65
- all {
67
+ configureEach {
66
68
resolutionStrategy {
67
69
force ' org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209'
68
70
}
@@ -112,7 +114,7 @@ dependencies {
112
114
implementation(' cabaletta:baritone-deobf-unoptimized-mcp-dev:1.2' ). setChanging(true )
113
115
114
116
// This Baritone WILL be included in the jar
115
- jarLibs (' cabaletta:baritone-api:1.2' ). setChanging(true )
117
+ onlyJarLibs (' cabaletta:baritone-api:1.2' ). setChanging(true )
116
118
117
119
// Add everything in jarLibs to implementation (compile)
118
120
implementation configurations. jarLibs
@@ -137,23 +139,23 @@ processResources {
137
139
}
138
140
}
139
141
140
- task buildApiSource ( type : Jar ) { // Generate sources
142
+ tasks . register( ' buildApiSource ' , Jar ) { // Generate sources
141
143
group ' build'
142
144
description ' Assemble API library source archive'
143
145
144
146
archiveClassifier. set ' api-source'
145
147
from sourceSets. main. allSource
146
148
}
147
149
148
- task buildApi ( type : Jar ) {
150
+ tasks . register( ' buildApi ' , Jar ) {
149
151
group ' build'
150
152
description ' Assemble API library archive'
151
153
152
154
archiveClassifier. set ' api'
153
155
from sourceSets. main. output
154
156
}
155
157
156
- task buildAll {
158
+ tasks . register( ' buildAll' ) {
157
159
group ' build'
158
160
description ' Assemble all jars'
159
161
@@ -184,7 +186,7 @@ shadowJar {
184
186
' kotlin/**/*.kotlin_metadata' ,
185
187
' kotlin/**/*.kotlin_builtins' ,
186
188
' META-INF/*.version'
187
- configurations = [project. configurations. jarLibs]
189
+ configurations = [project. configurations. jarLibs, project . configurations . onlyJarLibs ]
188
190
relocate ' kotlin' , ' com.lambda.shadow.kotlin'
189
191
relocate ' kotlinx' , ' com.lambda.shadow.kotlinx'
190
192
finalizedBy ' configureReobfTaskForReobfShadowJar' , ' reobfShadowJar'
@@ -198,7 +200,11 @@ reobf {
198
200
}
199
201
}
200
202
201
- artifacts {
202
- shadowJar
203
- }
204
-
203
+ publishing {
204
+ publications {
205
+ api(MavenPublication ) {
206
+ artifact source : buildApi, classifier : null
207
+ artifact source : buildApiSource, classifier : ' sources'
208
+ }
209
+ }
210
+ }
0 commit comments