Environment setup for developers
Clone the repository to your computer. You can either:
- use git to clone the repository, or
- download the source for a release from https://github.com/HearthStats/HearthStats.net-Uploader/releases
It takes several minutes since all jar dependencies were stored in the repository.
Now the build is managed with maven so it is pretty standard.
mvn package
Note: You need Scala 2.11 for this project, and Eclipse IDE (in stable versions) does not yet support multiple versions of Scala. Here are three ways to get add Scala to Eclipse
If you don't have Eclipse installed, or don't mind installing another copy, then the easiest option is to download the full Scala IDE for Eclipse bundle. It comes with everything you need:
- Download the IDE for Scala >= 2.11.1 from http://scala-ide.org/download/sdk.html
If you already have Eclipse, you can install the plugins manually. These are not required to add if you download the full IDE above.
- Help > Install New Software...
- Click Add... then add each of these sites:
- Scala plugins : http://download.scala-ide.org/sdk/helium/e38/scala211/stable/site
- m2e for scala : http://alchim31.free.fr/m2e-scala/update-site
- Follow the install process to install the plugins
If you're using the Spring Tool Suite version of Eclipse, you can add Scala support from the Extensions list:
- View the Dashboard (Help > Dashboard)
- Click the Extensions tab
- Tick the Scala IDE for Eclipse checkbox
- Click Install
Open Eclipse, select File > Import > Existing Maven Project
To build the uploader, the first time:
- Right-click on the
uploader-parent
project - Click Run As > Maven Build
- In the 'Goals' section of the popup, type
package
- Click 'Run'
Maven should now build the uploader for you. Next time you run the build, Eclipse should remember those settings and run it immediately, without showing the popup again.
If you have any trouble you can always build from the command line without using Eclipse. As long as you have Maven installed, just open a Terminal (OS X) or Command Prompt (Windows), change directory to where the code is located, then run mvn package
to build.
If you've run the build above then you can start the application directly from the target folders:
- OS X: uploader-osx/target/HearthStats.app
- Windows uploader-win/target/HearthStats.exe
However you can also run the application from Eclipse, which is a little quicker and lets you run it in the debugger. The settings are slightly different depending on your operating system:
- Navigate to the file /uploader-win/src/main/scala/net/hearthstats/win/HearthStatsWin.scala in the package explorer
- Right-click and choose Run As > Scala Application
- Navigate to the file /uploader-osx/src/main/scala/net/hearthstats/osx/HearthStatsOsx.scala in the package explorer
- Right-click and choose Run As > Scala Application
- You will probably get an error this first time, because we haven't set the necessary JVM parameters!
- Right-click again and choose Run As > Run Configurations
- Check that your Main class is set to
net.hearthstats.osx.HearthStatsOsx
: - Now add the following to the VM Arguments section, replacing ####### with your actual path:
- "-Djna.library.path=/Users/#######/uploader-osx/target/HearthStats.app/Contents/MacOS"
- "-Djava.library.path=/Users/#######/uploader-osx/target/HearthStats.app/Contents/MacOS"
- "-DLOG_FILE=Library/Application Support/HearthStatsUploader/log.txt"
- "-Xdock:icon=/Users/#######/uploader-osx/target/HearthStats.app/Contents/Resources/icon.icns"
- -Xms96m
- -Xmx192m
- Now click Run