Fully working BSF engine including variable passing context etc.
Now rather than just Groovy scripts being put into the static main() method, the scripts now derive from Script, the code is in the run() instance method and the Script object can take a ScriptContext to allow variables to be passed into and out of the script.
This makes for easy BSF integration. It will also be useful for interactive shells too; the variables can be shared across script invocations. Indeed each script can be in its own classloader and only the ScriptContext shared.
348 lines of code changed in:
Initial cut of a BSF engine for Groovy
Patch to allow main(String[]) of strings to return an object.
Added hooks to GroovyShell for BSF.
280 lines of code changed in:
removed text file - its now in the wiki
0 lines of code changed in:
Added 'super' as a special variable too
11 lines of code changed in:
Added a test case to demonstrate that 'this' can be used in static methods
15 lines of code changed in:
Patch so that 'println' can be called from static methods
15 lines of code changed in:
Refactored Groovy to be called GroovyShell which is a bit more descriptive.
Updated the documentation to have a better organisation and include details on running groovy code.
Also we now have 2 executables...
groovyc compiles groovy to bytecode
groovy compiles & runs groovy scripts
414 lines of code changed in:
Static methods (such as scripts) can now use closures.
Also fixed a bug in the codegen of static methods.
Also we've now got a Groovy class which can be used from the command line or Java code to run arbitarary Groovy scripts
104 lines of code changed in:
Added AST level support for methods inside scripts. Just need the parser to be able to parse them
33 lines of code changed in:
Added support for the running of Groovy scripts without a class required
So you can now compile & run the following script...
println("Hello world")
who-hoo!
280 lines of code changed in:
Refactored the parser so that we can build a module which can include classes and statements
42 lines of code changed in:
Numerous bug fixes for working with class expressions.
Now we can handle the situation where you refer to a class in the same compliation unit (but not yet generated as bytecode) as well as handling imports to not-yet-existing classes etc.
361 lines of code changed in:
Refactor to introduce a single CompileUnit which owns all the modules and classes in a compile so that we can know for sure which classes are in the compile unit and which are not. We can also detect duplicate classes and so forth.
287 lines of code changed in:
Minor refactor to allow a source file to be a 'module' which allows N class declarations, import statements and soon embedded statements - if working in script mode
242 lines of code changed in:
fixed the javadoc packages
2 lines of code changed in:
Updated the documenation to include instructions on how to use Groovy unit tests from inside IDEs
21 lines of code changed in:
removed package statement as we've stuff in groovy.* and in org.codehaus.*
2 lines of code changed in:
Added a GroovyTestSuite which is a helper method for running Groovy unit test cases from inside an IDE which doesn't support Groovy. It just looks like a normal Java test suite which compiles a given Groovy script and uses that as the test suite
70 lines of code changed in:
Major refactor of the use of print() and println().
We've now added 'global' methods to handle printing out objects in a simple way (common in things like Python and Ruby). This avoids the long winded System.out.println().
So we can now just do
println( "hello world!" )
The nice thing about this is, the owner class in which you execute this operation could overload print() and println() to do something cunning, like redirecting output to a file or whatnot.
So the previously added methods to print an object have been removed. You can no longer do
"hello".println()
146 lines of code changed in:
Fix for GDO test suite to work around bug GROOVY-45 until its fixed
116 lines of code changed in:
added test to show that boolean && expressions look screwy
10 lines of code changed in:
Added an example of an extensible language construct
81 lines of code changed in:
Added some extra tracing to help the GDO implementation.
Seem to have found a bug somewhere but also added support for and and or in predicates for GDO - not working yet though
63 lines of code changed in:
Added initial checkin of the GroovyDataObjects (GDO) developed at GeekNight with Chris Stevenson for creating groovy data objects via normal Groovy syntax (rather than SQL) and using closures for predicates or view projections or order by clauses
172 lines of code changed in:
Added test case for 'global' print methods
26 lines of code changed in:
Removed the Groovy Geronimo JMX console which was checked in by mistake
28 lines of code changed in:
Updated the documentation for closures to include a mention of the 'it' variable
20 lines of code changed in:
Added support for a default closure parameter called 'it' which makes writing simple closures much more concise.
e.g.
[1, 2, 3, 4].findAll { it > 1 }.map { it * 2 }
215 lines of code changed in:
Added some instructions on how to compile Groovy code
3 lines of code changed in:
Added nicer JavaDoc grouping to separate the GDK from the implementation
28 lines of code changed in:
Minor refactor - moved the AntBuillder and GroovyMBean classes into the groovy.util package to make the groovy APIs simpler to use.
Also cleaned up the javadoc somewhat ensuring there's a package descriptor for each package
1116 lines of code changed in:
updated documentation links
24 lines of code changed in:
Made the parser exceptions non-runtime and commented out the failing PrintTest code
45 lines of code changed in:
Fixed failing test
9 lines of code changed in:
disabled failing null check
2 lines of code changed in:
Added unit tests to check for compiler errors.
Refactored the syntax & parser exceptions to be runtime for now.
62 lines of code changed in:
Added new test case that demonstrates the use of class expressions
42 lines of code changed in:
added a little more getting started documentation and fixed the developer CVS link
22 lines of code changed in:
updated the todo list, refactoring it a bit
198 lines of code changed in:
Added a unit test which demonstrates the GroovyMBean in action
0 lines of code changed in:
fixed links for mail lists
12 lines of code changed in:
Added getProperty() and setProperty() methods on GroovyObject making it easy to overload the property access mechanism in Groovy.
Also added an initial GroovyMBean which acts just like a regular POGO but is actually a JMX proxy to an underlying local or remote MBean
336 lines of code changed in:
Numerous changes.
* tidied up the closure methods - added many new helper methods such as for iterating over files by line
* added a Swing builder together with some MVC models to make creating Swing UIs in Groovy really simple
* various things tidied up and more unit test cases
* return statement is now optional
3955 lines of code changed in: