Ant Script to compile WidgetSet

Hi all,

i try to run an antscript that compiles the widgetset. I need this because i don’t have a vaadin nor ivy project so i can not use the ivy template nor the Eclipse plugin.

I have following ant tasks:


<!-- Modify this configuration to compile your own widgetset -->
    <target name="configure-widgetset" depends="configure">
        <property name="widgetset" value="test.CombinedWidgetSet"/>
        <property name="generate.widgetset" value="1"/>
        
        <property name="widgetset-path" value="xpoy-test/widgetset"/>
    </target>
	
	<!-- Generates a combined widget set from all widget    -->
    <!-- sets in the class path, including project sources. -->
    <!-- Updates the configuration if it already exists.    -->
    <target name="generate-widgetset" depends="configure, configure-widgetset" >
        <property name="myproperty" refid="my.classpath"/>
        <echo> Base: ${base}" </echo>
        <echo> MyPropClassPath: ${myproperty}" </echo>
        <echo> SRC: ${src-location}" </echo>  

        <!-- Create the directory if it does not already exist. -->
        <mkdir dir="${src-location}/${widgetset-path}"/>
        
        <java classname="com.vaadin.server.widgetsetutils.WidgetSetBuilder"
              failonerror="yes" fork="yes" maxmemory="256m">
            <arg value="${widgetset}"/>
            <jvmarg value="-Xss1024k"/>
            <jvmarg value="-Djava.awt.headless=true"/>
            <classpath refid="my.classpath"/>
        </java>
    </target>

I get following NullPointer:


     [java]
 Mrz 20, 2013 7:58:39 PM com.vaadin.server.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
     [java]
 INFO: Widgetsets found from classpath:
     [java]
 	com.vaadin.DefaultWidgetSet in jar:file:E:/workspace/amos_server/stdclasses/unpublic/vaadin-client-7.0.1.jar!/
     [java]
 	org.vaadin.tokenfield.TokenfieldWidgetset in jar:file:E:/workspace/amos_server/stdclasses/vaadin/tokenfield-7.0.1.jar!/
     [java]
 	org.vaadin.passwordfield.PasswordFieldWidgetset in jar:file:E:/workspace/amos_server/stdclasses/vaadin/passwordfield-7.0.0.jar!/
     [java]
 Mrz 20, 2013 7:58:39 PM com.vaadin.server.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
     [java]
 INFO: Search took 16ms
     [java]
 Exception in thread "main" java.lang.NullPointerException
     [java]
 	at com.vaadin.server.widgetsetutils.WidgetSetBuilder.updateWidgetSet(WidgetSetBuilder.java:70)
     [java]
 	at com.vaadin.server.widgetsetutils.WidgetSetBuilder.main(WidgetSetBuilder.java:52)

Anybody a clue how I have to configure this?

Do I have to create an *.gwt.xml or does it create one itself? And if I create one where do I have to put it?

Thansk for any Help and Hints

Marc

just a guess: create a CombinedWidgetset.gwt.xml-file in package test.

Hi there thanks for the tip,

it wasent the problem. After i figured out how to debug the java task I found out that i forgot to at my sourcefolder to the classpath.
The WidgetSetBuilder creates or updateds the *.gwt.xml file that is the widgetset name you pass as an argument

For everybody that is interested in it, this is the Ant-Script that works for me.

Currently I don’t have a own Theme, so I don’t know if the Theme-Compiler works correct.

It loads all dependencies in to the class path and creates the WidgetSet with all found Widgets in the Classpath.

You can change the folder of the WebContent. As we use an embedded jetty we load the resources programatically.
therefore we also don’t have a “standard” Vaadin-Project and I needed this own script.

I am not sure if this is the perfect solution, so if anyone finds something the optimize let me know, as I am no specialist to ANT nor GWT-Compilation.

Marc
12871.xml (6.11 KB)