Commit Graph

38 Commits

Author SHA1 Message Date
Jamie Doornbos b185502683 Fix code generation to work with jmustache 1.4
In addition to the streamable generation, there were also issues with the receiver stuff, mostly to do with import
ordering. Modernizing that code to use ImportSet and {importGroups} seems to have fixed it.

NOTE: This is also broken in narya 1.9, but it not really worth the effort to fix that. It's easier just to move all
the projects that need it back to trunk. Hurray bleeding edge!

Testing done: gencode in orth and who, checked no diffs were generated.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6727 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-10-10 19:26:43 +00:00
Michael Bayne 82d31da4f8 JMustache now requires fewer machinations to get sensible newline behavior.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6719 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-09-30 02:51:17 +00:00
Bruno Garcia d2fcc311b5 Squish all the field name constants into a single block, like the signals.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6697 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-08-26 04:58:37 +00:00
Bruno Garcia e1560a1298 Include field type parameters in the generated AS to force their linkage.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6696 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-08-26 04:54:07 +00:00
Charlie Groves 01a57a03bf Parameterize InvocationService on the ClientObject type expected to call the service, and generate
InvocationProviders that take that type instead of just ClientObject.

Also, use the full set of import groupings no matter what. If that's the way we like it, that's the
way we like it.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6682 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-07-07 21:10:49 +00:00
Jamie Doornbos 29f06663c6 Various tweaks to get import ordering to match the ooo convention of putting java and javax imports first, then threerings imports.
* Add importGroups template variable, set to the two groups: one for java, one for threerings.
* Omit Client import the client-side generated code. This was removed some time ago.
* Omit the blanket int -> Integer replacement, this was only needed for the marshaller
* Add the as boxing imports when generating the marshaller (this gets the Integer import for int types in marshaller signatures)
* Change the templates to put space between each group of imports.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6677 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-07-06 21:06:55 +00:00
Jamie Doornbos 82bf9dcd75 Make actionscript streamable sort and gorup the imports according to the aspirin convention. This doesn't yet accomodate imports that were added for non-generated blocks, but is very close to not requiring any postprocessing for the streamable who code, i.e. touchin mah filez
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6655 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-06-14 08:25:12 +00:00
Jamie Doornbos e9099dc415 Fix the streamable task to coordinate properly between source headers and preambles.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6654 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-06-14 05:34:13 +00:00
Bruno Garcia c0a194c3cc Like the Java version, prevent superfluous whitespace from being generated from empty args lists.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6638 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-05-10 18:57:19 +00:00
Jamie Doornbos cae3a3f1b9 Support converstion of java enum to com.threerings.util.Enum as part of actionscript streamable conversion.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6600 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-04 21:11:58 +00:00
Michael Bayne 248795ba57 Handle service methods with forall types.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6582 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 00:47:50 +00:00
Michael Bayne fc7706c79d Get the transport specification out of the construction path, since it's not a
streamed property of the event. It turns out to be cleaner to just set it in
the places where we know that we want a specific transport anyway.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6581 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 00:01:46 +00:00
Michael Bayne 217927de2b A variety of javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6533 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:17:09 +00:00
Michael Bayne 0a15a1e09a Avoid generating {@link Outer.Inner}, as Javadoc does not support such links.
Bug 4464323 was filed 10 years ago, bringing this to Sun's attention, and has
been acknowledged as a known bug. Apparently this has not annoyed anyone on the
Java team enough to merit fixing. Sigh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6532 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 17:50:09 +00:00
Charlie Groves 81bfee5132 Generate receivers and decoders for actionscript
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6507 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-02-26 02:04:06 +00:00
Charlie Groves 2c17d66f02 Add the messageReceived and destroyed signals to DObject rather than generating them. If they were generated, subclassing would fail on field conflicts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6470 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-28 19:33:46 +00:00
Par Winzell d66ed6f7fe This method is in fact defined on the listener.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6423 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-07 20:58:17 +00:00
Charlie Groves 8f8a50c9e8 Apply additions and removals to OidList fields on DObjects immediately on the server to make it
match DSets and setting attributes.  With the old behvaior, if a client subscribed to a DObject and
modified an OidList on it in a single pass, it could miss the modification.  The DObject is
serialized immediately when the server gets the subscription request, but events aren't sent for
that subscription till it's processed the next time the omgr queue comes round.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6420 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 09:15:47 +00:00
Charlie Groves edf6dccdf7 Generate OidList signals for actionscript
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6418 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-06 09:08:24 +00:00
Tom Conkling 0dae31b2c9 ActionScript DObjects dispatch a signal when they receive a MessageEvent
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6415 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-01-05 23:49:45 +00:00
Michael Bayne 36a98f8794 Removed the need to supply a Client reference when making invocation service
calls on the Java side, to match this added convenience we introduced to the
ActionScript side some time ago.

Before arms are raised into the air and waved like they really do care, bear
the following in mind:

Nothing will change at all on your project until you take some action to do so.
That action could include any of the following:

1. Continue to use narya-tools-1.2 to run genservice and you'll get the old
style "pass a Client reference for every service method invocation" marshallers
and you can continue to live happily in the past.

2. Leave some of your stuff un-regenerated, but generate new stuff using the
new tools and use the Client-reference-free style for new services. This is
likely to engender some PITA if you're trying to use both styles in the same
project because genservice just wants to operate on everything, but I offer it
as an option in case some other PITA motivates the tolerance of this
(presumably smaller) PITA.

3. Embrace the brave new world of simplicity and wield your good friend sed for
fun and profit:

(make necessary build.xml updates to start using narya-tools-1.4-SNAPSHOT)

% find src -name '*Service.java' | xargs sed -i 's:Client client, ::g'
(this will remove the Client argument from most of your services, some manual
fixes may be needed)

% ant genservice

% find src -name '*.java' | xargs sed -i 's:_ctx.getClient(), ::g'
(this will fix most of the places that pass a client reference into an
invocation service, some manual fixes will probably be needed)

I did this on Vilya and it magically took care of like 95% of the places where
changes were needed. The remaining half dozen changes were painless. Clearly
something like Yohoho vastly dwarfs Vilya in scope, but someone looking for an
hour or two of mindless typing to distract them on a lazy Sunday afternoon
would likely breeze through even that vast codebase without breaking a sweat.

Two more notes:

1. I'm going to switch Narya and Vilya over to the new style, and I'll be
fixing all the projects that use their services.

2. I lied (a teeny bit) about nothing changing. I made the old Client-taking
sendRequest methods deprecated, so projects that don't switch to the new style
will be presented with a large number of deprecation warnings. If this is too
terrible a burden to bear, I can remove the deprecation annotations on those
methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6395 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-31 21:56:46 +00:00
Tom Conkling aea50988da Changed the names of generated actionscript DObject signals to be more in line with the listener events they're mirroring, and also to read more fluently.
(Hope I'm not stepping on anyone's toes with this; I'm happy to revert if there are strong arguments against.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6390 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-21 22:02:25 +00:00
Tom Conkling 865c00dbfe Add a 'destroyed' signal to generated ActionScript DObjects
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6389 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-21 19:54:57 +00:00
Par Winzell 0d8e889292 Oops, pubFields here too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6382 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 18:31:03 +00:00
Par Winzell 1555bf92f9 Turn protected Java members into protected ActionScript members, and put them in the right place in the file.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6381 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-15 18:25:03 +00:00
Bruno Garcia bf215119c4 Changed the names of generated signals to match their Java equivalents and to feel nicer with
plural field names.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6355 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 21:49:51 +00:00
Charlie Groves 939d309fa2 These are both pretty busted, so let's kill them to eliminate confusion with the functional
GenActionScriptStreamableTask.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6345 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-09 00:02:52 +00:00
Bruno Garcia 5758499ba0 Generate a signal for array ElementUpdatedEvents.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6339 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-04 01:30:08 +00:00
Bruno Garcia 66dfd0f44e Generate DSet add/remove/update signals for AS3 DObjects.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6338 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-04 00:24:30 +00:00
Bruno Garcia 6e6895d32d Ignore updates to fields that weren't defined by this class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6329 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-02 02:35:23 +00:00
Bruno Garcia b660861be3 In an effort to make DObject updates easier to react to in actionscript, gendobj now generates
signals for each field that can be listened to individually.

From the old:

barrel.addListener(new AttributeChangeAdapter(function (event :AttributeChangedEvent) :void {
    if (event.getName() == BarrelObject.MONKEY_COUNT) {
        // ... cast event.getValue() and use it
    }
}));

to the new:

barrel.onMonkeyCountChanged.add(function (newValue :int, oldValue :int) :void {
    // ...
});


Only AttributeChangedEvent have been signalified, but I'm planning to continue with the other
ChangeListeners shortly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6328 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-12-02 02:25:35 +00:00
Charlie Groves ff1254dc37 Whoops, can't have writeObject methods in actionscript DObjects
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6316 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-30 02:50:32 +00:00
Charlie Groves 5a3694aa6f Separate GenActionScriptStreamableTask from GenActionScriptTask and add dobject support to GenActionScriptStreamableTask
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6315 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-30 02:39:12 +00:00
Charlie Groves 220b7a28b5 Add the actionscript streamable generator
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6314 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-30 01:53:02 +00:00
Nathan Curtis c4cb01db9f Fix this template.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6300 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-23 19:54:12 +00:00
Mike Thomas e0ea50b97d We don't need this unchecked bit anymore, since we're using the cast() method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6298 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-23 01:18:02 +00:00
Charlie Groves 1f010f0a4e Add a C++ client for presents.
It provides code generators for streamables, services and receivers, but not DObject.  It uses
Apple's CFNetwork for its sockets and builds with XCode, so it's limited to OS X and iOS. It should
be straightforward to replace both to make it cross-platform.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6264 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-13 21:58:45 +00:00
Michael Bayne 7df0de5389 Keep our resources in src/main/resources per the standard project layout.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6251 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-08 17:31:33 +00:00