Commit Graph

177 Commits

Author SHA1 Message Date
Michael Bayne fbfcd9db90 One baby step toward making Narya obtain its depenendies from Maven.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6219 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 16:23:15 +00:00
Michael Bayne 4b443fe148 Last night, I read about the Mustache templating library (a derivative of
Google's CTemplate) and got all hot and bothered, because it seemed like it
would be sufficiently powerful to replace Velocity for our Narya templating
needs.

I then sought out a Java implementation and found one, and quickly discovered
that it lacked the right level of awesome for my needs. So I foolishly decided
to write my own, because Mustache seemed simple enough that I could reimplement
it in a few hours.

A few hours later, I had a neat and tidy reimplementation of Mustache and then
set about to converting Narya to using it. Then the fun began.

I discovered that Mustache wants everything in a hash, but sometimes you just
want to iterate over the elements of a list, and print them into the template
whole-hog. So I extended Mustache with the special "this" variable for printing
the whole context instead of pulling values out of it by name.

Then I remembered that Velocity allows you to do a deep dive into objects,
calling methods and calling methods on the return values of those methods.
Velocity even allows you to pass constants as arguments to those methods (true,
strings, integers). Well, I reimplemented the compound keys, so that you can
call foo.bar.baz, but I didn't go so far as to support constant arguments. That
seemed a step too far into complexity land and to be the sort of thing that
Mustache tries to avoid. So with compound keys, I just had to add a few
alternative versions of methods we were already calling, since we only ever
passed true/false as an argument.

Then I realized that Mustache doesn't do any smart trimming of newlines, so if
you have:

{{#stuff}}
blah blah
{{/stuff}}

You get the annoying newline after the open-tag and after the close-tag. So I
modified my implementation to trim newlines in those circumstances, so that
template authors don't have to do a bunch of template-weirding whitespace
jockeying.

Then I discovered that Mustache doesn't support any notion of scope. So when
you're inside a so-called section, the only variables visible are those bound
by that section. The stuff outside the section is totally invisible. Well,
that's not how Velocity works, you can reference things outside your loop
iterations. It seemed no terribly affront to Mustache to make things work that
way as well, so I did that.

Then I discovered a problem with the fact that Mustache implicitly binds the
loop object to the root of the namespace, so if you have {{name}} outside the
loop and then your loop object also contains a {{name}} field, then you can't
see the outside {{name}} anymore because it's shadowed. Tough titties, in this
case, I just changed our code to not shadow the name.

Then I encountered a bunch of uses of $vidx to put a space before all but the
first element of a list. So I added two more special variables -first and -last
which allow you to do just that sort of thing (and more) in a more template
friendly way because you don't need a Turing complete language just to decide
whether or not you need to mind the gap.

Then I encoutered some uses of $vidx directly, where we were using it to assign
constants in invocation service related classes. So I added another special
variable -index which resolves to basically the same thing that $vidx resolves
to (a 1-based counter indicating which element you're on in your list
iteration). I rationalized to myself that if you wanted to automatically number
laundry lists in your templates, having -index would be nice.

Finally, I have Narya's templating stuff producing character-for-character
replicas of what it used to do with Velocity. Well, actually there's one
newline in a place where there didn't used to be one, but I think that newline
makes sense and it was maybe some sort of Velocity bug that caused it not to
exist.

I've tested the gendobj, genservice and genreceiver tasks. I have no tested
whatever uses streamable_as.tmpl, but I'm pretty confident that it will work
exactly as before because I modified hundreds of lines of other templates in
exactly the same ways and they all work just fine.

So the world gets yet another templating library:

http://code.google.com/p/jmustache/


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6218 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 06:42:47 +00:00
Michael Bayne 9bb2916dc1 Oh boy, the new Velocity needs commons-lang. Whee!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6204 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 16:30:48 +00:00
Michael Bayne 6acb1c483a More version removal.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6203 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 16:12:02 +00:00
Michael Bayne 706844db08 We need tools.properties in narya-tools.jar as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6191 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-14 01:01:49 +00:00
Michael Bayne 6f1188faff Build a narya-tools.jar with just the tools stuff, for projects that already
have Narya and her myriad dependencies in tow, and need to put narya-tools into
their classpath.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6190 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-14 00:41:16 +00:00
Michael Bayne 0007febea3 Oh for fuck's sake. Don't rename Velocity because they do a bunch of pointless
reflection internally to look default implementations by class name. Sigh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6188 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-13 00:30:19 +00:00
Michael Bayne f0a9dc8dd7 We must be vigilant about overriding Ant's retarded defaults. In the latest
version of Ant, it issues a warning if you fail to do so. Genius!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6186 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-12 17:44:18 +00:00
Michael Bayne f4af1915b0 Build narya-tools with jarjar so as to hide its included dependencies in the
unfortunate event that someone puts it on a real project classpath.

Modified GenTask to totally hide Velocity from derived classes so that external
libraries can make use of it in their own Ant tasks without inheriting a
Velocity dependency and also becoming booched because Velocity was renamed in
jarjar and won't link against an unrenamed Velocity.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6185 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-12 17:35:41 +00:00
Par Winzell d4ee1a9d4e We don't have GWT until we have gwt-utils, too, I guess.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6181 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 19:59:57 +00:00
Par Winzell f7bd94543f Delete brief experiment.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6180 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 19:29:48 +00:00
Par Winzell e0e47a1a1a Build some GWT bits, if GWT is present.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6179 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 19:22:20 +00:00
Charlie Groves a0d4296b4e Split tcp socket opening and datagram listening out of ConnectionManager to allow sockets to remain
open when a ConnectionManager using them shuts down.

BindingConnectionManager takes on the duties of opening sockets that ConnectionManager used to
handle, and it's injected automatically by PresentsServer.  Hopefully that means this won't change
anything for existing users of PresentsServer.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6157 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-09-16 02:49:29 +00:00
Dave Hoover 1f292a5184 Fix syntax
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6074 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-06-11 22:57:19 +00:00
Michael Bayne c77ff81160 Should be no harm in compiling against Guava instead of GC as they have the
exact same API. So if you ship with GC instead of Guava, nothing will break.

Eventually we'll want to ship with Guava instead of GC so that we can use
Guava-specific methods, but projects can make that switch at their leisure.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6044 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-03-16 23:52:58 +00:00
Ray Greenwell b5de96dc83 It's an ecological disaster!
I'm trashing the Environment!
No more *-env libs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-08-21 22:46:50 +00:00
Michael Bayne 646b438404 We need commons-collections as well for our velocity-using tools.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5866 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-13 00:29:59 +00:00
Michael Bayne 4bcc8ab7c4 Less spammy ant task error reporting, further narya-tools dependencies.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5864 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-12 22:19:22 +00:00
Michael Bayne 1e2b48deb2 Shorten the property file name.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5862 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-12 22:02:49 +00:00
Michael Bayne 1e5b1e5a7f Place all of our tools into narya-tools along with all of their dependencies.
Provide an ant properties file that defines all of our tasks in one fell swoop.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5861 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-12 22:00:36 +00:00
Michael Bayne 2c2e28f5ed Move our EHCache peer coordinator down here where other projects can use it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5835 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-22 22:10:34 +00:00
Michael Bayne 755c27c41c Bring AdminService into line with the "a manager implements the provider" world
order that came about ages ago.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5811 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-02 17:32:57 +00:00
Michael Bayne 597062f0bc Oops. Can't do that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5733 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 22:57:55 +00:00
Michael Bayne 51f1f273d9 Allow 1.6 source but continue to target 1.5 bytecode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5732 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-17 22:49:29 +00:00
Michael Bayne cc1690654a No longer need this platform hackery.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5706 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-31 01:36:58 +00:00
Michael Bayne 6f535f3346 Added asdoc target.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5704 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-30 22:55:27 +00:00
Michael Bayne 991b9a9ffc Updated to new Depot world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5625 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-08 02:10:25 +00:00
Michael Bayne 1a6e705f81 Made "ant tests" compile and run the tests not just compile them.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-18 21:14:56 +00:00
Michael Bayne e0aea87f62 Moved the Presents overview out of the javadocs. Added some simple top-level
pages which give us something useful to link to when we want to point to all of
the javadocs for a particular subtree of the Narya packages.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5411 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-02 00:47:06 +00:00
Charlie Groves 5baacc36da Don't include dobject documentation in the distributed jar
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5222 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-07 21:31:57 +00:00
Jamie Doornbos 8ce8e69b59 Changed BureauRegistry to use Launcher and updated bureau tests
* Moved the thane-specific TestClientMain out into src/thane and renamed 
  BureauTestClient
* Removed server name and port from the registry init and from the Launcher/
  CommandGenerator parameters. These can be inserted by the caller
* Converted all the asc junk to compc/mxmlc the same as msoy does it
* Moved the test client main function into src/as land
* Added extdeps.suffix alternative approach since tests/build.xml does not
  get launched from nifty ooo-libs container
* Fixed bureau test targets
* Moved avmthane to overridable property and corrected out of date default
* Converted BureauRegistry code to deal with Launcher objects and added shim
  to preserve use of CommandGenerator
* Fixed narya build to remove thane-config.xml after building aslib


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5218 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-02 23:44:11 +00:00
Par Winzell 242e38a472 Handle swc dependencies with different names.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5184 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-13 16:37:25 +00:00
Par Winzell afee3d0b13 Michael points out, from Russia, that I'm in violation of our library naming policy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5183 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-13 15:05:10 +00:00
Par Winzell b88cee2be7 Stop switching different source files into Environment.as's place. Instead build tiny swc's with the player-specific Environment.as and the thane-specific one. Then compile naryalib.swc with one of these tiny swc's as an external library. When we compile the final executables we'll do a inclusive linking to get the right implementation into place.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5182 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-13 03:39:26 +00:00
Par Winzell 6b279daff9 Stop building ABC stuff. This can (almost) all be ripped out if we're successful in our transition.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5180 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-13 00:07:57 +00:00
Par Winzell ae5cda0ebf This has been misnamed for quite a while and nobody ever noticed... which presumably means this is a rather unimportant fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5176 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-10 15:46:49 +00:00
Michael Bayne bf77cb1520 Moved location services implementation into LocationManager so that
LocationProvider can be an interface like its brothers and sisters.

Modified the place registry to create PlaceManager instances using the injector
so that we can inject dependencies into managers. Also modified the custom
classloader functionality so that it can/will circumvent this process
entirely. It's not possible to inject using a custom classloader and one
certainly would not want to do so.

Unfortunately this means we can't inject some basic managers into PlaceManager
because it needs to work for games loaded into a sandboxed classloader, but the
big win is that in everything other than GameManager and PlaceManager, we can
inject to our heart's content.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5168 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 17:18:26 +00:00
Michael Bayne a7c7d853fe Handle the BodyService with a BodyManager instead of a concrete BodyProvider.
More dependency injection (or removal in the case of SpeakUtil).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5163 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 13:06:03 +00:00
Jamie Doornbos d2b8eaeb6b Removed temporary lib/abc files from narya and replace dependencies with maven ones
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5150 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-04 23:59:37 +00:00
Jamie Doornbos 73b52b1e5f Reordered files for narya asc build to fixed static init crash. Also moved the Environment.as out of the auto-generated files since it had to be manually reinserted each time
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5144 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-30 06:27:53 +00:00
Jamie Doornbos 7ac8aa5583 More jiggering pokering workarounds for crapness of asc (files built with AscLibTask cannot be used to execute a VM, only to build a VM)... confusing, I know... ask Zell
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5142 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-30 01:10:29 +00:00
Jamie Doornbos a741f00f0b Temporarily deploy thane and builtin abc files as part of narya-abc
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5128 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-23 07:07:11 +00:00
Jamie Doornbos 732b726063 Yikes, that was unexpected. the flex task prefers absolute paths. Thanks Bamboo!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5127 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-23 06:40:14 +00:00
Jamie Doornbos 392ed4bf89 Change abc build to use an exclusion file rather than an inclusion one
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5125 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-23 05:48:40 +00:00
Jamie Doornbos d7a8cf4518 Cleaned up abc build using flexTasks.jar
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5124 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-23 05:44:15 +00:00
Jamie Doornbos 3940a13e32 Preparing narya abc for mavenification: renamed naryalib.abc to narya-abc.abc so artifactId does not conflict. Also fixed narya-dist to include bureau classes and swapped in new hard-wired avmthane for test client target.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5114 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-21 23:39:35 +00:00
Charlie Groves 6a00927002 Don't include the source for native libs in the jar
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5110 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-19 20:56:31 +00:00
Par Winzell e279133868 Redundancy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-15 21:57:09 +00:00
Par Winzell 8de38e5bbb Add a classpath condition so Yohoho builds again. Oopsie.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5097 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-15 21:48:39 +00:00
Par Winzell 4c46899e23 Really really cluttering the build files up.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5096 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-15 17:37:03 +00:00