Java, Ubuntu, ...

Aller au contenu | Aller au menu | Aller à la recherche

jeudi 31 juillet 2008

How to speed up the GWT compiler ? (Part I)

English version

I am working on an international CRM project based on JDK 6, GWT 1.5, MyGWT/Ext GWT, tomcat 6, maven, hibernate, spring, Oracle, ...

This business application must worked with Firefox 2, IE 6/7 and 9 locales (the target is about 15 locales).

This a very large GWT application and it takes a long time to compile, about 12 mn "only" for GWT maven module : this is a long time in development mode.

GWT spends time to compute permutations : create javascript file per browser/locale. With this kind of application, GWT produces 50 permutations :

  • 5 browsers : ie6, opera, gecko1_8, safari, gecko
  • 10 locales : default, de_DE, en_UK, fr_FR, hr_HR, hu_HU, it_IT, nl_NL, pl_PL, pt_PT

This is my module.gwt.xml :

<module>
    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name="com.google.gwt.user.User" />
    <inherits name="com.google.gwt.i18n.I18N" />

    <!-- Add support -->
    <inherits name="com.aaa.bbb.ccc.XXXCore" />
    <!-- Add mygwt support -->
    <inherits name="net.mygwt.ui.MyGWT" />
    <!-- Add hibernate4gwt support -->
    <inherits name="net.sf.hibernate4gwt.Hibernate4Gwt" />
    <inherits name="net.sf.hibernate4gwt.SqlDates"/>
    <!-- Add gwt-log support -->
    <inherits name="com.allen_sauer.gwt.log.gwt-log" />

    <!-- Add ftr-gwt-library-date -->
    <inherits name='org.cobogw.gwt.user.User' />
    <inherits name="eu.future.earth.gwt.FtrGwtLibrary" />

    <!-- GWT locale -->
    <extend-property name="locale" values="de_DE" />
    <extend-property name="locale" values="en_UK" />
    <extend-property name="locale" values="fr_FR" />
    <extend-property name="locale" values="hr_HR" />
    <extend-property name="locale" values="hu_HU" />
    <extend-property name="locale" values="it_IT" />
    <extend-property name="locale" values="pt_PT" />
    <extend-property name="locale" values="pl_PL" />
    <extend-property name="locale" values="nl_NL" />

    <!-- Logging -->
    <extend-property name="log_level" values="DEBUG,INFO,WARN,FATAL,EROR,OFF" />
    <set-property name="log_level" value="INFO" />

    <!-- Turn off "DivLogger" -->
    <set-property name="log_DivLogger" value="DISABLED" />

    <!-- Specify the app entry point class. -->
    <entry-point class="com.aaa.bbb.ccc.XXXEntryPoint" />

</module>

The main idea is to reduce permutations.

How to speed up the GWT compiler ? (Part II).

How to speed up the GWT compiler ? (Part III).

French version

Coming soon.

mercredi 23 mai 2007

Mapper un arbre II

Préparation

Avec Maven, nous allons générer le projet et tous les éléments nécessaires pour Eclipse.

Lire la suite...

samedi 3 mars 2007

Drivers Oracle et Maven

Pour installer le driver Oracle 10.2.0.1.0 dans le repository Maven,

$ mvn install:install-file -Dfile=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar \ 
                           -DgroupId=com.oracle \
                           -DartifactId=ojdbc14 \
                           -Dversion=10.2.0.1.0 \
                           -Dpackaging=jar

Et pour l'utiliser, ajouter dans le pom.xml de votre projet maven

...
<dependencies>
...
        <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc14</artifactId>
                <version>10.2.0.1.0</version>
        </dependency>
...
</dependencies>
...

jeudi 8 février 2007

Downloader les sources automatiquement avec Maven

Pour éviter à chaque fois de rajouter -DdowloadSources=true quand vous générez votre projet Eclipse,

mvn eclipse:clean eclipse:eclipse -DdownloadSources=true

vous pouvez préciser cette option dans votre settings.xml (ça fait déjà moins de choses à taper)

  </profiles>
  ...
    <profile>
      <id>alwaysActiveProfile</id>
      <properties>
        <downloadSources>true</downloadSources>
      </properties>
    </profile>
  ...
  </profiles>

  <activeProfiles>
  ...
    <activeProfile>alwaysActiveProfile</activeProfile>
  ...
  </activeProfiles>

Maintenant, les sources vont se télécharger automatiquement.

lundi 5 février 2007

Installer les sources d'un jar dans Maven

Pour installer un fichier de sources dans Maven, c'est assez simple. Par exemple, si vous voulez installer les sources de Spring à la main :

mvn install:install-file -DgroupId=org.springframework -DartifactId=spring -Dversion=2.0.2 -Dpackaging=jar -Dfile=spring-src.zip -Dclassifier=sources
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [install:install-file] (aggregator-style)
[INFO] ----------------------------------------------------------------------------
[INFO] [install:install-file]
[INFO] Installing /home/bazoud/download/spring-src.zip to /home/bazoud/java/maven/repository/org/springframework/spring/2.0.2/spring-2.0.2-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Feb 05 22:27:42 CET 2007
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------

A adapter pour vos jars.