Loading a groovy class in ant build.xml?
===

I have a file **MyClass.groovy** containing:

    class MyClass {
      void firstMethod(int i) {
        println i
      }
      
      String secondMethod(String txt) {
        return txt + "added text"
      }
    
      static void main(String[] args) {
        
      }
    }

In my **build.xml** file I have:

    	<target name="run-groovy-script-test">
         <groovy src="groovy/MyClass.groovy">
          
         	<!--  new MyClass().firstMethod(22)-->
         	<!--  new MyClass().secondMethod("sample")-->
         	<!-- How to store the returned value from the method in eg. an ant property? -->
         	
          </groovy>
       </target> 	


but how do I instansiate the MyClass class and call its methods? And how do I store the return value of the **secondMethod** in eg. an ant property?

I know that I can specify a **main** method in the .groovy file which will automatically be executed using the above. But it could be nice to control which methods should be called directly.

