mirror of
https://github.com/runelite/plugin-hub.git
synced 2025-12-23 22:48:49 -05:00
package: ensure plugin classes exist in the jar
This commit is contained in:
@@ -26,6 +26,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.google.common.hash.Hashing
|
||||
import com.google.common.io.Files
|
||||
import com.google.gson.Gson
|
||||
import java.util.jar.JarFile
|
||||
|
||||
initscript {
|
||||
repositories {
|
||||
@@ -73,7 +74,15 @@ allprojects {
|
||||
new FileInputStream(file("runelite-plugin.properties")).withCloseable { is ->
|
||||
props.load(is)
|
||||
}
|
||||
|
||||
manifest.plugins = props["plugins"].split(/[,:;]/)*.trim()
|
||||
new JarFile(pluginJar).withCloseable{ jf ->
|
||||
manifest.plugins.each { plugin ->
|
||||
if (jf.getEntry(plugin.replaceAll(~/\./, "/") + ".class") == null) {
|
||||
throw new RuntimeException("Plugin class \"" + plugin + "\" is not in the output jar")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
manifest.displayName = props["displayName"]
|
||||
if (!manifest.displayName) {
|
||||
|
||||
Reference in New Issue
Block a user