Posted by: Cliff | May 1, 2008

Pyx4ME Hack

It’s late tonight but I gotta get this posted. I’m still trying to get a good dev cycle with the Maven Pyx4ME maven plug in and IntelliJ Idea. I’m running on Parallels on my Mac. Here’s an extra tag I added to the project generated from the pyx4ME archetype:

<plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
              <id>run</id>
            <phase>install</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                  <property environment="env"/>
                  <echo message="Running WTK out of ${env.WTK_HOME}"/>
                  <taskdef resource="antenna.properties"/>
                  <wtkrun jadfile="target/${project.artifactId}-${project.version}-me.jad"/>
              </tasks>
            </configuration>
          </execution>
          <execution>
              <id>site</id>
            <phase>site</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <copy overwrite="true" file="${project.build.directory}/${project.build.finalName}-me.jar" tofile="${project.build.directory}/site/mymidlet.jar" />
                <copy overwrite="true" file="${project.build.directory}/${project.build.finalName}-me.jad" tofile="${project.build.directory}/site/mymidlet.jad" />
                <replace value="mymidlet.jar" token="${project.build.finalName}-me.jar" dir="${project.build.directory}/site">
                  <include name="mymidlet.jad"></include>
                </replace>
              </tasks>
            </configuration>
          </execution>
        </executions>
          <dependencies>
              <dependency>
                  <groupId>net.sf.antenna</groupId>
                  <artifactId>antenna</artifactId>
                  <version>0.9.14</version>
              </dependency>
          </dependencies>
      </plugin>

This lets me run my project using WTK assuming WTK_HOME is been set as a system env var. More stuff later.


Responses

  1. Is it possible to debug a Maven J2me application in IntelliJ ?

  2. Yes It is possible. Debugging is a matter of instrumenting the JVM so in actuality you can debug any Java process from IntelliJ. It all depends on how you launch the app. I have been working on a midlet plugin to address OTA uploads to Antenna’s provisioning servlet and running the emulator (micro emulator but eventually WTK and Blackberry). I’ve been so busy fighting with the compiler I’ve neglected my site. Rest assured I will return soon with the low down on Debugging J2ME apps built from Maven in IntelliJ, how to properly command line compile with Rapc cross platform from Ant or Maven, and if I get lucky on device debugging with Blackberry. It’s gonna be a minute before I get it all posted..


Leave a response

Your response:

Categories