The complete Closure in a single .jar

68 views
Skip to first unread message

David Turnbull

unread,
Feb 21, 2011, 5:24:48 PM2/21/11
to Closure Library Discuss
Getting started with Closure is a lot of work. You'll end up
downloading several files, checking out repositories, making shell
scripts or config files, and reading about annotations before you get
to the good stuff. While there's no shortcut for the reading, there
is a way to simplify the downloads and tools.

I was able to package a .jar complete with Compiler, Library, Script,
and Templates. There's also a welcome process and built-in
documentation. If everything goes well, someone new to Closure can go
from downloaded to developing in under 60 seconds.

Step 1: Download the jar to an empty folder:
https://github.com/dturnbull/closure-script/downloads

Step 2: Run with Java:
`java -jar closure.jar`

Step 3: Open a web browser:
http://localhost:8080/

The .jar packaging is a very new feature and we've had one non-
reproducible report of it failing in a directory with special
characters. Let me know if you find any problems or have suggestions
for making it easier to use Closure. The project is Apache licensed
and patches are welcome.

-david

Garry Boyer

unread,
Feb 21, 2011, 5:33:02 PM2/21/11
to closure-lib...@googlegroups.com, David Turnbull
Awesome!

alf

unread,
Feb 21, 2011, 5:58:11 PM2/21/11
to Closure Library Discuss
Hi appear a error.
win 7
64bit

***********
Errno::EACCES at /
Permission denied - config.ru

Ruby C:/Users/albertog/AppData/Local/Temp/
winstone6100119275902131648webroot/closure-1.3.701.pre3.jar/WEB-INF/
scripts/welcome/index.erb: in initialize, line 14
Web POST localhost/

*************

David Turnbull

unread,
Feb 21, 2011, 7:20:41 PM2/21/11
to Closure Library Discuss
Thanks, Garry.

Alberto, the jar ran successfully on my Win7 64 bit system. I was
able to reproduce this exact message by running the jar from the root
"C:\" and pressing the button to write the scaffold files.

The welcome page will display the folder it's working in. If that's
always coming up root then something is broken. I'm using the
following to get the directory you start the jar in. Perhaps it
doesn't work reliably and someone knows a better way.
java.lang.System.getProperty('user.dir')

I added a ticket. No write access is a common exception we should
catch and explain regardless the cause.
https://github.com/dturnbull/closure-script/issues/8

-david

David Turnbull

unread,
Mar 7, 2011, 1:00:06 PM3/7/11
to Closure Library Discuss
Seeing Closure Script packaged as a single .jar motivated me to spend
the last two weeks on it. The entire welcome process has been
smoothed over and the example scaffold expanded to four starting
points: Hello World (soy), modules, jQuery, and Rails 3.

Working with modules has been greatly simplified. I added a feature
so that you don't have to count the number of files in every module.
The modules example from the plovr tests is used for the scaffold.

Closure Library is no longer bundled with Closure Script. Library
being updated daily now, it seems. An example of a complex Script
that can update a subversion repository in a background thread is part
of the scaffold. It is automatically started as part of the welcome
process. I'd like to make one for git and hg too but not before I get
some feedback. Or maybe someone will beat me to it.

The Subversion updater got me thinking about how folks share Closure
code (non-Google folks, specifically). Others languages and
frameworks have some kind of multi-user repository: CPAN, RubyGems,
PEAR, etc. Not everyone is comfortable signing a CLA and releasing
under Apache 2.0 so I think Closure will need something other than the
Library repository in the long run.

Closure Script not only provides a platform for developing a feature-
rich repository client directly in the build tool, but it helps get
the compiler options out of a central config or platform-specific
shell programs and into context for easier sharing. It also provides
a common platform for advanced build steps, like CSS and SVG
transforms, that will work even under Windows.

Closure Script 1.3 is now at RC1. Please help test.

Step 1: Download to a new folder:
https://github.com/dturnbull/closure-script/downloads

Step 2: Run from the new folder with Java:
`java -jar closure.jar`

Step 3: Open a web browser:
http://localhost:8080/

-david

miel...@gmail.com

unread,
Mar 16, 2011, 6:32:22 PM3/16/11
to closure-lib...@googlegroups.com
How does it compare to plovr (www.plovr.org)?

Thanks,
Łukasz
Reply all
Reply to author
Forward
0 new messages