Updated version and added maven support for the build-in client version

This commit is contained in:
JKetelaar
2015-09-14 16:43:13 +02:00
parent 3b22952ec2
commit 6bb0545f0c
42 changed files with 16 additions and 17 deletions
+2 -1
View File
@@ -2,4 +2,5 @@ mvn install:install-file -DgroupId=${project.groupId} -DartifactId=${project.art
:: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.3 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.3.jar -DlocalRepositoryPath=../../Maven-Repository :: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.3 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.3.jar -DlocalRepositoryPath=../../Maven-Repository
:: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.32 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.32.jar -DlocalRepositoryPath=../../Maven-Repository :: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.32 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.32.jar -DlocalRepositoryPath=../../Maven-Repository
:: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.33 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.33.jar -DlocalRepositoryPath=../../Maven-Repository :: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.33 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.33.jar -DlocalRepositoryPath=../../Maven-Repository
:: mvn install:install-file -DgroupId=org.parabot -DartifactId=client -Dversion=2.2.34 -Dpackaging=jar -Dfile=../target/Parabot-V2.2.34.jar -DlocalRepositoryPath=../../Maven-Repository
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>client</artifactId> <artifactId>client</artifactId>
<version>2.2.33</version> <version>2.2.34</version>
<packaging>jar</packaging> <packaging>jar</packaging>
@@ -21,5 +21,5 @@ public class Configuration {
public static final String DATA_API = "http://bdn.parabot.org/api/v2/data/"; public static final String DATA_API = "http://bdn.parabot.org/api/v2/data/";
public static final String ITEM_API = DATA_API + "items/"; public static final String ITEM_API = DATA_API + "items/";
public static final String BOT_VERSION = "2.2.33"; public static final String BOT_VERSION = (String) ProjectProperties.getProjectVersion();
} }
@@ -6,7 +6,6 @@ import java.util.Properties;
/** /**
* @author JKetelaar * @author JKetelaar
* @deprecated
*/ */
public class ProjectProperties { public class ProjectProperties {
@@ -20,13 +19,12 @@ public class ProjectProperties {
private void setProperties(){ private void setProperties(){
InputStream input; InputStream input;
try { try {
String propertiesFileName = "/app.properties"; String propertiesFileName = "storage/app.properties";
Properties properties = new Properties(); input = getClass().getClassLoader()
InputStream inputStream = ProjectProperties.class.getClassLoader()
.getResourceAsStream(propertiesFileName); .getResourceAsStream(propertiesFileName);
cached.load(inputStream); cached.load(input);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
+3 -3
View File
@@ -84,15 +84,15 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
JMenuItem exit = new JMenuItem("Exit"); JMenuItem exit = new JMenuItem("Exit");
run = new JMenuItem("Run"); run = new JMenuItem("Run");
run.setIcon(new ImageIcon(Images.getResource("/images/run.png"))); run.setIcon(new ImageIcon(Images.getResource("/storage/images/run.png")));
pause = new JMenuItem("Pause"); pause = new JMenuItem("Pause");
pause.setEnabled(false); pause.setEnabled(false);
pause.setIcon(new ImageIcon(Images.getResource("/images/pause.png"))); pause.setIcon(new ImageIcon(Images.getResource("/storage/images/pause.png")));
stop = new JMenuItem("Stop"); stop = new JMenuItem("Stop");
stop.setEnabled(false); stop.setEnabled(false);
stop.setIcon(new ImageIcon(Images.getResource("/images/stop.png"))); stop.setIcon(new ImageIcon(Images.getResource("/storage/images/stop.png")));
screenshot.addActionListener(this); screenshot.addActionListener(this);
proxy.addActionListener(this); proxy.addActionListener(this);
@@ -95,7 +95,7 @@ public class LoginUI extends JFrame {
RenderingHints.KEY_INTERPOLATION, RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC); RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g.drawImage(Images g.drawImage(Images
.getResource("/images/para.png"), .getResource("/storage/images/para.png"),
0, 8, 250, 45, null); 0, 8, 250, 45, null);
} }
}; };
@@ -51,7 +51,7 @@ public class VerboseLoader extends JPanel implements ProgressListener {
throw new IllegalStateException("MainScreenComponent already made."); throw new IllegalStateException("MainScreenComponent already made.");
} }
current = this; current = this;
this.background = Images.getResource("/images/background.png"); this.background = Images.getResource("/storage/images/background.png");
this.progressBar = new ProgressBar(400, 20); this.progressBar = new ProgressBar(400, 20);
setLayout(new GridBagLayout()); setLayout(new GridBagLayout());
setSize(775, 510); setSize(775, 510);
@@ -29,7 +29,7 @@ public class SwingUtil {
} }
public static void setParabotIcons(JFrame f) { public static void setParabotIcons(JFrame f) {
f.setIconImage(Images.getResource("/images/icon.png")); f.setIconImage(Images.getResource("/storage/images/icon.png"));
if(OperatingSystem.getOS() == OperatingSystem.MAC) { if(OperatingSystem.getOS() == OperatingSystem.MAC) {
/** Adds the dock icon to mac users */ /** Adds the dock icon to mac users */
@@ -37,7 +37,7 @@ public class SwingUtil {
Class<?> util = Class.forName("com.apple.eawt.Application"); Class<?> util = Class.forName("com.apple.eawt.Application");
Object application = util.getMethod("getApplication", new Class[] { }).invoke(null); Object application = util.getMethod("getApplication", new Class[] { }).invoke(null);
Method setDockIconImage = util.getMethod("setDockIconImage", new Class[] { Image.class }); Method setDockIconImage = util.getMethod("setDockIconImage", new Class[] { Image.class });
setDockIconImage.invoke(application, Images.getResource("/images/icon.png")); setDockIconImage.invoke(application, Images.getResource("/storage/images/icon.png"));
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) { } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) {
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
@@ -33,7 +33,7 @@ public enum Category
*/ */
public static BufferedImage getIcon(String s) { public static BufferedImage getIcon(String s) {
if (images.get(s) == null) { if (images.get(s) == null) {
images.put(s, Images.getResource("/images/category/" + s + ".png")); images.put(s, Images.getResource("/resources/images/category/" + s + ".png"));
} }
return images.get(s); return images.get(s);
} }
@@ -52,7 +52,7 @@ public enum Category
private static HashMap<String, BufferedImage> images = new HashMap<>(); private static HashMap<String, BufferedImage> images = new HashMap<>();
static { static {
images.put("script", Images.getResource("/images/category/script.png")); images.put("script", Images.getResource("/storage/images/category/script.png"));
} }
} }

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 152 B

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 325 B

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 489 B

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 357 B

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 371 B

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 307 B

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 611 B

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 431 B

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 371 B

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 452 B

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 276 B

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 310 B

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 377 B

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 155 B

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 110 B