aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject aurora git commit: Modify the gradle build to optionally prefix CLASSPATH with a custom value when running installDist.
Date Wed, 05 Aug 2015 18:56:12 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 2130f7e9a -> ae6e8575b

Modify the gradle build to optionally prefix CLASSPATH with a custom value when running installDist.

This enables much greater iteration speed when working on the Aurora UI.

Bugs closed: AURORA-1425

Reviewed at


Branch: refs/heads/master
Commit: ae6e8575be0b51eff1c80562311d7de6ed96b248
Parents: 2130f7e
Author: Joshua Cohen <>
Authored: Wed Aug 5 13:55:52 2015 -0500
Committer: Joshua Cohen <>
Committed: Wed Aug 5 13:55:52 2015 -0500

 build.gradle                        | 12 ++++++++++++
 docs/ | 19 +++++++++++++++++++
 examples/vagrant/     |  4 +++-
 3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index fa2e268..afb9b80 100644
--- a/build.gradle
+++ b/build.gradle
@@ -496,3 +496,15 @@ run {
   main = ''
   classpath += sourceSets.test.output
+startScripts {
+  def environmentClasspathPrefix = System.env.CLASSPATH_PREFIX
+  if (!environmentClasspathPrefix?.trim()) {
+    return
+  }
+  doLast {
+    unixScript.text = unixScript.text.replace('CLASSPATH=', "CLASSPATH=${environmentClasspathPrefix}:")
+  }
diff --git a/docs/ b/docs/
index 17cfc18..f52c76e 100644
--- a/docs/
+++ b/docs/
@@ -90,6 +90,25 @@ use the following commands to view and modify the bower repo at
     bower update <library name>
     bower help
+Faster Iteration in Vagrant
+The scheduler serves UI assets from the classpath. For production deployments this means
the assets
+are served from within a jar. However, for faster development iteration, the vagrant image
+configured to add `/vagrant/dist/resources/main` to the head of CLASSPATH. This path is configured
+as a shared filesystem to the path on the host system where your Aurora repository lives.
This means
+that any updates to dist/resources/main in your checkout will be reflected immediately in
the UI
+served from within the vagrant image.
+The one caveat to this is that this path is under `dist` not `src`. This is because the assets
+be processed by gradle before they can be served. So, unfortunately, you cannot just save
your local
+changes and see them reflected in the UI, you must first run `./gradlew processResources`.
This is
+less than ideal, but better than having to restart the scheduler after every change. Additionally,
+gradle makes this process somewhat easier with the use of the `--continuous` flag. If you
+`./gradlew processResources --continuous` gradle will monitor the filesystem for changes
and run the
+task automatically as necessary. This doesn't quite provide hot-reload capabilities, but
it does
+allow for <5s from save to changes being visibile in the UI with no further action required
on the
+part of the developer.
 Developing the Aurora Build System
diff --git a/examples/vagrant/ b/examples/vagrant/
index 8850e93..92066e8 100755
--- a/examples/vagrant/
+++ b/examples/vagrant/
@@ -43,7 +43,9 @@ function build_admin_client {
 function build_scheduler {
-  ./gradlew installDist
+  # This CLASSPATH_PREFIX is inserted at the front of the CLASSPATH to enable "hot" reloads
of the
+  # UI code (c.f. the startScripts task in build.gradle).
+  CLASSPATH_PREFIX=/vagrant/dist/resources/main ./gradlew installDist
   export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
   sudo mkdir -p /var/db/aurora

View raw message