Skip to content

Getting and Running in Dev Mode (and Building)

Stephanie Schneider edited this page Jul 24, 2015 · 1 revision

Setting up your Environment

Install and Configure Needed Tools:

note: references to environment variables are in bash format. If using Windows, reference them with enclosing %s instead of a prefixed $ (e.g. %JAVA_HOME%/bin)

Oracle JDK 7:

Download and uncompress/install the latest version Set JAVA_HOME and add $JAVA_HOME/bin to your PATH variable

Apache Ant:

Download and uncompress version 1.8.4 (later versions may also work) Set ANT_HOME and add $ANT_HOME/bin to your PATH variable

Grails:

Method 1: Download and uncompress version 2.3.7 Set GRAILS_HOME and add $GRAILS_HOME/bin to your PATH variable

Method 2: (Linux/MacOS only): use gvm to install it

You will need more than the default heap space for running the Marketplace unit and integration tests. This can be done easily by setting an environment variable. On Linux/Mac: GRAILS_OPTS="-Xmx1536m -Xms512m -XX:PermSize=128m -XX:MaxPermSize=256m" On Windows: JAVA_OPTS="-Xmx1536m -Xms512m -XX:PermSize=128m -XX:MaxPermSize=256m"

Groovy: (you only need to do this if you are bundling owf locally)

Method 1: Download and uncompress version 1.8.8 Set GROOVY_HOME and add $GROOVY_HOME/bin to your PATH variable Method 2 (Linux/MacOS only): use gvm to install it

Ruby:

If using Windows, download and run the 1.9.2 installer. Set RUBY_HOME and add $RUBY_HOME/bin to your path If using Linux, download and compile the source see "Ruby, RVM, and Bundler"

Sass:

Run the following from a command prompt (make sure you've configured RUBY_HOME/PATH):

gem install sass --version 3.1.3

Compass:

Run the following from a command prompt (make sure you've configured RUBY_HOME/PATH, and installed compass):

gem install compass --version 0.11.7

Basic Command Line Invocations:

Before running Marketplace app or integration tests:

  1. You must create your database.
  2. Switch your working directory to the Marketplace root and run the following command: grails dbm-drop-create
  3. The integrations tests use a separate database. For those, specify the test environment: grails -Dgrails.env=test dbm-drop-create

Starting OWF or Marketplace alone:

Switch your working directory to the project root and run the following command: grails -Duser=testAdmin1 run-app -https

Running Marketplace and OWF at the same time:

To start the second project on different ports, open a new shell, switch your working directory to the project root and run the following command: grails -Duser=testAdmin1 -Dgrails.server.port.http=9080 -Dgrails.server.port.https=9443 run-app -https

Running OWF or Marketplace unit and integration tests:

Switch your working directory to the project root and run the following command: grails test-app -nocoverage

Running a single OWF or Marketplace unit test class:

Switch your working directory to the project root and run the following command, replacing marketplace.DescriptorControllerTests with your own packageName.TestClassName (you can also replace unit with integration to run an integration test): grails test-app -nocoverage unit: marketplace.DescriptorControllerTests

Build the Marketplace or OWF bundle:

Switch your working directory to the project root and run the following commands. When you are finished, the bundle(s) will be located in the project directory under staging/.

ant setup-ant
ant compileAccess     ###(OWF only)
ant bundle
Clone this wiki locally