1

I've recently started on a new google app engine project that uses RestEasy for MVC and Gradle for our build process. Now I'm at a point where I want to include SASS, javascript, and closure template files but I'm unsure about how I should do this. Ideally I'd like to satisfy the following requirements:

  1. The files should live in their own source directory. eg src/main/javascript, src/main/sass.
  2. When deploying, the javascript files should be minified.
  3. When developing, the closure templates and sass files should be watched for changes and hot-swapped into the running environment.
  4. The closure templates should be accessible by the client and server. (That way rendering can happen on either end)

What do you think is the best way to accomplish all of this? Thanks for your time.

1 Answer 1

2
  1. I'm placing it into src/main/webapp/js and src/main/webapp/sass (compiled to src/main/webapp/css It's pretty standard and goes well with all maven plugin

  2. There is yuicompressor-maven-plugin, it can compress js and css

  3. If you're using Compass for SASS, then it can watch and recompile out of box (-watch option). BTW, it's complicated to make hot-swapping. Instead of it I'm using local nginx in front of my gae app, it proxying all non-static request to original jetty (used by gae plugin), but serves all static files (like js, images, css) directly from src/main/webapp. It's pretty easy to configure nginx for that scenario

  4. It's the problem, and can't find any good solution for that :( So i'm trying to render this part only at client side (by using jquery-tmpl), passing all data as javascript/json, directly inside my jsp's

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the response! I've cobbled together a quick group of Gradle tasks to do the sass conversion (using jruby). This allows me to hotswap the css files when I'm running the application via the GAE plugin in eclipse. Now all that's left is to figure out the best way to hot-swap the js.
oops, i'd missed that point about closure templates. Unfortunately I had never used it, so i can't suggest anything there :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.