Howdy,

Here are some disjointed thoughts about JavaScript support, as provided by the 
different 3rd party plugins.

The biggest problem I can see is that none of these plugins play well together, 
which to some extent is a symptom of there being many different ways to “do 
JavaScript”. Also, I think it's a symptom of there being no core modelling in 
this area.

I've been contemplating what a “javascript-base” plugin might provide if we 
were to do such a thing.

Providing something like sourceSets would probably be a good start. At the 
moment most tasks are using references to directories and finding all js files 
manually, which is unnecessary and defeats task chaining through buildable 
inputs. I'm not sure what else a JavaScript source set would do besides be a 
glorified FileTree. I'm not sure at this point what else there is to model, or 
is worth modelling.

Not sure what we would do code wise to achieve this, but promotion of using 
SourceTask as a super class would probably do wonders in this space. 

Providing some JavaScript runtime support would be useful too. At the very 
least, this would be support for RhinoJS. It could eventually expand to include 
PhantomJS and possibly real browsers automated with WebDriver too. A lot of the 
javascript tools (compressors, static analysis etc.) are written in JavaScript, 
hence the need for a runtime.

As for testing, I'm still not sure what to do. The different test frameworks 
have different ways of working that would be hard to generalise like we did 
with JUnit and TestNG I think. I think the best we could do is provide some 
abstractions around JavaScript runtimes and JavaScript + HTML runtimes. This 
would allow different focussed JavaScript testing plugins to code against these 
abstractions. At the moment, most of the existing javascript testing plugins 
couple a testing framework with a runtime. This is something users will want to 
control. They may even want to use multiple, e.g. run their JS unit tests in 
IE, then FireFox etc.

No actions to take at this stage, just sharing my thoughts so far.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to