mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-02-27 03:32:22 +01:00
Add auto updater for standalone builds
This commit is contained in:
parent
18d2cd4534
commit
b5cedf3033
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>Minepacks</artifactId>
|
||||
<version>2.0.8-RC1</version>
|
||||
<version>2.0.8-RC2</version>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||
|
@ -57,12 +57,10 @@
|
||||
public class Minepacks extends JavaPlugin implements MinepacksPlugin
|
||||
{
|
||||
private static final int BUKKIT_PROJECT_ID = 83445;
|
||||
private static final String JENKINS_URL = "https://ci.pcgamingfreaks.at", JENKINS_JOB = "Minepacks V2", MIN_PCGF_PLUGIN_LIB_VERSION = "1.0.14-SNAPSHOT";
|
||||
@SuppressWarnings("unused")
|
||||
private static final String JENKINS_URL = "https://ci.pcgamingfreaks.at", JENKINS_JOB_DEV = "Minepacks V2", JENKINS_JOB_MASTER = "Minepacks", MIN_PCGF_PLUGIN_LIB_VERSION = "1.0.14-SNAPSHOT";
|
||||
private static Minepacks instance = null;
|
||||
|
||||
@SuppressWarnings("FieldCanBeLocal") // Field is set per reflection from the BadRabbit loader
|
||||
private boolean useBukkitUpdater = false;
|
||||
|
||||
private Config config;
|
||||
private Language lang;
|
||||
private Database database;
|
||||
@ -157,14 +155,13 @@ public void onDisable()
|
||||
public @Nullable Updater update(@Nullable at.pcgamingfreaks.Updater.Updater.UpdaterResponse output)
|
||||
{
|
||||
UpdateProvider updateProvider;
|
||||
if(useBukkitUpdater) updateProvider = new BukkitUpdateProvider(BUKKIT_PROJECT_ID, getLogger());
|
||||
if(getDescription().getVersion().contains("Release")) updateProvider = new BukkitUpdateProvider(BUKKIT_PROJECT_ID, getLogger());
|
||||
else
|
||||
{
|
||||
/*if[STANDALONE]
|
||||
getLogger().warning("Auto-updates not available for your build config!");
|
||||
return null;
|
||||
updateProvider = new JenkinsUpdateProvider(JENKINS_URL, JENKINS_JOB_MASTER, getLogger(), ".*-Standalone.*");
|
||||
else[STANDALONE]*/
|
||||
updateProvider = new JenkinsUpdateProvider(JENKINS_URL, JENKINS_JOB, getLogger());
|
||||
updateProvider = new JenkinsUpdateProvider(JENKINS_URL, JENKINS_JOB_DEV, getLogger());
|
||||
/*end[STANDALONE]*/
|
||||
}
|
||||
Updater updater = new Updater(this, this.getFile(), true, updateProvider);
|
||||
|
@ -26,6 +26,7 @@
|
||||
/**
|
||||
* Uses BadRabbit to initiate the plugin in normal or standalone mode depending on the users environment.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class MinepacksBadRabbit extends BadRabbit
|
||||
{
|
||||
@Override
|
||||
@ -37,13 +38,11 @@ public class MinepacksBadRabbit extends BadRabbit
|
||||
getLogger().info("PCGF-PluginLib not installed. Switching to standalone mode!");
|
||||
Class<?> standaloneClass = Class.forName("at.pcgamingfreaks.MinepacksStandalone.Bukkit.Minepacks");
|
||||
newPluginInstance = (JavaPlugin) standaloneClass.newInstance();
|
||||
getField(standaloneClass, "useBukkitUpdater").set(newPluginInstance, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
getLogger().info("PCGF-PluginLib installed. Switching to normal mode!");
|
||||
newPluginInstance = new Minepacks();
|
||||
getField(Minepacks.class, "useBukkitUpdater").set(newPluginInstance, true);
|
||||
}
|
||||
return newPluginInstance;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user