-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mojmap artifact variants of API.
- Loading branch information
1 parent
36f81c9
commit 2bd2cd6
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import lambdynamiclights.Constants | ||
import net.fabricmc.loom.LoomGradleExtension | ||
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace | ||
import net.fabricmc.loom.task.RemapJarTask | ||
import net.fabricmc.loom.task.RemapSourcesJarTask | ||
|
||
plugins { | ||
id("lambdynamiclights-common") | ||
} | ||
|
||
base.archivesName.set(Constants.NAME + "-api-mojmap") | ||
|
||
dependencies { | ||
mappings(loom.officialMojangMappings()) | ||
} | ||
|
||
val apiProject = project(":api") | ||
|
||
tasks.remapJar { | ||
val remapJar = apiProject.tasks.named("remapJar", RemapJarTask::class) | ||
dependsOn(remapJar) | ||
|
||
classpath.setFrom((loom as LoomGradleExtension).getMinecraftJarsCollection(MappingsNamespace.INTERMEDIARY)) | ||
inputFile.convention(remapJar.flatMap { it.archiveFile }) | ||
sourceNamespace = "intermediary" | ||
targetNamespace = "named" | ||
} | ||
|
||
// Add the remapped JAR artifact | ||
apiProject.configurations["mojmapApiElements"].artifacts.removeIf{ | ||
true | ||
} | ||
apiProject.artifacts.add("mojmapApiElements", tasks.remapJar.map { it.archiveFile }) { | ||
classifier = "mojmap" | ||
} | ||
apiProject.configurations["mojmapRuntimeElements"].artifacts.removeIf{ | ||
true | ||
} | ||
apiProject.artifacts.add("mojmapRuntimeElements", tasks.remapJar.map { it.archiveFile }) { | ||
classifier = "mojmap" | ||
} | ||
|
||
val remapMojmapSourcesTask = tasks.register("remapMojmapSourcesJar", RemapSourcesJarTask::class) { | ||
val remapJar = apiProject.tasks.named("remapSourcesJar", RemapSourcesJarTask::class) | ||
dependsOn(remapJar) | ||
|
||
classpath.setFrom((loom as LoomGradleExtension).getMinecraftJarsCollection(MappingsNamespace.INTERMEDIARY)) | ||
inputFile.convention(remapJar.flatMap { it.archiveFile }) | ||
archiveClassifier = "moj" | ||
sourceNamespace = "intermediary" | ||
targetNamespace = "named" | ||
} | ||
|
||
// Add the remapped sources artifact | ||
apiProject.configurations["mojmapSourcesElements"].artifacts.removeIf { | ||
true | ||
} | ||
apiProject.artifacts.add("mojmapSourcesElements", remapMojmapSourcesTask.map { it.archiveFile }) { | ||
classifier = "mojmap-sources" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ pluginManagement { | |
} | ||
|
||
includeBuild("build_logic") | ||
include("api") | ||
include("api", "api:moj_xplat") |