Author: tchemit Date: 2009-12-29 18:45:48 +0100 (Tue, 29 Dec 2009) New Revision: 1704 Modified: trunk/jaxx-demo/pom.xml trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java trunk/pom.xml Log: use last version of mavenpom and i18n Modified: trunk/jaxx-demo/pom.xml =================================================================== --- trunk/jaxx-demo/pom.xml 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/jaxx-demo/pom.xml 2009-12-29 17:45:48 UTC (rev 1704) @@ -179,6 +179,7 @@ <execution> <goals> <goal>parserJava</goal> + <goal>gen</goal> <goal>bundle</goal> </goals> </execution> Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2009-12-29 17:45:48 UTC (rev 1704) @@ -34,7 +34,6 @@ Editable= Email\ Address\:= Email\:= -Empty\ I18n\ editor\:= Enabled= EnumEditor\ (country)\ \:= EnumEditor\ (language)\ \:= @@ -49,9 +48,6 @@ Green\:= Greet= Help= -I18n\ editor\ with\ no\ icon\ \:= -I18n\ editor\ with\ no\ text\ \:= -I18n\ editor\:= Inc\ (+)= Italic= JAXX\ Demo= @@ -111,7 +107,6 @@ edit=Edit edit2=Edit 2 edit3=Edit 3 -editor.getSelectedLocale()= f0= f1= file...= @@ -167,9 +162,7 @@ jaxxdemo.config.configFileName.description=Configuration file name jaxxdemo.config.ui.= jaxxdemo.config.ui.demo.path= -jaxxdemo.config.ui.fontSize= jaxxdemo.config.ui.fullscreen=To change the screen mode (true for full screen) -jaxxdemo.config.ui.locale=Locale of the application jaxxdemo.i18neditor.configuration=Configuration jaxxdemo.i18neditor.popupBorderText=Popup title jaxxdemo.i18neditor.selected.locale=Selected Language @@ -230,19 +223,9 @@ model1.isF0()\ ||\ model1.isF1()= model1.isF1()= movies=Movies -numbereditor.normal.float=Signed float -numbereditor.normal.int=Signed integer -numbereditor.positive.float=Positive float -numbereditor.positive.int=Positive integer -numbereditor.type=Type -numbereditor.with.auto.popup=With auto popup -numbereditor.without.auto.popup=Without auto popup -show/hide\ label1= -show/hide\ label2= t0.isSelected()= t0.isSelected()\ &&\ t1.isSelected()= t0.isSelected()\ ||\ t1.isSelected()= t1.isSelected()= -test= valid= x= Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2009-12-29 17:45:48 UTC (rev 1704) @@ -34,7 +34,6 @@ Editable=Editable Email\ Address\:=Courriel Email\:=Courriel -Empty\ I18n\ editor\:=Editeur I18n vide Enabled=Activ\u00E9 EnumEditor\ (country)\ \:=Editeur de pays EnumEditor\ (language)\ \:=Editeur de langue @@ -49,9 +48,6 @@ Green\:=Vert \: Greet= Help= -I18n\ editor\ with\ no\ icon\ \:=Editeur I18n sans icone \: -I18n\ editor\ with\ no\ text\ \:=Editeur I18n sans texte \: -I18n\ editor\:=Editeur I18n Inc\ (+)=Incr\u00E9menter (+) Italic=Italique JAXX\ Demo= @@ -111,7 +107,6 @@ edit=Editer edit2=Editer 2 edit3=Editer 3 -editor.getSelectedLocale()= f0= f1= file...= @@ -167,9 +162,7 @@ jaxxdemo.config.configFileName.description=Le nom du fichier de configuration jaxxdemo.config.ui.= jaxxdemo.config.ui.demo.path= -jaxxdemo.config.ui.fontSize= jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00E9cran -jaxxdemo.config.ui.locale=Langue utilis\u00E9e par l'application (fr_FR, en_GB ou es_ES) jaxxdemo.i18neditor.configuration=Configuration jaxxdemo.i18neditor.popupBorderText=Titre de la popup jaxxdemo.i18neditor.selected.locale=Langue s\u00E9lectionn\u00E9e @@ -230,19 +223,9 @@ model1.isF0()\ ||\ model1.isF1()= model1.isF1()= movies=Films -numbereditor.normal.float=D\u00E9cimal primitif \: [%1$s] -numbereditor.normal.int=Entier primitif \: [%1$s] -numbereditor.positive.float=D\u00E9cimal primitif positif \: [%1$s] -numbereditor.positive.int=Entier primitif positif \: [%1$s] -numbereditor.type=Type d'\u00E9diteur -numbereditor.with.auto.popup=Avec popup auto -numbereditor.without.auto.popup=Sans popup auto -show/hide\ label1= -show/hide\ label2= t0.isSelected()= t0.isSelected()\ &&\ t1.isSelected()= t0.isSelected()\ ||\ t1.isSelected()= t1.isSelected()= -test= valid=valide x=x Modified: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties =================================================================== --- trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-12-29 17:45:48 UTC (rev 1704) @@ -1,64 +1,64 @@ -aboutframe.about=\u00c0 propos +aboutframe.about=\u00C0 propos aboutframe.license=Licence aboutframe.ok=OK aboutframe.thirdparty=Tierce partie -columnselector.action.tip=S\u00e9lectionner les colonnes +columnselector.action.tip=S\u00E9lectionner les colonnes config.action.quit=Quitter -config.action.quit.tip=Quitter l'\u00e9diteur de configuration +config.action.quit.tip=Quitter l'\u00E9diteur de configuration config.action.reset=Annuler -config.action.reset.tip=Annuler les modifications de cette cat\u00e9gorie +config.action.reset.tip=Annuler les modifications de cette cat\u00E9gorie config.action.save=Enregistrer -config.action.save.tip=Sauver les modifications de cette cat\u00e9gorie -config.category.needReloadApplication=Cat\u00e9gorie '%1$s' \: -config.category.needReloadUI=Cat\u00e9gorie '%1$s' \: -config.category.saved=La cat\u00e9gorie '%1$s' a \u00e9t\u00e9 modifi\u00e9e \: +config.action.save.tip=Sauver les modifications de cette cat\u00E9gorie +config.category.needReloadApplication=Cat\u00E9gorie '%1$s' \: +config.category.needReloadUI=Cat\u00E9gorie '%1$s' \: +config.category.saved=La cat\u00E9gorie '%1$s' a \u00E9t\u00E9 modifi\u00E9e \: config.choice.cancel=Annuler config.choice.continue=Continuer config.choice.doNotSave=Ne pas enregistrer config.choice.ok=Ok config.choice.save=Enregistrer -config.defaultValue=Valeur par d\u00e9faut -config.defaultValue.tip=Valeur par d\u00e9faut de l'option +config.defaultValue=Valeur par d\u00E9faut +config.defaultValue.tip=Valeur par d\u00E9faut de l'option config.descrition=Description -config.error.category.already.exists=La cat\u00e9gorie de nom '%1$s' existe d\u00e9j\u00e0\! -config.error.category.not.found=La cat\u00e9gorie de nom '%1$s' n'existe pas\! +config.error.category.already.exists=La cat\u00E9gorie de nom '%1$s' existe d\u00E9j\u00E0\! +config.error.category.not.found=La cat\u00E9gorie de nom '%1$s' n'existe pas\! config.key=Clef config.key.tip=Clef de l'option -config.message.quit.invalid.category=La cat\u00e9gorie '%1$s' n'est pas valide\! -config.message.quit.valid.and.modified.category=La cat\u00e9gorie '%1$s' poss\u00e8dent des options modifi\u00e9es \: -config.model.needReloadApplication=Des options ont \u00e9t\u00e9 modifi\u00e9es qui n\u00e9cessitent le red\u00e9marrage de l'application.\n -config.model.needReloadUI=Des options ont \u00e9t\u00e9 modifi\u00e9es qui n\u00e9cessitent le red\u00e9marrage de l'interface graphique.\n -config.modified=Option modifi\u00e9e (valeur originale \: %1$s) -config.no.option.selected=< Pas d'option s\u00e9lectionn\u00e9e > +config.message.quit.invalid.category=La cat\u00E9gorie '%1$s' n'est pas valide\! +config.message.quit.valid.and.modified.category=La cat\u00E9gorie '%1$s' poss\u00E8dent des options modifi\u00E9es \: +config.model.needReloadApplication=Des options ont \u00E9t\u00E9 modifi\u00E9es qui n\u00E9cessitent le red\u00E9marrage de l'application.\n +config.model.needReloadUI=Des options ont \u00E9t\u00E9 modifi\u00E9es qui n\u00E9cessitent le red\u00E9marrage de l'interface graphique.\n +config.modified=Option modifi\u00E9e (valeur originale \: %1$s) +config.no.option.selected=< Pas d'option s\u00E9lectionn\u00E9e > config.option.final=Option non modifiable config.option.label=Option '%1$s' (%2$s) -config.option.modified=Valeur modifi\u00e9e < ancienne valeur \: '%1$s' - nouvelle valeur \: '%2$s' > -config.title=Pr\u00e9f\u00e9rences +config.option.modified=Valeur modifi\u00E9e < ancienne valeur \: '%1$s' - nouvelle valeur \: '%2$s' > +config.title=Pr\u00E9f\u00E9rences config.title.need.confirm=Une confirmation de votre part est requise... -config.title.will.reload.application=L'application doit \u00eatre red\u00e9marrer... -config.title.will.reload.ui=L'interface graphique doit \u00eatre relancer... -config.unmodifiable=Ne peut pas \u00eatre modifi\u00e9 +config.title.will.reload.application=L'application doit \u00EAtre red\u00E9marrer... +config.title.will.reload.ui=L'interface graphique doit \u00EAtre relancer... +config.unmodifiable=Ne peut pas \u00EAtre modifi\u00E9 config.unvalid=Option non valide (valeur originale \: %1$s, type requis \: %2$s) config.value=Valeur config.value.tip=Valeur de l'option -entitycombobox.action.reset.tip=R\u00e9initialiser la valeur de la liste d\u00e9roulante -entitycombobox.action.sort.tip=Modifier le tri de la liste d\u00e9roulante +entitycombobox.action.reset.tip=R\u00E9initialiser la valeur de la liste d\u00E9roulante +entitycombobox.action.sort.tip=Modifier le tri de la liste d\u00E9roulante entitycombobox.popup.label=Objet '%1$s' entitycombobox.popup.title=Modifier le tri -entitycombobox.sort.off=Cliquer pour activer le tri sur la propri\u00e9t\u00e9 '%1$s' -entitycombobox.sort.on=Le tri est effectu\u00e9 sur la propri\u00e9t\u00e9 '%1$s' +entitycombobox.sort.off=Cliquer pour activer le tri sur la propri\u00E9t\u00E9 '%1$s' +entitycombobox.sort.on=Le tri est effectu\u00E9 sur la propri\u00E9t\u00E9 '%1$s' entitycombobox.unknown.type=Objet de type inconnu errorUI.action.close=Fermer errorUI.message=Une erreur est survenue \! errorUI.title=Erreur... -fontsize.action.default.tip=Retour sur la taille par d\u00e9faut +fontsize.action.default.tip=Retour sur la taille par d\u00E9faut fontsize.action.down.tip=Diminuer la taille de la police fontsize.action.up.tip=Augmenter la taille de la police hidor.hideTip=Cacher hidor.showTip=Voir -i18neditor.empty.locales=< Aucune locale \u00e0 s\u00e9lectionner > +i18neditor.empty.locales=< Aucune locale \u00E0 s\u00E9lectionner > i18neditor.popup.title=Changer de langue -i18neditor.selected=Langue actuellement utilis\u00e9e \: %1$s +i18neditor.selected=Langue actuellement utilis\u00E9e \: %1$s i18neditor.unselected=Pour utiliser cette langue \: %1$s listSelector.hideList=Cacher la liste listSelector.showList=Afficher la liste @@ -74,8 +74,8 @@ numbereditor.7=7 numbereditor.8=8 numbereditor.9=9 -numbereditor.action.reset.tip=R\u00e9initialiser -numbereditor.action.show.tip=Afficher le pav\u00e9 num\u00e9rique +numbereditor.action.reset.tip=R\u00E9initialiser +numbereditor.action.show.tip=Afficher le pav\u00E9 num\u00E9rique numbereditor.clearAll=C numbereditor.clearOne=CE numbereditor.toggleSign=+/- Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractGenerateHelpMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -18,6 +18,7 @@ * ##%*/ package org.nuiton.jaxx.plugin; +import org.apache.commons.lang.StringUtils; import org.apache.maven.plugin.MojoFailureException; import org.nuiton.i18n.I18n; @@ -105,9 +106,10 @@ protected abstract void postDoAction(); @Override - protected boolean init() throws Exception { + protected void init() throws Exception { +// protected boolean init() throws Exception { - if (locales == null || locales.trim().isEmpty()) { + if (StringUtils.isEmpty(locales)) { throw new MojoFailureException("You must set the 'locales' property properly (was " + locales + ")."); } @@ -123,7 +125,7 @@ } if (tmp.isEmpty()) { - throw new MojoFailureException("you must set the 'locales' property."); + throw new MojoFailureException("No locale to react, you must set the 'locales' property."); } localesToTreate = tmp.toArray(new Locale[tmp.size()]); @@ -131,15 +133,24 @@ createDirectoryIfNecessary(getTargetDirectory()); +// return true; + } + + @Override + protected boolean checkSkip() { + if (!generateHelp) { + getLog().info("generateHelp flag is off, will skip goal."); + return false; + } return true; } @Override protected void doAction() throws Exception { - if (skipAction()) { - return; - } +// if (skipAction()) { +// return; +// } for (Locale locale : localesToTreate) { @@ -160,13 +171,13 @@ postDoAction(); } - protected boolean skipAction() { - if (!generateHelp) { - getLog().info("generateHelp flag is off, generate nothing."); - return true; - } - return false; - } +// protected boolean skipAction() { +// if (!generateHelp) { +// getLog().info("generateHelp flag is off, will skip goal."); +// return true; +// } +// return false; +// } public File getOutputHelpIds() { return outputHelpIds; Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/AbstractJaxxMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -18,14 +18,11 @@ * ##%*/ package org.nuiton.jaxx.plugin; -import org.apache.maven.model.Resource; import org.apache.maven.project.MavenProject; import org.nuiton.plugin.AbstractPlugin; import org.nuiton.util.FileUtil; import java.io.File; -import java.io.IOException; -import java.util.List; /** * Abstract Jaxx Mojo. @@ -82,7 +79,9 @@ @Override protected boolean checkPackaging() { - return project != null && !"pom".equals(project.getPackaging()) && !"site".equals(project.getPackaging()); + // not accept pom modules + return !acceptPackaging(Packaging.pom); +// return project != null && !"pom".equals(project.getPackaging()) && !"site".equals(project.getPackaging()); } @Override @@ -121,78 +120,12 @@ this.force = force; } - /** - * TODO-TC20091221 Should move this to AbstractPlugin - * Create the directory if necessary. - * - * @param dir the directory to create if not already existing - * @throws IOException if could not create the directory - */ - protected void createDirectoryIfNecessary(File dir) throws IOException { - if (!dir.exists()) { - if (verbose) { - getLog().info("mkdir " + dir); - } - boolean b = dir.mkdirs(); - if (!b) { - throw new IOException("could not create directory " + dir); - } - } - } - - //TODO-TC20091221 move this api to PluginHelper - public static boolean addResourceDir(File dir, MavenProject project, String... includes) { - List<?> resources = project.getResources(); - boolean added = addResourceDir(dir, project, resources, includes); - return added; - } - - //TODO-TC20091221 move this api to PluginHelper - public static boolean addTestResourceDir(File newresourceDir, MavenProject project, String... includes) { - List<?> resources = project.getTestResources(); - boolean added = addResourceDir(newresourceDir, project, resources, includes); - return added; - } - - //TODO-TC20091221 move this api to PluginHelper - public static boolean addResourceDir(File dir, MavenProject project, List<?> resources, String... includes) { - String newresourceDir = dir.getAbsolutePath(); - boolean shouldAdd = true; - for (Object o : resources) { - Resource r = (Resource) o; - if (!r.getDirectory().equals(newresourceDir)) { - continue; - } - - for (String i : includes) { - if (!r.getIncludes().contains(i)) { - r.addInclude(i); - } - } - shouldAdd = false; - break; - } - if (shouldAdd) { - Resource r = new Resource(); - r.setDirectory(newresourceDir); - for (String i : includes) { - if (!r.getIncludes().contains(i)) { - r.addInclude(i); - } - } - project.addResource(r); - } - return shouldAdd; - } - - class GetLastModifiedFileAction implements FileUtil.FileAction { protected File lastFile; public GetLastModifiedFileAction(File lastFile) { this.lastFile = lastFile; - } @Override Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpFilesMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -31,7 +31,7 @@ /** * Mojo to generate javax help files for your project. - * + * * @author chemit * @goal generate-help-files * @phase process-sources @@ -115,6 +115,7 @@ protected String indexFileName; protected String tocFileName; protected int touchedFiles; + protected File idsFile; /** * The help ids discovered. @@ -132,11 +133,13 @@ } @Override - public boolean init() throws Exception { + public void init() throws Exception { +// public boolean init() throws Exception { if (!generateHelp) { + return; +// return true; + } - return true; - } // check ressources checkResource(helpsetTemplate); checkResource(mapTemplate); @@ -149,68 +152,96 @@ tocFileName = helpsetName + "TOC.xml"; touchedFiles = 0; - boolean b = super.init(); - if (!b) { - return false; - } + super.init(); +// boolean b = super.init(); +// if (!b) { +// return false; +// } + // load ids from idsStore file - File idsFile; +// File idsFile; if (isForce()) { idsFile = getMergeHelpIdsStoreFile(); - if (!idsFile.exists()) { - if (isVerbose()) { - getLog().info("Force flag is on, but no helpIdStore-all to react at " + idsFile); - } - return true; - } +// if (!idsFile.exists()) { +// if (isVerbose()) { +// getLog().info("Force flag is on, but no helpIdStore-all to react at " + idsFile); +// } +// return true; +// } } else { idsFile = getHelpIdsStoreFile(); - if (!idsFile.exists()) { - if (isVerbose()) { - getLog().info("no helpIdStore to react at " + idsFile); - } - return true; - } +// if (!idsFile.exists()) { +// if (isVerbose()) { +// getLog().info("no helpIdStore to react at " + idsFile); +// } +// return true; +// } } + if (!idsFile.exists()) { + return; + } + helpIds = new SortedProperties(); // loading all ids Set<String> ids = loadHelpIds(idsFile); - if (ids.isEmpty()) { +// if (ids.isEmpty()) { +// +// // no ids detected +// if (isVerbose()) { +// getLog().info("No helpIds detected, will skip."); +// } +// return true; +// } - // no ids detected - if (isVerbose()) { - getLog().info("No helpIds detected, will skip."); - } - return true; - } - for (String id : ids) { String path = id.replaceAll("\\.", File.separator) + ".html"; helpIds.put(id, path); } - return true; +// return true; } @Override - protected boolean skipAction() { - boolean b = super.skipAction(); - if (!b) { + protected boolean checkSkip() { + boolean b = super.checkSkip(); + if (b) { + + if (!idsFile.exists()) { + // pas de fichier a traiter + if (isForce()) { + getLog().info("Force flag is on, but no helpIdStore-all to react at " + idsFile); + } else { + getLog().info("no helpIdStore to react at " + idsFile); + } + return false; + } if (helpIds == null || helpIds.isEmpty()) { getLog().info("No help ids to treate."); - return true; + return false; } } - return false; + return b; } // @Override +// protected boolean skipAction() { +// boolean b = super.skipAction(); +// if (!b) { +// if (helpIds == null || helpIds.isEmpty()) { +// getLog().info("No help ids to treate."); +// return true; +// } +// } +// return false; +// } + +// @Override // public void doAction() throws Exception { // // if (skipAction()) { Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -9,7 +9,7 @@ /** * Generate the help ids files from the previous jaxx generation. - * + * <p/> * Created: 22 déc. 2009 * * @author Tony Chemit <chemit@codelutin.com> Copyright Code Lutin @@ -25,17 +25,26 @@ */ public class GenerateHelpIdsMojo extends AbstractGenerateHelpMojo { + /** + * help ids to react. + */ + protected Set<String> helpIds; + @Override - public boolean init() throws Exception { + public void init() throws Exception { +// public boolean init() throws Exception { if (!generateHelp) { - return true; + return; +// return true; } - if (!super.init()) { - return false; - } + super.init(); +// if (!super.init()) { +// return false; +// } + // check there is some bundle if (getHelpIdsFilename() == null) { throw new MojoFailureException("you must set the 'helpIdStore' property."); @@ -44,27 +53,48 @@ throw new MojoFailureException("you must set the 'helpIdStoreAll' property."); } - return true; + helpIds = HelpRootCompiledObjectDecorator.getHelpIds(); + + // always clean helpIdsStore before all + cleanHelpIdsStore(); + +// return true; } @Override - public void doAction() throws Exception { + protected boolean checkSkip() { + boolean b = super.checkSkip(); + if (b) { - if (skipAction()) { - return; - } - - Set<String> helpIds = HelpRootCompiledObjectDecorator.getHelpIds(); - - if (helpIds.isEmpty()) { + if (helpIds.isEmpty()) { // if (isVerbose()) { - // no ids detected in this compilation round - getLog().info("No helpIds detected."); + // no ids detected in this compilation round + getLog().info("No help ids to treate, will skip goal."); // } - cleanHelpIdsStore(); - return; + return false; + } } + return b; + } + @Override + public void doAction() throws Exception { + +// if (skipAction()) { +// return; +// } + +// Set<String> helpIds = HelpRootCompiledObjectDecorator.getHelpIds(); +// +// if (helpIds.isEmpty()) { +//// if (isVerbose()) { +// // no ids detected in this compilation round +// getLog().info("No helpIds detected."); +//// } +// cleanHelpIdsStore(); +// return; +// } + // store current jaxx session detected help ids File idsStore = getHelpIdsStoreFile(); @@ -92,6 +122,7 @@ @Override protected void doActionForLocale(Locale locale, boolean isDefaultLocale, File source, String localePath) throws Exception { + // nothing to do specific to locale } @Override Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -45,12 +45,12 @@ public void setTargetDirectory(File targetDirectory) { } - @Override - public boolean init() throws Exception { +// @Override +// public boolean init() throws Exception { +// +// return true; +// } - return true; - } - @Override public void doAction() throws Exception { Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpSearchMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -59,19 +59,22 @@ protected String timestamp; @Override - public boolean init() throws Exception { - if (!generateHelp) { + public void init() throws Exception { +// public boolean init() throws Exception { + if (!generateHelp || !generateSearch) { - return true; + return; +// return true; } - if (!generateSearch) { -// getLog().info("Do not generate search."); - return true; - } +// if (!generateSearch) { +//// getLog().info("Do not generate search."); +// return true; +// } timestamp = "-" + System.currentTimeMillis(); - return super.init(); + super.init(); +// return super.init(); } @Override @@ -84,18 +87,30 @@ this.outputHelpSearch = targetDirectory; } - protected boolean skipAction() { - if (!generateHelp) { - getLog().info("generateHelp flag is off, generate nothing."); - return true; + @Override + protected boolean checkSkip() { + boolean b = super.checkSkip(); + if (b) { + if (!generateSearch) { + getLog().info("generateHelpsearch flag is off, will skip goal."); + return false; + } } - if (!generateSearch) { - getLog().info("generateHelpsearch flag is off, generate nothing."); - return true; - } - return false; + return b; } +// protected boolean skipAction() { +// if (!generateHelp) { +// getLog().info("generateHelp flag is off, generate nothing."); +// return true; +// } +// if (!generateSearch) { +// getLog().info("generateHelpsearch flag is off, generate nothing."); +// return true; +// } +// return false; +// } + @Override protected void doActionForLocale(Locale locale, boolean isDefaultLocale, File source, String localePath) throws Exception { @@ -165,7 +180,7 @@ protected void postDoAction() { // add resources to the project - addResourceDir(getTargetDirectory(), getProject(), "**/*"); + addResourceDir(getTargetDirectory(), "**/*"); } protected void generateSearchIndex(File source, File target, Locale locale) throws Exception { Modified: trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java =================================================================== --- trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/maven-jaxx-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateMojo.java 2009-12-29 17:45:48 UTC (rev 1704) @@ -289,7 +289,8 @@ @SuppressWarnings("unchecked") @Override - public boolean init() throws Exception { + public void init() throws Exception { +// public boolean init() throws Exception { fixCompileSourceRoots(); @@ -306,7 +307,8 @@ nofiles = files == null || files.length == 0; if (nofiles) { - return true; + return; +// return true; } cl = initClassLoader(getProject(), @@ -359,16 +361,25 @@ getLog().info("will parse " + file); } } +// return true; + } + + @Override + protected boolean checkSkip() { + if (nofiles) { + getLog().info("Nothing to generate - all files are up to date."); + return false; + } return true; } @Override public void doAction() throws Exception { - if (nofiles) { - getLog().info("Nothing to generate - all files are uo to date."); - return; - } +// if (nofiles) { +// getLog().info("Nothing to generate - all files are uo to date."); +// return; +// } getLog().info("Detects " + files.length + " modified jaxx file(s). "); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-12-23 09:14:47 UTC (rev 1703) +++ trunk/pom.xml 2009-12-29 17:45:48 UTC (rev 1704) @@ -9,7 +9,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>mavenpom</artifactId> - <version>1.1.3</version> + <version>1.1.4-SNAPSHOT</version> </parent> <artifactId>jaxx</artifactId> @@ -355,7 +355,7 @@ <projectId>jaxx</projectId> <lutinutil.version>1.1.0</lutinutil.version> - <i18n.version>1.0.1</i18n.version> + <i18n.version>1.0.2-SNAPSHOT</i18n.version> <jxlayer.version>3.0.3</jxlayer.version>