-
Notifications
You must be signed in to change notification settings - Fork 0
Development: Local workstation setup
This document describes how to set up your local workstation: become a collaborator, set up your environment, check out the code and configure git, run/debug and edit the app. For information about submitting code, see Development: Branches, environments, and check ins
If you do not have one already, sign up for an account on Github
Optionally, you can create a Google account to be added to the Google group.
Ask to be added as a collaborator on Github, and optionally ask to be added to the Google group.
Install Java, making sure to get the version specified in the system.properties file. This ensures that your version of Java matches other developers' versions, and what will be used when the app is run on Heroku
Install the Play! framework, making sure to get the version specified in the dependencies.yml file. This ensures that your version of Java matches other developers' versions, and what will be used when the app is run on Heroku
If you're not familiar with Play, you can read the documentation here
Install the Heroku toolbelt, which has the Heroku command line client (CLI), Foreman, and Git. You can always use Google to learn more about these tools
If you want, install your favorite IDE. Which is probably Eclipse
Installing a Git plugin for your IDE will ensure that moving Java classes between packages will count as a file rename, rather than a delete and create.
To install the EGit plugin for Eclipse, see here
Add --no-ff
as default option to merges into master. Window > Preferences > Team > Git > Configuration. Add a new key="merge.ff
" value="false
"
Find a directory where you would like the project to reside. Clone into the repository in that location. This will create a subdirectory under your current directory.
From the terminal, change directory into a valid git repository, and run the following commands to set up Git to know your identity:
git config --global user.name "johndoe305"
(use your Github username here)
git config --global user.email johndoe@example.com
From a terminal, change directories to the development repo that you cloned. Follow the instructions here to have Play generate the .project file that Eclipse requires, and import the project into Eclipse.
Important: make sure not to copy the project into your Eclipse workspace, so that edits to the source files will happen in the git repo itself.
You can read about the directory structure of a Play application here
Launch the app by running the class MainApp
as a Java Application. To run tests, run the main class MainTest
Once the launch is running, the console will have a line as follows:
Listening for transport dt_socket at address: 9999
Note the port listed there. It should match the JPDA_PORT environment variable.
- In Eclipse, create a new Debug Configuration (Right click on the project, "Debug As", "Debug Configurations...")
- Select "Remote Java Application"
- Enter "localhost" for the host, and "9999" (or whatever port you saw in step 3) as the port
- Make sure to check "Allow termination of JVM" to allow Eclipse to terminate that JVM. Otherwise, there is no way to stop the app except killing the process from the OS
- Click Debug
This configuration will be saved for later, and will work as long as the JPDA port does not change. Eclipse has now been attached to the running process, and you can set breakpoints whatttuuppp!
Important: To stop the app, stopping the run started by a main class will not work. You must stop the run created by the remote debugging to stop the app (as long as you completed step 4 above)