Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Environment setup for developers

tyrcho edited this page Oct 22, 2014 · 15 revisions

Setup

Clone the repository to your computer. You can either:

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.

Build (command line)

mvn package

Eclipse IDE Setup

Scala setup

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

Full IDE download (recommended)

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:

Update sites

If you already have Eclipse, you can install the plugins manually. These are not required to add if you download the full IDE above.

Scala support in Spring Tool Suite

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

Import project

Open Eclipse, select File > Import > Existing Maven Project

Build the uploader

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.

Run the uploader

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:

Running in Eclipse on Windows

  • 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

Running in Eclipse on Mac OS X

  • 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: Screenshot of run configuration for OS X
  • 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 Screenshot of VM Arguments for OS X
  • Now click Run