From 343b3e8e85a0839ec8a0363bfcac4e59a1998e9a Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 26 Oct 2020 12:30:39 -0600 Subject: [PATCH] package: require license files --- .../net/runelite/pluginhub/packager/Plugin.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/package/src/main/java/net/runelite/pluginhub/packager/Plugin.java b/package/package/src/main/java/net/runelite/pluginhub/packager/Plugin.java index 3e4b6b545..ae7154516 100644 --- a/package/package/src/main/java/net/runelite/pluginhub/packager/Plugin.java +++ b/package/package/src/main/java/net/runelite/pluginhub/packager/Plugin.java @@ -585,6 +585,20 @@ public class Plugin implements Closeable } waitAndCheck(gitlog, "git log ", 30, TimeUnit.SECONDS); } + + if (!new File(repositoryDirectory, "LICENSE").exists()) + { + if (manifest.getLastUpdatedAt() < 1604534400) + { + writeLog("Missing LICENSE file. This will become fatal in the future\n"); + } + else + { + throw PluginBuildException.of(this, "Missing LICENSE file") + .withHelp("All plugins must be licensed under a license that allows us to freely distribute the plugin jar standalone.\n" + + "We recommend the BSD 2 Clause license."); + } + } } public void upload(UploadConfiguration uploadConfig) throws IOException