branch develop updated (410b9db -> 06037f2)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository tutti. See http://git.codelutin.com/tutti.git from 410b9db refactor new 709bf74 utilisation d'alias dans les configurations (cela simplifie l'ecriture des scripts de lancement) new 2d95c75 ajout du module de lancement new c5e667d ajout du module de mise à jour new fe6e892 mise en place des nouveaux modules et du packaging new 70df547 nettoyage scripts new df7ada6 lors de la suppression d'une base, nettoyage aussi des pieces jointes associées new b1e3b89 be able to change distro url new c1a7d2f launcher does not have the same version (and even should not be part of main build) new 6c1600f at release time ask for version of each module new cdf020f suppression du module launcher (c'est un proet à part) new 84d4aaf amelioration de la definition de distrourl new 818d7b6 utilisation de tutti-launcher (mais pas inclut comme dépendance du module ui) new c4735b6 copie du launcher au bon endroit new 1b67b84 fix application directory new c6126b5 amelioration du code de mise à jour new 008931c do not use bin classifier on launcher + fix updater dependency scope new 7f0238d improve code new e80e9eb add report null module + fix assembly new aec898a fix report path new 9ea20f1 fix readme new 35cd499 Do not delete i18n component when updates tutti new e2a97c5 improve updater code new 06fc14d remove code new 02e8bf4 improve assembly files new 416435e use tutti-launcher 1.0 new 06037f2 merge 6376 to develop The 26 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 06037f2be6a1944baf87856b903058a4cf64ba58 Merge: 410b9db 416435e Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 18:22:53 2015 +0100 merge 6376 to develop commit 416435ef854088c50585f8bb805b24d056e30d08 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:49:53 2015 +0100 use tutti-launcher 1.0 commit 02e8bf4f74ecceed42e9c018832494cbdc4af2e4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:58 2015 +0100 improve assembly files commit 06fc14d17a5cd48f16a74fe553e872ec0a2fa8cb Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:31 2015 +0100 remove code commit e2a97c583e1b0d778deca578fc84b63596dc1b24 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:06 2015 +0100 improve updater code commit 35cd49942498ee8fdbd61dc33fdc802a02860c18 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:10:25 2015 +0100 Do not delete i18n component when updates tutti commit 9ea20f1e8b983a051ee3775714e8a2d31a10cc10 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 13:34:00 2015 +0100 fix readme commit aec898aa651fc14f379b42cf94fe3487c24341c2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 13:33:44 2015 +0100 fix report path commit e80e9eb2525cf314e423de84562c2b311386df85 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 12:17:26 2015 +0100 add report null module + fix assembly commit 7f0238dad854d4eb80843c7d0cf07c8f2f86eb33 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 12:17:02 2015 +0100 improve code commit 008931c31b70b1a2795e32a83179941b4365d6e4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 11:48:48 2015 +0100 do not use bin classifier on launcher + fix updater dependency scope commit c6126b531306711070d0f5812fe4b7a9b5bb008e Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 11:35:43 2015 +0100 amelioration du code de mise à jour commit 1b67b843efa202f7ffaf6fd4f4217c7d49442346 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 09:57:46 2015 +0100 fix application directory commit c4735b6eb39a3a8b3583b465a4507ed58c0b37f0 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 17:09:10 2015 +0100 copie du launcher au bon endroit commit 818d7b6b36d4d64bf3f60006b433fc7906010f7c Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:21:20 2015 +0100 utilisation de tutti-launcher (mais pas inclut comme dépendance du module ui) commit 84d4aaf9f1ad027bbbb3c9f61726ac4a962cbb69 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:20:03 2015 +0100 amelioration de la definition de distrourl commit cdf020f1f31fd063d2266fbcf02fec7c63840ca9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:19:21 2015 +0100 suppression du module launcher (c'est un proet à part) commit 6c1600fdd74903e4cb0adfbf796a6f7ffde59d82 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:54:55 2015 +0100 at release time ask for version of each module commit c1a7d2f030dda697073b9385d7dc718bd795638b Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:40:17 2015 +0100 launcher does not have the same version (and even should not be part of main build) commit b1e3b896c565a9829eb819344d1b1ba132bda907 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:36:48 2015 +0100 be able to change distro url commit df7ada6b2d109d8acde4e5fbaa187c37b8b4affc Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 14:12:10 2015 +0100 lors de la suppression d'une base, nettoyage aussi des pieces jointes associées commit 70df5471167efefa58c423695a70f1a73335b6b0 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 14:11:44 2015 +0100 nettoyage scripts commit fe6e892e3fdd24aaaca9268c97f4fbb028712e9c Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:45:20 2015 +0100 mise en place des nouveaux modules et du packaging commit c5e667d194ae4b7e54e4951d703eb329d912279b Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:39:42 2015 +0100 ajout du module de mise à jour commit 2d95c75698a260aa35e818b56796ff3b092116e6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:39:20 2015 +0100 ajout du module de lancement commit 709bf74105b48842dbff3374de10258163dcafb2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 11:09:07 2015 +0100 utilisation d'alias dans les configurations (cela simplifie l'ecriture des scripts de lancement) Summary of changes: pom.xml | 22 ++ src/update/tutti-application.properties | 15 +- .../java/fr/ifremer/tutti/TuttiConfiguration.java | 6 + .../LICENSE.txt | 0 .../README.txt | 0 tutti-ui-swing-updater/pom.xml | 70 +++++ .../tutti/ui/swing/updater/DeleteHelper.java | 143 +++++++++ .../fr/ifremer/tutti/ui/swing/updater/Module.java | 34 ++ .../fr/ifremer/tutti/ui/swing/updater/Updater.java | 344 +++++++++++++++++++++ .../src/main/resources/update_runtime.bat | 31 ++ .../src/main/resources/update_runtime.sh | 36 +++ tutti-ui-swing/pom.xml | 76 +++++ .../{help.xml => full-linux-component.xml} | 43 +-- .../src/main/assembly/full-linux-i586.xml | 5 +- .../src/main/assembly/full-linux-x64.xml | 5 +- ...ull-component.xml => full-shared-component.xml} | 86 ++++-- .../src/main/assembly/full-windows-component.xml | 64 ++-- .../src/main/assembly/full-windows-i586.xml | 5 +- .../src/main/assembly/full-windows-x64.xml | 5 +- tutti-ui-swing/src/main/assembly/full/README.txt | 4 +- .../src/main/assembly/full/linux/tutti-sanity.sh | 10 + .../src/main/assembly/full/linux/tutti.sh | 10 + .../src/main/assembly/full/tutti-sanity.bat | 44 --- .../src/main/assembly/full/tutti-sanity.sh | 41 --- tutti-ui-swing/src/main/assembly/full/tutti.bat | 44 --- tutti-ui-swing/src/main/assembly/full/tutti.sh | 41 --- .../main/assembly/full/windows/tutti-sanity.bat | 3 + .../src/main/assembly/launcher/version.appup | 1 + tutti-ui-swing/src/main/assembly/min/launch.bat | 10 - tutti-ui-swing/src/main/assembly/min/launch.sh | 15 - .../min/launcher.properties} | 17 +- tutti-ui-swing/src/main/assembly/min/update.bat | 84 ----- tutti-ui-swing/src/main/assembly/min/update.sh | 74 ----- .../main/assembly/{full => }/report/version.appup | 0 tutti-ui-swing/src/main/assembly/standalone.xml | 6 +- .../ui/swing/TuttiApplicationUpdaterCallBack.java | 8 - 36 files changed, 929 insertions(+), 473 deletions(-) copy tutti-ichtyometer/README.txt => tutti-ui-swing-updater/LICENSE.txt (100%) copy {tutti-ichtyometer => tutti-ui-swing-updater}/README.txt (100%) create mode 100644 tutti-ui-swing-updater/pom.xml create mode 100644 tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/DeleteHelper.java create mode 100644 tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java create mode 100644 tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java create mode 100644 tutti-ui-swing-updater/src/main/resources/update_runtime.bat create mode 100644 tutti-ui-swing-updater/src/main/resources/update_runtime.sh copy tutti-ui-swing/src/main/assembly/{help.xml => full-linux-component.xml} (59%) rename tutti-ui-swing/src/main/assembly/{tutti-full-component.xml => full-shared-component.xml} (69%) copy tutti-ichtyometer/src/main/assembly/tools.xml => tutti-ui-swing/src/main/assembly/full-windows-component.xml (52%) create mode 100644 tutti-ui-swing/src/main/assembly/full/linux/tutti-sanity.sh create mode 100644 tutti-ui-swing/src/main/assembly/full/linux/tutti.sh delete mode 100644 tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat delete mode 100644 tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh delete mode 100644 tutti-ui-swing/src/main/assembly/full/tutti.bat delete mode 100644 tutti-ui-swing/src/main/assembly/full/tutti.sh create mode 100644 tutti-ui-swing/src/main/assembly/full/windows/tutti-sanity.bat create mode 100644 tutti-ui-swing/src/main/assembly/launcher/version.appup delete mode 100644 tutti-ui-swing/src/main/assembly/min/launch.bat delete mode 100755 tutti-ui-swing/src/main/assembly/min/launch.sh copy tutti-ui-swing/src/main/{filtered-resources/tutti.config => assembly/min/launcher.properties} (67%) delete mode 100644 tutti-ui-swing/src/main/assembly/min/update.bat delete mode 100644 tutti-ui-swing/src/main/assembly/min/update.sh rename tutti-ui-swing/src/main/assembly/{full => }/report/version.appup (100%) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 709bf74105b48842dbff3374de10258163dcafb2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 11:09:07 2015 +0100 utilisation d'alias dans les configurations (cela simplifie l'ecriture des scripts de lancement) --- .../src/main/java/fr/ifremer/tutti/TuttiConfiguration.java | 6 ++++++ tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat | 2 +- tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh | 2 +- tutti-ui-swing/src/main/assembly/full/tutti.bat | 2 +- tutti-ui-swing/src/main/assembly/full/tutti.sh | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfiguration.java b/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfiguration.java index d042a24..f376f14 100644 --- a/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfiguration.java +++ b/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfiguration.java @@ -139,6 +139,12 @@ public class TuttiConfiguration extends ApplicationConfiguration { applicationConfig.setConfigFileName(file); + applicationConfig.addAlias("--launch-mode", "--option", TuttiConfigurationOption.LAUNCH_MODE.getKey()); + applicationConfig.addAlias("--basedir", "--option", TuttiConfigurationOption.BASEDIR.getKey()); + applicationConfig.addAlias("--config-path", "--option", "config.path"); + applicationConfig.addAlias("--db-sanity", "--option", TuttiConfigurationOption.DB_SANITY.getKey()); + + try { applicationConfig.parse(args); diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat index 33a3567..7b1347d 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat +++ b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat @@ -21,7 +21,7 @@ call update.bat del update.bat if exist "tutti.config" copy tutti.config tutti echo Allegro Campaign ${project.version} is starting... -call tutti\launch.bat --option tutti.launch.mode full --option tutti.basedir %TUTTI_BASEDIR% --option tutti.persistence.db.sanity true +call tutti\launch.bat --launch-mode full --basedir %TUTTI_BASEDIR% --db-sanity true if errorlevel 89 goto deletedb if errorlevel 88 goto start diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh index 8c2f3bb..b1f164d 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh @@ -23,7 +23,7 @@ while true; do cp -rfv $TUTTI_BASEDIR/tutti.config $TUTTI_HOME fi echo "Allegro Campaign ${project.version} is starting..." - ./tutti/launch.sh --option tutti.launch.mode full --option tutti.basedir $TUTTI_BASEDIR --option tutti.persistence.db.sanity true + ./tutti/launch.sh --launch-mode full --basedir $TUTTI_BASEDIR --db-sanity true exitcode=$? if [ "$exitcode" -eq "89" ]; then diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.bat b/tutti-ui-swing/src/main/assembly/full/tutti.bat index 5e6c460..cb9396f 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti.bat +++ b/tutti-ui-swing/src/main/assembly/full/tutti.bat @@ -21,7 +21,7 @@ call update.bat del update.bat if exist "tutti.config" copy tutti.config tutti echo Allegro Campaign ${project.version} is starting... -call tutti\launch.bat --option tutti.launch.mode full --option tutti.basedir %TUTTI_BASEDIR% +call tutti\launch.bat --launch-mode full --basedir %TUTTI_BASEDIR% if errorlevel 89 goto deletedb if errorlevel 88 goto start diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.sh b/tutti-ui-swing/src/main/assembly/full/tutti.sh index cf8a578..1d29184 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti.sh @@ -23,7 +23,7 @@ while true; do cp -rfv $TUTTI_BASEDIR/tutti.config $TUTTI_HOME fi echo "Allegro Campaign ${project.version} is starting..." - ./tutti/launch.sh --option tutti.launch.mode full --option tutti.basedir $TUTTI_BASEDIR + ./tutti/launch.sh --launch-mode full --basedir $TUTTI_BASEDIR exitcode=$? if [ "$exitcode" -eq "89" ]; then -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 2d95c75698a260aa35e818b56796ff3b092116e6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:39:20 2015 +0100 ajout du module de lancement --- tutti-ui-swing-launcher/LICENSE.txt | 0 tutti-ui-swing-launcher/README.txt | 0 tutti-ui-swing-launcher/pom.xml | 179 ++++++++++++++++ .../src/main/assembly/launcher.xml | 24 +++ .../tutti/ui/swing/launcher/JavaCommand.java | 163 ++++++++++++++ .../ifremer/tutti/ui/swing/launcher/Launcher.java | 236 +++++++++++++++++++++ .../ui/swing/launcher/LauncherProperties.java | 93 ++++++++ .../src/main/resources/splash.bmp | Bin 0 -> 539082 bytes .../src/main/resources/tutti.ico | Bin 0 -> 32038 bytes 9 files changed, 695 insertions(+) diff --git a/tutti-ui-swing-launcher/LICENSE.txt b/tutti-ui-swing-launcher/LICENSE.txt new file mode 100644 index 0000000..e69de29 diff --git a/tutti-ui-swing-launcher/README.txt b/tutti-ui-swing-launcher/README.txt new file mode 100644 index 0000000..e69de29 diff --git a/tutti-ui-swing-launcher/pom.xml b/tutti-ui-swing-launcher/pom.xml new file mode 100644 index 0000000..b9195e9 --- /dev/null +++ b/tutti-ui-swing-launcher/pom.xml @@ -0,0 +1,179 @@ +<!-- + #%L + Tutti :: UI Launcher + %% + Copyright (C) 2015 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses />. + #L% +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>fr.ifremer</groupId> + <artifactId>tutti</artifactId> + <version>3.12-SNAPSHOT</version> + </parent> + + <groupId>fr.ifremer.tutti</groupId> + <artifactId>tutti-ui-swing-launcher</artifactId> + + <name>Tutti :: UI Launcher</name> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <target.fileName>tutti.exe</target.fileName> + + <!-- generate license bundled files --> + <license.generateBundle>true</license.generateBundle> + <license.bundleThirdPartyPath>META-INF/tutti-THIRD-PARTY.txt</license.bundleThirdPartyPath> + <license.bundleLicensePath>META-INF/tutti-LICENSE.txt</license.bundleLicensePath> + + </properties> + + <dependencies> + <!-- please, no dependency --> + </dependencies> + + <build> + + <plugins> + + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <mainClass>fr.ifremer.tutti.ui.swing.launcher.Launcher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>com.akathist.maven.plugins.launch4j</groupId> + <artifactId>launch4j-maven-plugin</artifactId> + <executions> + <execution> + <id>create-launcher</id> + <phase>package</phase> + <goals> + <goal>launch4j</goal> + </goals> + <configuration> + <headerType>gui</headerType> + <jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar> + <outfile>${project.build.directory}/${target.fileName}</outfile> + <downloadUrl>http://java.com/download</downloadUrl> + <chdir>.</chdir> + <classPath> + <mainClass>fr.ifremer.tutti.ui.swing.launcher.Launcher</mainClass> + <preCp>anything</preCp> + </classPath> + <splash> + <file>src/main/resources/splash.bmp</file> + <timeout>3</timeout> + <waitForWindow>false</waitForWindow> + </splash> + <icon>src/main/resources/tutti.ico</icon> + <customProcName>true</customProcName> + <jre> + <path>jre</path> + <jdkPreference>preferJre</jdkPreference> + <maxHeapSize>20</maxHeapSize> + </jre> + <versionInfo> + <fileVersion>0.0.0.0</fileVersion> + <txtFileVersion>${project.version}</txtFileVersion> + <fileDescription>${project.name}</fileDescription> + <copyright>${project.inceptionYear} - ${project.organization.name}</copyright> + <productVersion>0.0.0.0</productVersion> + <txtProductVersion>${project.version}</txtProductVersion> + <productName>${project.parent.name}</productName> + <companyName>${project.organization.name}</companyName> + <internalName>Tutti Launcher</internalName> + <originalFilename>${target.fileName}</originalFilename> + </versionInfo> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>attach-artifact</goal> + </goals> + <configuration> + <artifacts> + <artifact> + <file>${project.build.directory}/${target.fileName}</file> + <type>zip</type> + <classifier>bin</classifier> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + + <profiles> + <profile> + <id>assembly-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <defaultGoal>package</defaultGoal> + <plugins> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <attach>true</attach> + <descriptors> + <descriptor>src/main/assembly/launcher.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> + diff --git a/tutti-ui-swing-launcher/src/main/assembly/launcher.xml b/tutti-ui-swing-launcher/src/main/assembly/launcher.xml new file mode 100644 index 0000000..acfabc7 --- /dev/null +++ b/tutti-ui-swing-launcher/src/main/assembly/launcher.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + <id>bin</id> + + <formats> + <format>zip</format> + </formats> + + <fileSets> + + <fileSet> + <directory>target</directory> + <outputDirectory/> + <includes> + <include>${target.fileName}</include> + </includes> + </fileSet> + + </fileSets> +</assembly> diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java new file mode 100644 index 0000000..267ba3d --- /dev/null +++ b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java @@ -0,0 +1,163 @@ +package fr.ifremer.tutti.ui.swing.launcher; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * Created on 1/3/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.12 + */ +public class JavaCommand { + + private static final String DEBUG_JAVA_OPTS = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=%s"; + + static JavaCommand create(Path basedir, int debugPort) { + return new JavaCommand(basedir, debugPort); + } + + static JavaCommand create(Path basedir) { + return new JavaCommand(basedir, 8000); + } + + protected JavaCommand(Path javaCommand, int debugPort) { + this.javaCommand = javaCommand; + this.debugPort = debugPort; + this.preJarArguments = new ArrayList<>(); + this.postJarArguments = new ArrayList<>(); + } + + private final int debugPort; + + private final Path javaCommand; + + private final List<String> preJarArguments; + + private final List<String> postJarArguments; + + private Path jarPath; + + private boolean inheritIO; + + private boolean debug; + + private Path logFile; + + public JavaCommand setInheritIO(boolean inheritIO) { + this.inheritIO = inheritIO; + return this; + } + + public JavaCommand setDebug(boolean debug) { + this.debug = debug; + return this; + } + + public JavaCommand setJarPath(Path jarPath) { + this.jarPath = jarPath; + return this; + } + + public JavaCommand setLogFile(Path logFile) { + this.logFile = logFile; + return this; + } + + public JavaCommand addArgument(Object argument) { + + List<String> whereToAdd; + if (jarPath == null) { + whereToAdd = preJarArguments; + + } else { + whereToAdd = postJarArguments; + } + + whereToAdd.add(argument.toString()); + + return this; + } + + public JavaCommand addArguments(Object argument, Object... arguments) { + + List<String> whereToAdd; + if (jarPath == null) { + whereToAdd = preJarArguments; + + } else { + whereToAdd = postJarArguments; + } + + whereToAdd.add(argument.toString()); + + for (Object argument1 : arguments) { + whereToAdd.add(argument1.toString()); + } + + return this; + } + + public JavaCommand addArguments(Collection<?> arguments) { + + List<String> whereToAdd; + if (jarPath == null) { + whereToAdd = preJarArguments; + + } else { + whereToAdd = postJarArguments; + } + + for (Object argument : arguments) { + whereToAdd.add(argument.toString()); + } + + return this; + } + + public Launcher.ExitCode execute() throws IOException, InterruptedException { + + if (jarPath == null) { + + throw new IllegalStateException("No jarPath given, can't execute."); + + } + + List<String> command = new ArrayList<>(); + + command.add(javaCommand.toString()); + command.addAll(preJarArguments); + if (debug) { + command.add(String.format(DEBUG_JAVA_OPTS, debugPort)); + } + command.add("-jar"); + command.add(jarPath.toString()); + command.addAll(postJarArguments); + + ProcessBuilder pb = new ProcessBuilder(command); + + if (inheritIO) { + + pb.inheritIO(); + + } + + if (logFile != null) { + + File updaterLogFile = logFile.toFile(); + pb.redirectOutput(ProcessBuilder.Redirect.to(updaterLogFile)); + pb.redirectError(ProcessBuilder.Redirect.appendTo(updaterLogFile)); + + } + + System.out.println("Starts java command: " + command); + + int exitCode = pb.start().waitFor(); + return Launcher.ExitCode.valueOf(exitCode); + + } +} diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java new file mode 100644 index 0000000..7d57934 --- /dev/null +++ b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java @@ -0,0 +1,236 @@ +package fr.ifremer.tutti.ui.swing.launcher; + +import javax.swing.JOptionPane; +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * Launcher application that do post-update logic, launch application and listen to exit code. + * + * @author Tony Chemit (chemit@codelutin.com) + * @since 3.12 + */ +public class Launcher { + + public static final String APPLICATION_LANCHER_TITLE = "Tutti UI Launcher"; + + public static final String APPLICATION_DIR = "tutti"; + + public static final String DATA_DIR = "data"; + + public static final String UPDATER_JAR = "updater.jar"; + + public static final String UPDATER_LOGFILE = "updater.log"; + + public static final String FULL_LAUNCH_MODE = "full"; + + public static final String DEBUG_ARG = "--debug"; + + private final Path basedir; + + private final List<String> arguments; + + private final Path javaCommand; + + private final boolean debugMode; + + public static void main(String... args) { + + boolean windowsOs = System.getProperty("os.name").startsWith("Windows"); + + String javaCommandFilename = windowsOs ? "java.exe" : "java"; + + Launcher launcher = new Launcher(javaCommandFilename, args); + launcher.execute(); + + } + + public Launcher(String javaCommandFilename, String... args) { + + this.basedir = Paths.get(System.getProperty("user.dir")); + + this.javaCommand = basedir.resolve("jre").resolve("bin").resolve(javaCommandFilename); + + List<String> fullArguments = Arrays.asList(args); + + this.debugMode = fullArguments.remove(DEBUG_ARG); + + this.arguments = Collections.unmodifiableList(fullArguments); + + } + + public void execute() { + + try { + + ExitCode exitCode; + + do { + + // call update process + exitCode = executeUpdate(); + + if (exitCode == ExitCode.RUNTIME_UPDATE) { + + // if updater has detected runtime update, stop now + System.exit(exitCode.getExitCode()); + + } + + if (exitCode != ExitCode.NORMAL) { + + // update fails + throw new RuntimeException("Tutti Updater has encountered a problem, program stopped.\nPlease check " + UPDATER_LOGFILE); + + } + + // launch application + exitCode = executeApplication(); + + if (exitCode == ExitCode.DELETE_DB) { + deleteDb(); + } + + } while (exitCode.isRelaunch()); + + if (exitCode != ExitCode.NORMAL) { + + // show exit code + throw new RuntimeException("exit code = " + exitCode); + + } + + } catch (Exception ex) { + JOptionPane.showMessageDialog(null, ex.toString(), APPLICATION_LANCHER_TITLE, JOptionPane.ERROR_MESSAGE); + } + + } + + protected ExitCode executeUpdate() throws Exception { + + Path updatePath = basedir.resolve(APPLICATION_DIR).resolve(UPDATER_JAR); + Path updateExecPath = basedir.resolve(UPDATER_JAR); + Files.copy(updatePath, updateExecPath, StandardCopyOption.REPLACE_EXISTING); + + Path logfile = basedir.resolve(UPDATER_LOGFILE); + + try { + + JavaCommand program = JavaCommand + .create(javaCommand) + .setJarPath(updateExecPath) + .setLogFile(logfile); + + ExitCode exitCode = program.execute(); + return exitCode; + + } finally { + + Files.delete(updateExecPath); + + } + + } + + protected ExitCode executeApplication() throws Exception { + + LauncherProperties launcherProperties = new LauncherProperties(basedir); + launcherProperties.load(); + + JavaCommand program = JavaCommand + .create(javaCommand) + .setDebug(debugMode) + .setInheritIO(true) + .addArguments(launcherProperties.getJavaOptions()) + .addArgument("-Dtutti.log.file=" + launcherProperties.getLogFile().toString()) + .setJarPath(launcherProperties.getJarFile()) + .addArguments("--launch-mode", FULL_LAUNCH_MODE) + .addArguments("--basedir", basedir.toString()) +// .addArgument("--config.path", basedir.toString()) + .addArgument(arguments); + + ExitCode exitCode = program.execute(); + return exitCode; + + } + + protected void deleteDb() throws Exception { + + Path dataPath = basedir.resolve(DATA_DIR); + Files.walkFileTree(dataPath.resolve("db"), new RecursiveDeleteFileVisitor()); + Files.walkFileTree(dataPath.resolve("dbcache"), new RecursiveDeleteFileVisitor()); + Files.walkFileTree(dataPath.resolve("dbconf"), new RecursiveDeleteFileVisitor()); + + } + + private class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + Files.deleteIfExists(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + Files.deleteIfExists(dir); + return FileVisitResult.CONTINUE; + } + + } + + /** + * Created on 1/3/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.12 + */ + public static enum ExitCode { + + NORMAL(0, false), // Normal exist code, always quit program + UPDATE(88, true), // When an update was found, will relaunch application + DELETE_DB(89, true), // When a db deletion is required, will relaunch application + RUNTIME_UPDATE(90, false), // When a runtime update found, quit program to update runtime + UNKNOWN(-1, false); // For any other exit code, will always quit program + + private final int exitCode; + + private final boolean relaunch; + + ExitCode(int exitCode, boolean relaunch) { + this.exitCode = exitCode; + this.relaunch = relaunch; + } + + public int getExitCode() { + return exitCode; + } + + public boolean isRelaunch() { + return relaunch; + } + + public static ExitCode valueOf(int code) { + + ExitCode result = UNKNOWN; + + for (ExitCode exitCode : ExitCode.values()) { + if (code == exitCode.getExitCode()) { + result = exitCode; + } + } + + return result; + + } + } +} diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java new file mode 100644 index 0000000..e0a3a88 --- /dev/null +++ b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java @@ -0,0 +1,93 @@ +package fr.ifremer.tutti.ui.swing.launcher; + +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +/** + * Created on 1/3/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.12 + */ +public class LauncherProperties { + + public static final String LAUNCHER_PROPERTIES = "launcher.properties"; + + public static final String LAUNCHER_PROPERTIES_JAR = "JAR"; + + public static final String LAUNCHER_PROPERTIES_LOGFILE = "LOGFILE"; + + public static final String LAUNCHER_PROPERTIES_JAVA_OPTS = "JAVA_OPTS"; + + private final Path basedir; + + Properties launcherProperties; + + public LauncherProperties(Path basedir) { + this.basedir = basedir; + } + + public void load() throws IOException { + + // application launcher properties + Path applicationFile = basedir.resolve(Launcher.APPLICATION_DIR).resolve(LAUNCHER_PROPERTIES); + // local launcher properties + Path localFile = basedir.resolve(LAUNCHER_PROPERTIES); + + if (!(Files.exists(localFile) || Files.exists(applicationFile))) { + + throw new IOException("Could not find " + LAUNCHER_PROPERTIES); + + } + + Properties p1 = new Properties(); + if (Files.isReadable(applicationFile)) { + p1.load(new FileReader(applicationFile.toFile())); + } + + launcherProperties = new Properties(p1); + if (Files.isReadable(localFile)) { + launcherProperties.load(new FileReader(localFile.toFile())); + } + } + + public Path getJarFile() { + + String jarFileName = launcherProperties.getProperty(LAUNCHER_PROPERTIES_JAR); + Path jarFile = basedir.resolve(jarFileName); + return jarFile; + + } + + public Path getLogFile() { + + String logFileName = launcherProperties.getProperty(LAUNCHER_PROPERTIES_LOGFILE); + Path logFile = basedir.resolve(logFileName); + return logFile; + + } + + public List<String> getJavaOptions() { + + List<String> javaOptions = new ArrayList<>(); + String javaOpts = launcherProperties.getProperty(LAUNCHER_PROPERTIES_JAVA_OPTS); + if (!(javaOpts == null || javaOpts.trim().isEmpty())) { + String[] javaOptsArray = javaOpts.replaceAll("\"", "").split(" "); + for (String opt : javaOptsArray) { + if (!(opt == null || opt.trim().isEmpty())) { + javaOptions.add(opt); + } + } + } + + return javaOptions; + + } + + +} diff --git a/tutti-ui-swing-launcher/src/main/resources/splash.bmp b/tutti-ui-swing-launcher/src/main/resources/splash.bmp new file mode 100644 index 0000000..3d197f4 Binary files /dev/null and b/tutti-ui-swing-launcher/src/main/resources/splash.bmp differ diff --git a/tutti-ui-swing-launcher/src/main/resources/tutti.ico b/tutti-ui-swing-launcher/src/main/resources/tutti.ico new file mode 100644 index 0000000..3b36647 Binary files /dev/null and b/tutti-ui-swing-launcher/src/main/resources/tutti.ico differ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit c5e667d194ae4b7e54e4951d703eb329d912279b Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:39:42 2015 +0100 ajout du module de mise à jour --- tutti-ui-swing-updater/LICENSE.txt | 0 tutti-ui-swing-updater/README.txt | 0 tutti-ui-swing-updater/pom.xml | 70 +++++ .../fr/ifremer/tutti/ui/swing/updater/Updater.java | 293 +++++++++++++++++++++ .../src/main/resources/update_runtime.bat | 31 +++ .../src/main/resources/update_runtime.sh | 36 +++ 6 files changed, 430 insertions(+) diff --git a/tutti-ui-swing-updater/LICENSE.txt b/tutti-ui-swing-updater/LICENSE.txt new file mode 100644 index 0000000..e69de29 diff --git a/tutti-ui-swing-updater/README.txt b/tutti-ui-swing-updater/README.txt new file mode 100644 index 0000000..e69de29 diff --git a/tutti-ui-swing-updater/pom.xml b/tutti-ui-swing-updater/pom.xml new file mode 100644 index 0000000..4d503b7 --- /dev/null +++ b/tutti-ui-swing-updater/pom.xml @@ -0,0 +1,70 @@ +<!-- + #%L + SIH Allegro ObsDeb :: UI Launcher + %% + Copyright (C) 2013 - 2014 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses />. + #L% +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>fr.ifremer</groupId> + <artifactId>tutti</artifactId> + <version>3.12-SNAPSHOT</version> + </parent> + + <groupId>fr.ifremer.tutti</groupId> + <artifactId>tutti-ui-swing-updater</artifactId> + + <name>Tutti :: UI Updater</name> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <!-- generate license bundled files --> + <license.generateBundle>true</license.generateBundle> + <license.bundleThirdPartyPath>META-INF/tutti-THIRD-PARTY.txt</license.bundleThirdPartyPath> + <license.bundleLicensePath>META-INF/tutti-LICENSE.txt</license.bundleLicensePath> + + </properties> + + <dependencies> + <!-- please, no dependency --> + </dependencies> + + <build> + + <plugins> + + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <mainClass>fr.ifremer.tutti.ui.swing.updater.Updater</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + + </plugins> + + </build> + +</project> + diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java new file mode 100644 index 0000000..54b05b4 --- /dev/null +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java @@ -0,0 +1,293 @@ +package fr.ifremer.tutti.ui.swing.updater; + +import javax.swing.JOptionPane; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.PathMatcher; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author Ludovic Pecquot <ludovic.pecquot@e-is.pro> + */ +public class Updater { + + public static final String APPLICATION_UPDATER_TITLE = "Allegro Campagne UI Updater"; + + public static final String NEW_DIR = "NEW"; + + public static final String OLD_DIR = "OLD"; + + public static final String JRE_DIR = "jre"; + + public static final String LAUNCHER_DIR = "launcher"; + + public static final String APPLICATION_DIR = "tutti"; + + public static final String I18N_DIR = "i18n"; + + public static final String HELP_DIR = "help"; + + public static final String REPORT_DIR = "report"; + + public static final String ICHTYOMETER_DIR = "report"; + + public static final String UPDATE_RUNTIME_CMD = "update_runtime"; + + public static final String BATCH_WINDOWS_EXT = ".bat"; + + public static final String BATCH_UNIX_EXT = ".sh"; + + public static final String VERSION_FILE = "version.appup"; + + public static final int NORMAL_EXIT_CODE = 0; + + public static final int ERROR_EXIT_CODE = 1; + + public static final int RUNTIME_UPDATE_EXIT_CODE = 90; + + private final Path baseDir; + + private final String backupDate; + + private final boolean windowsOS; + + public static void main(String... args) { + + // Instantiate the launcher + Updater updater = new Updater(); + int exitCode = updater.execute(); + + // exit + System.exit(exitCode); + + } + + public Updater() { + + // Get the current directory where application has been launched + baseDir = Paths.get(System.getProperty("user.dir")); + + // Compute the date to create backup directories + Date now = new Date(); + DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); + backupDate = df.format(now); + + windowsOS = System.getProperty("os.name").startsWith("Windows"); + + } + + public int execute() { + + int exitCode; + + try { + + // Check runtime update (jre or launcher) + boolean runtimeUpdate = checkRuntimeUpdate(); + + if (runtimeUpdate) { + + exitCode = RUNTIME_UPDATE_EXIT_CODE; + + } else { + + // Launch update + launchUpdate(); + + exitCode = NORMAL_EXIT_CODE; + + } + + } catch (Exception ex) { + + ex.printStackTrace(); + exitCode = ERROR_EXIT_CODE; + + } + + return exitCode; + + } + + protected boolean checkRuntimeUpdate() throws Exception { + + String scriptFilename = UPDATE_RUNTIME_CMD + (windowsOS ? BATCH_WINDOWS_EXT : BATCH_UNIX_EXT); + + Path runtimeUpdater = baseDir.resolve(scriptFilename); + + Files.deleteIfExists(runtimeUpdater); + + boolean mustUpdateRuntime = false; + + if (Files.isDirectory(baseDir.resolve(NEW_DIR).resolve(JRE_DIR)) + || Files.isDirectory(baseDir.resolve(NEW_DIR).resolve(LAUNCHER_DIR))) { + + // A new jre or/and a new launcher is available, so generate the script + URL resource = getClass().getResource("/" + scriptFilename); + + try (InputStream stream = resource.openStream()) { + + Files.copy(stream, runtimeUpdater, StandardCopyOption.REPLACE_EXISTING); + + } + + String message = String.format("Runtime updates available.\nYou must execute '%s' manually to apply new runtime.", runtimeUpdater.getFileName()); + System.out.println(message); + JOptionPane.showMessageDialog(null, message); + mustUpdateRuntime = true; + + } + + return mustUpdateRuntime; + + } + + protected void launchUpdate() throws IOException { + + // Compute the date to create backup directories + Date now = new Date(); + + System.out.println("updater started at " + now.toString()); + + updateModule(baseDir, APPLICATION_DIR); + updateModule(baseDir, I18N_DIR); + updateModule(baseDir, HELP_DIR); + updateModule(baseDir, REPORT_DIR); + updateModule(baseDir, ICHTYOMETER_DIR); + + // Cleaning process + cleanObsoleteFiles(); + cleanPath(baseDir.resolve(NEW_DIR)); + + System.out.println("updater ended at " + new Date().toString()); + + } + + private void updateModule(Path basePath, String moduleName) throws IOException { + + // Update a single module. moduleName corresponds to the name of the directory inside the basePath + Path modulePath = basePath.resolve(moduleName); + Path moduleNewPath = basePath.resolve(NEW_DIR).resolve(moduleName); + + if (Files.isDirectory(moduleNewPath)) { + String newVersion = getVersion(moduleNewPath); + + // Backup existing module + if (Files.isDirectory(modulePath)) { + String oldVersion = getVersion(modulePath); + Path moduleOldPath = basePath.resolve(OLD_DIR).resolve(String.format("%s-%s-%s", moduleName, oldVersion, backupDate)); + System.out.println(String.format("backup %s %s to %s", moduleName, oldVersion, moduleOldPath.toString())); + if (!Files.isDirectory(basePath.resolve(OLD_DIR))) { + Files.createDirectory(basePath.resolve(OLD_DIR)); + } + Files.move(modulePath, moduleOldPath); + } + + // Installing new module + System.out.println(String.format("install %s %s", moduleName, newVersion)); + Files.move(moduleNewPath, modulePath, StandardCopyOption.REPLACE_EXISTING); + } + } + + private String getVersion(Path path) throws IOException { + + // Return the version of a module from version.appup file + Path versionFile = path.resolve(VERSION_FILE); + List<String> lines = Files.readAllLines(versionFile, StandardCharsets.UTF_8); + if (lines == null || lines.isEmpty()) { + throw new IOException(versionFile.toString() + " is empty"); + } + return lines.get(0); + } + + private void cleanPath(Path path) throws IOException { + if (Files.isDirectory(path)) { + Files.walkFileTree(path, new RecursiveDeleteFileVisitor()); + } + } + + private void cleanPath(Path path, String glob) throws IOException { + if (Files.isDirectory(path)) { + Files.walkFileTree(path, new RecursiveDeleteFileVisitor(glob)); + } + } + + private void cleanObsoleteFiles() throws IOException { + + if (windowsOS) { + + // Delete obsolete batch files + Files.deleteIfExists(baseDir.resolve("tutti.bat")); + Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("launch.bat")); + + // Delete non Windows files + cleanPath(baseDir, "*" + BATCH_UNIX_EXT); + } else { + + // Delete obsolete script files + Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("launch.sh")); + + // Delete Windows files + cleanPath(baseDir, "*" + BATCH_WINDOWS_EXT); + cleanPath(baseDir, "*.exe"); + } + + // Delete embedded files + Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("tutti.exe")); + Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("tutti.sh")); + cleanPath(baseDir.resolve(APPLICATION_DIR).resolve("launcher")); + + } + + + private class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { + + PathMatcher matcher; + + public RecursiveDeleteFileVisitor() { + // no matcher == delete all + } + + public RecursiveDeleteFileVisitor(String glob) { + super(); + + // Create a matcher according the glob parameter + matcher = baseDir.getFileSystem().getPathMatcher("glob:" + glob); + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + + // If the file name matches the glob or if no matcher, delete the file + if (matcher == null || matcher.matches(file.getFileName())) { + Files.deleteIfExists(file); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + + // if no matcher, delete the directory + if (matcher == null) { + Files.deleteIfExists(dir); + } + + return FileVisitResult.CONTINUE; + } + + } + +} diff --git a/tutti-ui-swing-updater/src/main/resources/update_runtime.bat b/tutti-ui-swing-updater/src/main/resources/update_runtime.bat new file mode 100644 index 0000000..e398c2b --- /dev/null +++ b/tutti-ui-swing-updater/src/main/resources/update_runtime.bat @@ -0,0 +1,31 @@ +@echo off +verify on +cd /d %~dp0% +set t=%time::=% +set BACKUP_DATE=%date:~6,4%%date:~3,2%%date:~0,2%%t:~0,6% +if not exist \"NEW\\jre\" goto launcher + set /p oldVersion=<jre\\version.appup + set /p newVersion=<NEW\\jre\\version.appup + set backupdir=OLD\\jre-%oldVersion%-%BACKUP_DATE% + echo Update jre version %oldVersion% to %newVersion% old jre keep in \"%backupdir%\" + if not exist \"OLD\" mkdir OLD + move /Y jre \"%backupdir%\" + move /Y NEW\\jre jre + +:launcher +if not exist \"NEW\\launcher\" goto end + set /p oldVersion=<launcher\\version.appup + set /p newVersion=<NEW\\launcher\\version.appup + set backupdir=OLD\\launcher-%oldVersion%-%BACKUP_DATE% + echo Update launcher version %oldVersion% to %newVersion% old launcher keep in \"%backupdir%\" + if not exist \"OLD\" mkdir OLD + move /Y tutti.exe launcher\\tutti.exe + move /Y launcher \"%backupdir%\" + move /Y NEW\\launcher launcher + del /F /Q launcher\\*.sh + move /Y launcher\\tutti.exe tutti.exe + +:end +if exist NEW\\jre rmdir /S /Q NEW\\jre +if exist NEW\\launcher rmdir /S /Q NEW\\launcher +start tutti.exe \ No newline at end of file diff --git a/tutti-ui-swing-updater/src/main/resources/update_runtime.sh b/tutti-ui-swing-updater/src/main/resources/update_runtime.sh new file mode 100644 index 0000000..a5f39e4 --- /dev/null +++ b/tutti-ui-swing-updater/src/main/resources/update_runtime.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +BACKUP_DATE=$(date +%Y%m%d%H%M%S) +if [ -d NEW/jre ]; then + oldVersion=`cat jre/version.appup` + newVersion=`cat NEW/jre/version.appup` + echo \"Update jre version $oldVersion to $newVersion\" + mkdir -p OLD + backupdir=OLD/jre-$oldVersion-$BACKUP_DATE + echo \"Backup jre old version to $backupdir\" + mv jre $backupdir + mv NEW/jre . +fi + +chmod +x jre/bin/java +if [ ! -h java ]; then + ln -sr jre/bin/java java +fi + +if [ -d NEW/launcher ]; then + oldVersion=`cat launcher/version.appup` + newVersion=`cat NEW/launcher/version.appup` + echo \"Update launcher version $oldVersion to $newVersion\" + mkdir -p OLD + backupdir=OLD/launcher-$oldVersion-$BACKUP_DATE + echo \"Backup launcher old version to $backupdir\" + mv tutti.sh launcher/ + mv launcher $backupdir + mv NEW/launcher . + rm launcher/*.exe + rm launcher/*.bat + mv launcher/tutti.sh . + chmod +x tutti.sh +fi + +./tutti.sh \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit fe6e892e3fdd24aaaca9268c97f4fbb028712e9c Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 13:45:20 2015 +0100 mise en place des nouveaux modules et du packaging --- pom.xml | 24 +++++- src/update/tutti-application.properties | 7 ++ tutti-ui-swing/pom.xml | 10 +++ ...full-component.xml => full-linux-component.xml} | 59 +++++++------- .../src/main/assembly/full-linux-i586.xml | 2 +- .../src/main/assembly/full-linux-x64.xml | 2 +- ...ll-component.xml => full-windows-component.xml} | 60 +++++++------- .../src/main/assembly/full-windows-i586.xml | 2 +- .../src/main/assembly/full-windows-x64.xml | 2 +- .../src/main/assembly/full/tutti-sanity.bat | 43 +--------- .../src/main/assembly/full/tutti-sanity.sh | 31 +------ tutti-ui-swing/src/main/assembly/full/tutti.bat | 44 ---------- tutti-ui-swing/src/main/assembly/full/tutti.sh | 31 +------ .../src/main/assembly/launcher/version.appup | 1 + tutti-ui-swing/src/main/assembly/min/launch.bat | 13 ++- tutti-ui-swing/src/main/assembly/min/launch.sh | 18 ++--- .../src/main/assembly/min/launcher.properties | 3 + tutti-ui-swing/src/main/assembly/min/update.bat | 94 +++------------------- tutti-ui-swing/src/main/assembly/min/update.sh | 84 +++---------------- tutti-ui-swing/src/main/assembly/standalone.xml | 11 +++ 20 files changed, 157 insertions(+), 384 deletions(-) diff --git a/pom.xml b/pom.xml index 4919805..278545a 100644 --- a/pom.xml +++ b/pom.xml @@ -94,6 +94,8 @@ <module>tutti-persistence</module> <module>tutti-ichtyometer</module> <module>tutti-service</module> + <module>tutti-ui-swing-launcher</module> + <module>tutti-ui-swing-updater</module> <module>tutti-ui-swing</module> </modules> @@ -155,6 +157,9 @@ <!-- Last JRE version to use --> <jreVersion>1.7.72</jreVersion> + <!-- Last launcher version --> + <launcherVersion>3.12-SNAPSHOT</launcherVersion> + <!-- issues status to include in changelog --> <redmine.statusIds>3,4,5,8</redmine.statusIds> @@ -623,6 +628,18 @@ </configuration> </plugin> + <plugin> + <groupId>com.akathist.maven.plugins.launch4j</groupId> + <artifactId>launch4j-maven-plugin</artifactId> + <version>1.5.2</version> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9.1</version> + </plugin> + </plugins> </pluginManagement> <extensions> @@ -681,6 +698,10 @@ <property>jreVersion</property> <message>You must set a jreVersion property!</message> </requireProperty> + <requireProperty> + <property>launcherVersion</property> + <message>You must set a launcherVersion property!</message> + </requireProperty> </rules> <ignoreCache>true</ignoreCache> <failFast>true</failFast> @@ -759,6 +780,7 @@ <filterset> <filter value="${project.version}" token="projectVersion" /> <filter value="${jreVersion}" token="jreVersion" /> + <filter value="${launcherVersion}" token="launcherVersion" /> </filterset> <fileset dir="${basedir}/src/update/"> <include name="tutti-application.properties" /> @@ -776,7 +798,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> - <version>1.0-beta-4</version> + <version>1.0</version> <executions> <execution> <id>deploy tutti-application.properties</id> diff --git a/src/update/tutti-application.properties b/src/update/tutti-application.properties index b3385c2..b82b1ae 100644 --- a/src/update/tutti-application.properties +++ b/src/update/tutti-application.properties @@ -34,6 +34,13 @@ windows.x86.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/c #windows.amd64.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/@jreVe... ################################################################################ +### Launcher Updates ########################################################### +################################################################################ + +launcher.version=@launcherVersion@ +launcher.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... + +################################################################################ ### Tutti Updates ############################################################## ################################################################################ diff --git a/tutti-ui-swing/pom.xml b/tutti-ui-swing/pom.xml index b9df966..f7fc9cc 100644 --- a/tutti-ui-swing/pom.xml +++ b/tutti-ui-swing/pom.xml @@ -110,6 +110,16 @@ <artifactId>tutti-ichtyometer</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-ui-swing-launcher</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-ui-swing-updater</artifactId> + <version>${project.version}</version> + </dependency> <!-- Adagio --> <dependency> diff --git a/tutti-ui-swing/src/main/assembly/tutti-full-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml similarity index 72% copy from tutti-ui-swing/src/main/assembly/tutti-full-component.xml copy to tutti-ui-swing/src/main/assembly/full-linux-component.xml index 605110f..4f8bfd3 100644 --- a/tutti-ui-swing/src/main/assembly/tutti-full-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -1,31 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Tutti :: UI - %% - Copyright (C) 2012 - 2014 Ifremer - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/gpl-3.0.html>. - #L% - --> <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd"> + <dependencySets> + <dependencySet> + <outputDirectory/> + <outputFileNameMapping>launcher.jar</outputFileNameMapping> + <includes> + <include>fr.ifremer.tutti:tutti-ui-swing-launcher:jar:${project.version}</include> + </includes> + </dependencySet> + <dependencySet> + <outputDirectory>tutti</outputDirectory> + <outputFileNameMapping>updater.jar</outputFileNameMapping> + <includes> + <include>fr.ifremer.tutti:tutti-ui-swing-updater:jar:${project.version}</include> + </includes> + </dependencySet> + </dependencySets> + <fileSets> <fileSet> @@ -34,11 +30,8 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> - <include>*.sh</include> - <include>*.bat</include> + <include>tutti.sh</include> <include>README*</include> - <include>report/**</include> - <include>ichtyometre/**</include> </includes> </fileSet> @@ -49,7 +42,6 @@ </fileSet> <!-- TUTTI component --> - <fileSet> <directory>target</directory> <outputDirectory>tutti</outputDirectory> @@ -66,6 +58,8 @@ </includes> <excludes> <exclude>junit-*.jar</exclude> + <exclude>tutti-ui-swing-launcher-*.jar</exclude> + <exclude>tutti-ui-swing-updater-*.jar</exclude> </excludes> </fileSet> @@ -76,7 +70,6 @@ <fileMode>0755</fileMode> <includes> <include>*.sh</include> - <include>*.bat</include> </includes> </fileSet> @@ -90,10 +83,20 @@ <excludes> <exclude>*.sh</exclude> <exclude>*.bat</exclude> - <exclude>tutti.config</exclude> + <exclude>obsdeb.config</exclude> </excludes> </fileSet> + <!-- Launcher component --> + <fileSet> + <directory>src/main/assembly/launcher</directory> + <outputDirectory>launcher</outputDirectory> + <filtered>true</filtered> + <includes> + <include>version.appup</include> + </includes> + </fileSet> + <!-- I18N component --> <fileSet> <directory>target/classes/META-INF</directory> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-i586.xml b/tutti-ui-swing/src/main/assembly/full-linux-i586.xml index 3448f5c..2cb2d4b 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-i586.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-i586.xml @@ -33,7 +33,7 @@ <componentDescriptors> <componentDescriptor> - src/main/assembly/tutti-full-component.xml + src/main/assembly/full-linux-component.xml </componentDescriptor> </componentDescriptors> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-x64.xml b/tutti-ui-swing/src/main/assembly/full-linux-x64.xml index 0d23033..7f12a20 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-x64.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-x64.xml @@ -33,7 +33,7 @@ <componentDescriptors> <componentDescriptor> - src/main/assembly/tutti-full-component.xml + src/main/assembly/full-linux-component.xml </componentDescriptor> </componentDescriptors> diff --git a/tutti-ui-swing/src/main/assembly/tutti-full-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml similarity index 73% rename from tutti-ui-swing/src/main/assembly/tutti-full-component.xml rename to tutti-ui-swing/src/main/assembly/full-windows-component.xml index 605110f..b2452d0 100644 --- a/tutti-ui-swing/src/main/assembly/tutti-full-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -1,31 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Tutti :: UI - %% - Copyright (C) 2012 - 2014 Ifremer - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/gpl-3.0.html>. - #L% - --> <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd"> + <dependencySets> + <dependencySet> + <outputDirectory/> + <outputFileNameMapping>tutti.exe</outputFileNameMapping> + <includes> + <include>fr.ifremer.tutti:tutti-ui-swing-launcher:exe:bin:${project.version}</include> + </includes> + </dependencySet> + <dependencySet> + <outputDirectory>tutti</outputDirectory> + <outputFileNameMapping>updater.jar</outputFileNameMapping> + <includes> + <include>fr.ifremer.tutti:tutti-ui-swing-updater:jar:${project.version}</include> + </includes> + </dependencySet> + </dependencySets> + <fileSets> <fileSet> @@ -34,11 +30,7 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> - <include>*.sh</include> - <include>*.bat</include> <include>README*</include> - <include>report/**</include> - <include>ichtyometre/**</include> </includes> </fileSet> @@ -48,11 +40,10 @@ </includes> </fileSet> - <!-- TUTTI component --> - + <!-- tutti component --> <fileSet> <directory>target</directory> - <outputDirectory>tutti</outputDirectory> + <outputDirectory>obsdeb</outputDirectory> <includes> <include>${project.build.finalName}.${project.packaging}</include> </includes> @@ -66,6 +57,8 @@ </includes> <excludes> <exclude>junit-*.jar</exclude> + <exclude>tutti-ui-swing-launcher-*.jar</exclude> + <exclude>tutti-ui-swing-updater-*.jar</exclude> </excludes> </fileSet> @@ -75,7 +68,6 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> - <include>*.sh</include> <include>*.bat</include> </includes> </fileSet> @@ -94,6 +86,16 @@ </excludes> </fileSet> + <!-- Launcher component --> + <fileSet> + <directory>src/main/assembly/launcher</directory> + <outputDirectory>launcher</outputDirectory> + <filtered>true</filtered> + <includes> + <include>version.appup</include> + </includes> + </fileSet> + <!-- I18N component --> <fileSet> <directory>target/classes/META-INF</directory> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-i586.xml b/tutti-ui-swing/src/main/assembly/full-windows-i586.xml index f36760f..f3592db 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-i586.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-i586.xml @@ -33,7 +33,7 @@ <componentDescriptors> <componentDescriptor> - src/main/assembly/tutti-full-component.xml + src/main/assembly/full-windows-component.xml </componentDescriptor> </componentDescriptors> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-x64.xml b/tutti-ui-swing/src/main/assembly/full-windows-x64.xml index 4fa8107..5ccdb55 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-x64.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-x64.xml @@ -33,7 +33,7 @@ <componentDescriptors> <componentDescriptor> - src/main/assembly/tutti-full-component.xml + src/main/assembly/full-windows-component.xml </componentDescriptor> </componentDescriptors> diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat index 7b1347d..fa2166c 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat +++ b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat @@ -1,44 +1,3 @@ @echo off -set OLDDIR=%CD% -cd /d %~dp0% - -set TUTTI_BASEDIR="%CD%" -set JAVA_HOME=%TUTTI_BASEDIR%\jre -set JAVA_COMMAND=%JAVA_HOME%\bin\java -set TUTTI_LOG_FILE=%TUTTI_BASEDIR%\data\tutti-${project.version}.log - -echo Allegro Campaign basedir: %TUTTI_BASEDIR% -echo Allegro Campaign app home: %TUTTI_HOME% -echo Allegro Campaign jre home: %JAVA_HOME% -echo Allegro Campaign log file: %TUTTI_LOG_FILE% - -:start - -copy tutti\update.bat . -echo Searching for updates... -call update.bat -del update.bat -if exist "tutti.config" copy tutti.config tutti -echo Allegro Campaign ${project.version} is starting... -call tutti\launch.bat --launch-mode full --basedir %TUTTI_BASEDIR% --db-sanity true -if errorlevel 89 goto deletedb -if errorlevel 88 goto start - -goto quit - -:deletedb - -echo "Clean database and restart" - -del /S/Q data\db -del /S/Q data\dbcache -del /S/Q data\dbconf -rmdir data\db -rmdir data\dbcache -rmdir data\dbconf - -goto start - -:quit -cd %OLDDIR% +start tutti.exe --db-sanity true diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh index b1f164d..5c451dc 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh @@ -4,38 +4,9 @@ export TUTTI_BASEDIR=$(pwd) export TUTTI_HOME=$TUTTI_BASEDIR/tutti export JAVA_HOME=$TUTTI_BASEDIR/jre export JAVA_COMMAND=$JAVA_HOME/bin/java -export TUTTI_LOG_FILE=$TUTTI_BASEDIR/data/tutti-${project.version}.log - -cd $TUTTI_BASEDIR echo "Allegro Campaign basedir: $TUTTI_BASEDIR" echo "Allegro Campaign app home: $TUTTI_HOME" echo "Allegro Campaign jre home: $JAVA_HOME" -echo "Allegro Campaign log file: $TUTTI_LOG_FILE" - -while true; do - - cp $TUTTI_HOME/update.sh . - echo "Searching for updates..." - ./update.sh - rm -f update.sh - if [ -f $TUTTI_BASEDIR/tutti.config ]; then - cp -rfv $TUTTI_BASEDIR/tutti.config $TUTTI_HOME - fi - echo "Allegro Campaign ${project.version} is starting..." - ./tutti/launch.sh --launch-mode full --basedir $TUTTI_BASEDIR --db-sanity true - exitcode=$? - - if [ "$exitcode" -eq "89" ]; then - # delete db directory and restart - rm -rfv data/db - rm -rfv data/dbcache - rm -rfv data/dbconf - exitcode=88 - fi - if [ ! "$exitcode" -eq "88" ]; then - # quit now! - exit $exitcode - fi -done \ No newline at end of file +$JAVA_COMMAND -jar launcher.jar --db-sanity true diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.bat b/tutti-ui-swing/src/main/assembly/full/tutti.bat deleted file mode 100644 index cb9396f..0000000 --- a/tutti-ui-swing/src/main/assembly/full/tutti.bat +++ /dev/null @@ -1,44 +0,0 @@ -@echo off - -set OLDDIR=%CD% -cd /d %~dp0% - -set TUTTI_BASEDIR="%CD%" -set JAVA_HOME=%TUTTI_BASEDIR%\jre -set JAVA_COMMAND=%JAVA_HOME%\bin\java -set TUTTI_LOG_FILE=%TUTTI_BASEDIR%\data\tutti-${project.version}.log - -echo Allegro Campaign basedir: %TUTTI_BASEDIR% -echo Allegro Campaign app home: %TUTTI_HOME% -echo Allegro Campaign jre home: %JAVA_HOME% -echo Allegro Campaign log file: %TUTTI_LOG_FILE% - -:start - -copy tutti\update.bat . -echo Searching for updates... -call update.bat -del update.bat -if exist "tutti.config" copy tutti.config tutti -echo Allegro Campaign ${project.version} is starting... -call tutti\launch.bat --launch-mode full --basedir %TUTTI_BASEDIR% -if errorlevel 89 goto deletedb -if errorlevel 88 goto start - -goto quit - -:deletedb - -echo "Clean database and restart" - -del /S/Q data\db -del /S/Q data\dbcache -del /S/Q data\dbconf -rmdir data\db -rmdir data\dbcache -rmdir data\dbconf - -goto start - -:quit -cd %OLDDIR% diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.sh b/tutti-ui-swing/src/main/assembly/full/tutti.sh index 1d29184..0cde9bd 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti.sh @@ -4,38 +4,9 @@ export TUTTI_BASEDIR=$(pwd) export TUTTI_HOME=$TUTTI_BASEDIR/tutti export JAVA_HOME=$TUTTI_BASEDIR/jre export JAVA_COMMAND=$JAVA_HOME/bin/java -export TUTTI_LOG_FILE=$TUTTI_BASEDIR/data/tutti-${project.version}.log - -cd $TUTTI_BASEDIR echo "Allegro Campaign basedir: $TUTTI_BASEDIR" echo "Allegro Campaign app home: $TUTTI_HOME" echo "Allegro Campaign jre home: $JAVA_HOME" -echo "Allegro Campaign log file: $TUTTI_LOG_FILE" - -while true; do - - cp $TUTTI_HOME/update.sh . - echo "Searching for updates..." - ./update.sh - rm -f update.sh - if [ -f $TUTTI_BASEDIR/tutti.config ]; then - cp -rfv $TUTTI_BASEDIR/tutti.config $TUTTI_HOME - fi - echo "Allegro Campaign ${project.version} is starting..." - ./tutti/launch.sh --launch-mode full --basedir $TUTTI_BASEDIR - exitcode=$? - - if [ "$exitcode" -eq "89" ]; then - # delete db directory and restart - rm -rfv data/db - rm -rfv data/dbcache - rm -rfv data/dbconf - exitcode=88 - fi - if [ ! "$exitcode" -eq "88" ]; then - # quit now! - exit $exitcode - fi -done \ No newline at end of file +$JAVA_COMMAND -jar launcher.jar diff --git a/tutti-ui-swing/src/main/assembly/launcher/version.appup b/tutti-ui-swing/src/main/assembly/launcher/version.appup new file mode 100644 index 0000000..462d2b3 --- /dev/null +++ b/tutti-ui-swing/src/main/assembly/launcher/version.appup @@ -0,0 +1 @@ +${launcherVersion} \ No newline at end of file diff --git a/tutti-ui-swing/src/main/assembly/min/launch.bat b/tutti-ui-swing/src/main/assembly/min/launch.bat index 9550fab..fbdb84c 100644 --- a/tutti-ui-swing/src/main/assembly/min/launch.bat +++ b/tutti-ui-swing/src/main/assembly/min/launch.bat @@ -1,10 +1,7 @@ @echo off -set OLDDIR=%CD% -cd /d %~dp0% - -%JAVA_COMMAND% -Xmx1024M -XX:MaxPermSize=128M -Dtutti.log.file=%TUTTI_LOG_FILE% -jar ${project.build.finalName}.${project.packaging} %1 %2 %3 %4 %5 %6 %7 %8 %9 -set exitcode=%ERRORLEVEL% -echo Stop Allegro Campaign with exitcode: %exitcode% -cd %OLDDIR% -exit /b %exitcode% +rem move embedded launcher file to tutti root +verify on +move /Y tutti\launcher launcher +move /Y tutti\tutti.exe tutti.exe +start tutti.exe diff --git a/tutti-ui-swing/src/main/assembly/min/launch.sh b/tutti-ui-swing/src/main/assembly/min/launch.sh index c268710..be75bd5 100755 --- a/tutti-ui-swing/src/main/assembly/min/launch.sh +++ b/tutti-ui-swing/src/main/assembly/min/launch.sh @@ -1,15 +1,7 @@ #!/bin/bash -MEMORY="-Xmx1024M -XX:MaxPermSize=128M" -#TUTTI_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000" - -REP=$(dirname $0) - -cd $REP - -#echo "java command: $JAVA_COMMAND" - -$JAVA_COMMAND $MEMORY $TUTTI_JVM_OPTS -Dtutti.log.file=$TUTTI_LOG_FILE -jar ${project.build.finalName}.${project.packaging} $* -exitcode=$? -echo "Stop Allegro Campaign with exitcode: $exitcode" -exit $exitcode +echo "Move embedded script file to tutti root" +mv -f tutti/launcher . +mv tutti/tutti.sh . +chmod +x tutti.sh +./tutti.sh diff --git a/tutti-ui-swing/src/main/assembly/min/launcher.properties b/tutti-ui-swing/src/main/assembly/min/launcher.properties new file mode 100644 index 0000000..9048ef8 --- /dev/null +++ b/tutti-ui-swing/src/main/assembly/min/launcher.properties @@ -0,0 +1,3 @@ +JAR=tutti/${project.build.finalName}.${project.packaging} +LOGFILE=data/tutti.log +JAVA_OPTS="-XX:MaxPermSize=128M -XX:PermSize=64M -XX:MaxNewSize=32M -XX:NewSize=32M -Xms256m -Xmx1024m" diff --git a/tutti-ui-swing/src/main/assembly/min/update.bat b/tutti-ui-swing/src/main/assembly/min/update.bat index 4765843..7fbfba8 100644 --- a/tutti-ui-swing/src/main/assembly/min/update.bat +++ b/tutti-ui-swing/src/main/assembly/min/update.bat @@ -1,84 +1,14 @@ @echo off -set t=%time::=% -set BACKUP_DATE=%date:~6,4%%date:~3,2%%date:~0,2%%t:~0,6% - -if not exist "NEW\jre" goto tutti - -rem deplacement de l'ancienne jre -set /p oldVersion=<jre\version.appup -set /p newVersion=<NEW\jre\version.appup -set backupdir=OLD\jre-%oldVersion: =%-%BACKUP_DATE: =% -echo Update jre version %oldVersion: =% to %newVersion: =% old jre keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move jre "%backupdir%" -move NEW\jre jre - -:tutti - -if not exist "NEW\tutti" goto i18n - -rem deplacement de l'ancien tutti -set /p oldVersion=<tutti\version.appup -set /p newVersion=<NEW\tutti\version.appup -set backupdir=OLD\tutti-%oldVersion: =%-%BACKUP_DATE: =% -echo Update tutti version %oldVersion: =% to %newVersion: =% old tutti keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move tutti "%backupdir%" -move NEW\tutti tutti - -:i18n - -if not exist "NEW\i18n" goto help - -rem deplacement de l'ancien i18n -set /p oldVersion=<i18n\version.appup -set /p newVersion=<NEW\i18n\version.appup -set backupdir=OLD\i18n-%oldVersion: =%-%BACKUP_DATE: =% -echo Update i18n version %oldVersion: =% to %newVersion: =% old i18n keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move i18n "%backupdir%" -move NEW\i18n i18n - -:help - -if not exist "NEW\help" goto ichtyometer - -rem deplacement de l'ancien help -set /p oldVersion=<help\version.appup -set /p newVersion=<NEW\help\version.appup -set backupdir=OLD\help-%oldVersion: =%-%BACKUP_DATE: =% -echo Update help version %oldVersion: =% to %newVersion: =% old help keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move help "%backupdir%" -move NEW\help help - -:ichtyometer - -if not exist "NEW\ichtyometer" goto report - -rem deplacement de l'ancien ichtyometer -set /p oldVersion=<ichtyometer\version.appup -set /p newVersion=<NEW\ichtyometer\version.appup -set backupdir=OLD\ichtyometer-%oldVersion: =%-%BACKUP_DATE: =% -echo Update ichtyometer version %oldVersion: =% to %newVersion: =% old ichtyometer keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move ichtyometer "%backupdir%" -move NEW\ichtyometer ichtyometer - -:report - -if not exist "NEW\report" goto end - -rem deplacement de l'ancien report -set /p oldVersion=<report\version.appup -set /p newVersion=<NEW\report\version.appup -set backupdir=OLD\report-%oldVersion: =%-%BACKUP_DATE: =% -echo Update report version %oldVersion: =% to %newVersion: =% old report keep in "%backupdir%" -if not exist "OLD" mkdir OLD -move report "%backupdir%" -move NEW\report report - -:end - -if exist "NEW" rmdir /Q NEW \ No newline at end of file +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +echo ! ! +echo ! THE LAUNCH AND UPDATE PROCESSES HAVE BEEN CHANGED ! +echo ! PLEASE EXECUTE 'tutti.exe' ! +echo ! ! +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +echo ! ! +echo ! LES PROCESSUS DE DEMARRAGE ET MISE A JOUR ONT CHANGES ! +echo ! VEUILLEZ EXECUTER 'tutti.exe' ! +echo ! ! +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +pause \ No newline at end of file diff --git a/tutti-ui-swing/src/main/assembly/min/update.sh b/tutti-ui-swing/src/main/assembly/min/update.sh index 986842e..9adea09 100644 --- a/tutti-ui-swing/src/main/assembly/min/update.sh +++ b/tutti-ui-swing/src/main/assembly/min/update.sh @@ -1,74 +1,12 @@ #!/bin/bash - -BACKUP_DATE=$(date +%Y%m%d%H%M%S) - -if [ -d NEW/jre ]; then - oldVersion=`cat jre/version.appup` - newVersion=`cat NEW/jre/version.appup` - echo "Update jre version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/jre-$oldVersion-$BACKUP_DATE - echo "Backup jre old version to $backupdir" - mv jre $backupdir - mv NEW/jre . - chmod +x jre/bin/java -fi - -if [ -d NEW/tutti ]; then - oldVersion=`cat tutti/version.appup` - newVersion=`cat NEW/tutti/version.appup` - echo "Update tutti version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/tutti-$oldVersion-$BACKUP_DATE - echo "Backup tutti old version to $backupdir" - mv tutti $backupdir - mv NEW/tutti . - chmod +x tutti/update.sh - chmod +x tutti/launch.sh -fi - -if [ -d NEW/i18n ]; then - oldVersion=`cat i18n/version.appup` - newVersion=`cat NEW/i18n/version.appup` - echo "Update i18n version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/i18n-$oldVersion-$BACKUP_DATE - echo "Backup i18n old version to $backupdir" - mv i18n $backupdir - mv NEW/i18n . -fi - -if [ -d NEW/help ]; then - oldVersion=`cat help/version.appup` - newVersion=`cat NEW/help/version.appup` - echo "Update help version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/help-$oldVersion-$BACKUP_DATE - echo "Backup help old version to $backupdir" - mv help $backupdir - mv NEW/help . -fi - -if [ -d NEW/ichtyometer ]; then - oldVersion=`cat ichtyometer/version.appup` - newVersion=`cat NEW/ichtyometer/version.appup` - echo "Update ichtyometer version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/ichtyometer-$oldVersion-$BACKUP_DATE - echo "Backup ichtyometer old version to $backupdir" - mv ichtyometer $backupdir - mv NEW/ichtyometer . -fi - -if [ -d NEW/report ]; then - oldVersion=`cat report/version.appup` - newVersion=`cat NEW/report/version.appup` - echo "Update report version $oldVersion to $newVersion" - mkdir -p OLD - backupdir=OLD/report-$oldVersion-$BACKUP_DATE - echo "Backup report old version to $backupdir" - mv report $backupdir - mv NEW/report . -fi - -rm -rf NEW +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +echo ! ! +echo ! THE LAUNCH AND UPDATE PROCESSES HAVE BEEN CHANGED ! +echo ! PLEASE EXECUTE './tutti.sh' ! +echo ! ! +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +echo ! ! +echo ! LES PROCESSUS DE DEMARRAGE ET MISE A JOUR ONT CHANGES ! +echo ! VEUILLEZ EXECUTER './tutti.sh' ! +echo ! ! +echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \ No newline at end of file diff --git a/tutti-ui-swing/src/main/assembly/standalone.xml b/tutti-ui-swing/src/main/assembly/standalone.xml index 39e9cad..efb16d7 100644 --- a/tutti-ui-swing/src/main/assembly/standalone.xml +++ b/tutti-ui-swing/src/main/assembly/standalone.xml @@ -57,6 +57,7 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> + <include>launcher.properties</include> <include>launch.sh</include> <include>launch.bat</include> <include>update.sh</include> @@ -65,6 +66,16 @@ </includes> </fileSet> + <!--add embedded launcher directory (TODO :should be removed in further version)--> + <fileSet> + <directory>src/main/assembly/launcher</directory> + <outputDirectory>launcher</outputDirectory> + <filtered>true</filtered> + <includes> + <include>*</include> + </includes> + </fileSet> + <fileSet> <includes> <include>README*</include> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 70df5471167efefa58c423695a70f1a73335b6b0 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 14:11:44 2015 +0100 nettoyage scripts --- tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh | 10 ++++------ tutti-ui-swing/src/main/assembly/full/tutti.sh | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh index 5c451dc..4af586a 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh @@ -1,12 +1,10 @@ #!/bin/bash -export TUTTI_BASEDIR=$(pwd) -export TUTTI_HOME=$TUTTI_BASEDIR/tutti -export JAVA_HOME=$TUTTI_BASEDIR/jre -export JAVA_COMMAND=$JAVA_HOME/bin/java +TUTTI_BASEDIR=$(pwd) +TUTTI_HOME=$TUTTI_BASEDIR/tutti +JAVA_HOME=$TUTTI_BASEDIR/jre +JAVA_COMMAND=$JAVA_HOME/bin/java echo "Allegro Campaign basedir: $TUTTI_BASEDIR" -echo "Allegro Campaign app home: $TUTTI_HOME" -echo "Allegro Campaign jre home: $JAVA_HOME" $JAVA_COMMAND -jar launcher.jar --db-sanity true diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.sh b/tutti-ui-swing/src/main/assembly/full/tutti.sh index 0cde9bd..05a4409 100644 --- a/tutti-ui-swing/src/main/assembly/full/tutti.sh +++ b/tutti-ui-swing/src/main/assembly/full/tutti.sh @@ -1,12 +1,10 @@ #!/bin/bash -export TUTTI_BASEDIR=$(pwd) -export TUTTI_HOME=$TUTTI_BASEDIR/tutti -export JAVA_HOME=$TUTTI_BASEDIR/jre -export JAVA_COMMAND=$JAVA_HOME/bin/java +TUTTI_BASEDIR=$(pwd) +TUTTI_HOME=$TUTTI_BASEDIR/tutti +JAVA_HOME=$TUTTI_BASEDIR/jre +JAVA_COMMAND=$JAVA_HOME/bin/java echo "Allegro Campaign basedir: $TUTTI_BASEDIR" -echo "Allegro Campaign app home: $TUTTI_HOME" -echo "Allegro Campaign jre home: $JAVA_HOME" $JAVA_COMMAND -jar launcher.jar -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit df7ada6b2d109d8acde4e5fbaa187c37b8b4affc Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Jan 3 14:12:10 2015 +0100 lors de la suppression d'une base, nettoyage aussi des pieces jointes associées --- .../src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java index 7d57934..eea7a0c 100644 --- a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java +++ b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java @@ -168,7 +168,7 @@ public class Launcher { Path dataPath = basedir.resolve(DATA_DIR); Files.walkFileTree(dataPath.resolve("db"), new RecursiveDeleteFileVisitor()); Files.walkFileTree(dataPath.resolve("dbcache"), new RecursiveDeleteFileVisitor()); - Files.walkFileTree(dataPath.resolve("dbconf"), new RecursiveDeleteFileVisitor()); + Files.walkFileTree(dataPath.resolve("meas_files"), new RecursiveDeleteFileVisitor()); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit b1e3b896c565a9829eb819344d1b1ba132bda907 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:36:48 2015 +0100 be able to change distro url --- pom.xml | 17 +++++++++++++---- src/update/tutti-application.properties | 10 +++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 278545a..a925633 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>codelutinpom</artifactId> - <version>1.6</version> + <version>1.8.1</version> </parent> <groupId>fr.ifremer</groupId> @@ -158,10 +158,10 @@ <jreVersion>1.7.72</jreVersion> <!-- Last launcher version --> - <launcherVersion>3.12-SNAPSHOT</launcherVersion> + <launcherVersion>1.0</launcherVersion> - <!-- issues status to include in changelog --> - <redmine.statusIds>3,4,5,8</redmine.statusIds> + <!-- Where are deployed software components --> + <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer/tutti</distroUrl> </properties> @@ -780,6 +780,7 @@ <filterset> <filter value="${project.version}" token="projectVersion" /> <filter value="${jreVersion}" token="jreVersion" /> + <filter value="${distroUrl}" token="distroUrl" /> <filter value="${launcherVersion}" token="launcherVersion" /> </filterset> <fileset dir="${basedir}/src/update/"> @@ -948,5 +949,13 @@ </build> </profile> + <profile> + <id>deploy-to-snapshot</id> + <properties> + <release.repository>${snapshot.repository}</release.repository> + <distroUrl>${snapshot.repository}/fr/ifremer/tutti</distroUrl> + </properties> + </profile> + </profiles> </project> diff --git a/src/update/tutti-application.properties b/src/update/tutti-application.properties index b82b1ae..bded225 100644 --- a/src/update/tutti-application.properties +++ b/src/update/tutti-application.properties @@ -38,32 +38,32 @@ windows.x86.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/c ################################################################################ launcher.version=@launcherVersion@ -launcher.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... +launcher.url=zip:@distroUrl@/tutti-ui-swing-launcher/@launcherVersion@/tutti-ui-swing-launcher-@launcherVersion@.zip ################################################################################ ### Tutti Updates ############################################################## ################################################################################ tutti.version=@projectVersion@ -tutti.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... +tutti.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-standalone.zip ################################################################################ ### I18n Updates ############################################################### ################################################################################ i18n.version=@projectVersion@ -i18n.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... +i18n.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-i18n.zip ################################################################################ ### Help Updates ############################################################### ################################################################################ help.version=@projectVersion@ -help.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... +help.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-help.zip ################################################################################ ### Ichtyometer Updates ######################################################## ################################################################################ ichtyometer.version=@projectVersion@ -ichtyometer.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer... +ichtyometer.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-ichtyometer.zip -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit c1a7d2f030dda697073b9385d7dc718bd795638b Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:40:17 2015 +0100 launcher does not have the same version (and even should not be part of main build) --- tutti-ui-swing-launcher/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tutti-ui-swing-launcher/pom.xml b/tutti-ui-swing-launcher/pom.xml index b9195e9..3b5457b 100644 --- a/tutti-ui-swing-launcher/pom.xml +++ b/tutti-ui-swing-launcher/pom.xml @@ -30,6 +30,7 @@ <groupId>fr.ifremer.tutti</groupId> <artifactId>tutti-ui-swing-launcher</artifactId> + <version>1.0-SNAPSHOT</version> <name>Tutti :: UI Launcher</name> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 6c1600fdd74903e4cb0adfbf796a6f7ffde59d82 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 14:54:55 2015 +0100 at release time ask for version of each module --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index a925633..de499fe 100644 --- a/pom.xml +++ b/pom.xml @@ -163,6 +163,8 @@ <!-- Where are deployed software components --> <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer/tutti</distroUrl> + <autoVersionSubmodules>false</autoVersionSubmodules> + </properties> <repositories> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit cdf020f1f31fd063d2266fbcf02fec7c63840ca9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:19:21 2015 +0100 suppression du module launcher (c'est un proet à part) --- tutti-ui-swing-launcher/LICENSE.txt | 0 tutti-ui-swing-launcher/README.txt | 0 tutti-ui-swing-launcher/pom.xml | 180 ---------------- .../src/main/assembly/launcher.xml | 24 --- .../tutti/ui/swing/launcher/JavaCommand.java | 163 -------------- .../ifremer/tutti/ui/swing/launcher/Launcher.java | 236 --------------------- .../ui/swing/launcher/LauncherProperties.java | 93 -------- .../src/main/resources/splash.bmp | Bin 539082 -> 0 bytes .../src/main/resources/tutti.ico | Bin 32038 -> 0 bytes 9 files changed, 696 deletions(-) diff --git a/tutti-ui-swing-launcher/LICENSE.txt b/tutti-ui-swing-launcher/LICENSE.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tutti-ui-swing-launcher/README.txt b/tutti-ui-swing-launcher/README.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tutti-ui-swing-launcher/pom.xml b/tutti-ui-swing-launcher/pom.xml deleted file mode 100644 index 3b5457b..0000000 --- a/tutti-ui-swing-launcher/pom.xml +++ /dev/null @@ -1,180 +0,0 @@ -<!-- - #%L - Tutti :: UI Launcher - %% - Copyright (C) 2015 Ifremer - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses />. - #L% ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>fr.ifremer</groupId> - <artifactId>tutti</artifactId> - <version>3.12-SNAPSHOT</version> - </parent> - - <groupId>fr.ifremer.tutti</groupId> - <artifactId>tutti-ui-swing-launcher</artifactId> - <version>1.0-SNAPSHOT</version> - - <name>Tutti :: UI Launcher</name> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - - <target.fileName>tutti.exe</target.fileName> - - <!-- generate license bundled files --> - <license.generateBundle>true</license.generateBundle> - <license.bundleThirdPartyPath>META-INF/tutti-THIRD-PARTY.txt</license.bundleThirdPartyPath> - <license.bundleLicensePath>META-INF/tutti-LICENSE.txt</license.bundleLicensePath> - - </properties> - - <dependencies> - <!-- please, no dependency --> - </dependencies> - - <build> - - <plugins> - - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>fr.ifremer.tutti.ui.swing.launcher.Launcher</mainClass> - </manifest> - </archive> - </configuration> - </plugin> - - <plugin> - <groupId>com.akathist.maven.plugins.launch4j</groupId> - <artifactId>launch4j-maven-plugin</artifactId> - <executions> - <execution> - <id>create-launcher</id> - <phase>package</phase> - <goals> - <goal>launch4j</goal> - </goals> - <configuration> - <headerType>gui</headerType> - <jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar> - <outfile>${project.build.directory}/${target.fileName}</outfile> - <downloadUrl>http://java.com/download</downloadUrl> - <chdir>.</chdir> - <classPath> - <mainClass>fr.ifremer.tutti.ui.swing.launcher.Launcher</mainClass> - <preCp>anything</preCp> - </classPath> - <splash> - <file>src/main/resources/splash.bmp</file> - <timeout>3</timeout> - <waitForWindow>false</waitForWindow> - </splash> - <icon>src/main/resources/tutti.ico</icon> - <customProcName>true</customProcName> - <jre> - <path>jre</path> - <jdkPreference>preferJre</jdkPreference> - <maxHeapSize>20</maxHeapSize> - </jre> - <versionInfo> - <fileVersion>0.0.0.0</fileVersion> - <txtFileVersion>${project.version}</txtFileVersion> - <fileDescription>${project.name}</fileDescription> - <copyright>${project.inceptionYear} - ${project.organization.name}</copyright> - <productVersion>0.0.0.0</productVersion> - <txtProductVersion>${project.version}</txtProductVersion> - <productName>${project.parent.name}</productName> - <companyName>${project.organization.name}</companyName> - <internalName>Tutti Launcher</internalName> - <originalFilename>${target.fileName}</originalFilename> - </versionInfo> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>attach-artifact</goal> - </goals> - <configuration> - <artifacts> - <artifact> - <file>${project.build.directory}/${target.fileName}</file> - <type>zip</type> - <classifier>bin</classifier> - </artifact> - </artifacts> - </configuration> - </execution> - </executions> - </plugin> - - </plugins> - - </build> - - <profiles> - <profile> - <id>assembly-profile</id> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> - <build> - <defaultGoal>package</defaultGoal> - <plugins> - - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - <configuration> - <attach>true</attach> - <descriptors> - <descriptor>src/main/assembly/launcher.xml</descriptor> - </descriptors> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project> - diff --git a/tutti-ui-swing-launcher/src/main/assembly/launcher.xml b/tutti-ui-swing-launcher/src/main/assembly/launcher.xml deleted file mode 100644 index acfabc7..0000000 --- a/tutti-ui-swing-launcher/src/main/assembly/launcher.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<assembly - xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> - <id>bin</id> - - <formats> - <format>zip</format> - </formats> - - <fileSets> - - <fileSet> - <directory>target</directory> - <outputDirectory/> - <includes> - <include>${target.fileName}</include> - </includes> - </fileSet> - - </fileSets> -</assembly> diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java deleted file mode 100644 index 267ba3d..0000000 --- a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/JavaCommand.java +++ /dev/null @@ -1,163 +0,0 @@ -package fr.ifremer.tutti.ui.swing.launcher; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * Created on 1/3/15. - * - * @author Tony Chemit - chemit@codelutin.com - * @since 3.12 - */ -public class JavaCommand { - - private static final String DEBUG_JAVA_OPTS = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=%s"; - - static JavaCommand create(Path basedir, int debugPort) { - return new JavaCommand(basedir, debugPort); - } - - static JavaCommand create(Path basedir) { - return new JavaCommand(basedir, 8000); - } - - protected JavaCommand(Path javaCommand, int debugPort) { - this.javaCommand = javaCommand; - this.debugPort = debugPort; - this.preJarArguments = new ArrayList<>(); - this.postJarArguments = new ArrayList<>(); - } - - private final int debugPort; - - private final Path javaCommand; - - private final List<String> preJarArguments; - - private final List<String> postJarArguments; - - private Path jarPath; - - private boolean inheritIO; - - private boolean debug; - - private Path logFile; - - public JavaCommand setInheritIO(boolean inheritIO) { - this.inheritIO = inheritIO; - return this; - } - - public JavaCommand setDebug(boolean debug) { - this.debug = debug; - return this; - } - - public JavaCommand setJarPath(Path jarPath) { - this.jarPath = jarPath; - return this; - } - - public JavaCommand setLogFile(Path logFile) { - this.logFile = logFile; - return this; - } - - public JavaCommand addArgument(Object argument) { - - List<String> whereToAdd; - if (jarPath == null) { - whereToAdd = preJarArguments; - - } else { - whereToAdd = postJarArguments; - } - - whereToAdd.add(argument.toString()); - - return this; - } - - public JavaCommand addArguments(Object argument, Object... arguments) { - - List<String> whereToAdd; - if (jarPath == null) { - whereToAdd = preJarArguments; - - } else { - whereToAdd = postJarArguments; - } - - whereToAdd.add(argument.toString()); - - for (Object argument1 : arguments) { - whereToAdd.add(argument1.toString()); - } - - return this; - } - - public JavaCommand addArguments(Collection<?> arguments) { - - List<String> whereToAdd; - if (jarPath == null) { - whereToAdd = preJarArguments; - - } else { - whereToAdd = postJarArguments; - } - - for (Object argument : arguments) { - whereToAdd.add(argument.toString()); - } - - return this; - } - - public Launcher.ExitCode execute() throws IOException, InterruptedException { - - if (jarPath == null) { - - throw new IllegalStateException("No jarPath given, can't execute."); - - } - - List<String> command = new ArrayList<>(); - - command.add(javaCommand.toString()); - command.addAll(preJarArguments); - if (debug) { - command.add(String.format(DEBUG_JAVA_OPTS, debugPort)); - } - command.add("-jar"); - command.add(jarPath.toString()); - command.addAll(postJarArguments); - - ProcessBuilder pb = new ProcessBuilder(command); - - if (inheritIO) { - - pb.inheritIO(); - - } - - if (logFile != null) { - - File updaterLogFile = logFile.toFile(); - pb.redirectOutput(ProcessBuilder.Redirect.to(updaterLogFile)); - pb.redirectError(ProcessBuilder.Redirect.appendTo(updaterLogFile)); - - } - - System.out.println("Starts java command: " + command); - - int exitCode = pb.start().waitFor(); - return Launcher.ExitCode.valueOf(exitCode); - - } -} diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java deleted file mode 100644 index eea7a0c..0000000 --- a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/Launcher.java +++ /dev/null @@ -1,236 +0,0 @@ -package fr.ifremer.tutti.ui.swing.launcher; - -import javax.swing.JOptionPane; -import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Launcher application that do post-update logic, launch application and listen to exit code. - * - * @author Tony Chemit (chemit@codelutin.com) - * @since 3.12 - */ -public class Launcher { - - public static final String APPLICATION_LANCHER_TITLE = "Tutti UI Launcher"; - - public static final String APPLICATION_DIR = "tutti"; - - public static final String DATA_DIR = "data"; - - public static final String UPDATER_JAR = "updater.jar"; - - public static final String UPDATER_LOGFILE = "updater.log"; - - public static final String FULL_LAUNCH_MODE = "full"; - - public static final String DEBUG_ARG = "--debug"; - - private final Path basedir; - - private final List<String> arguments; - - private final Path javaCommand; - - private final boolean debugMode; - - public static void main(String... args) { - - boolean windowsOs = System.getProperty("os.name").startsWith("Windows"); - - String javaCommandFilename = windowsOs ? "java.exe" : "java"; - - Launcher launcher = new Launcher(javaCommandFilename, args); - launcher.execute(); - - } - - public Launcher(String javaCommandFilename, String... args) { - - this.basedir = Paths.get(System.getProperty("user.dir")); - - this.javaCommand = basedir.resolve("jre").resolve("bin").resolve(javaCommandFilename); - - List<String> fullArguments = Arrays.asList(args); - - this.debugMode = fullArguments.remove(DEBUG_ARG); - - this.arguments = Collections.unmodifiableList(fullArguments); - - } - - public void execute() { - - try { - - ExitCode exitCode; - - do { - - // call update process - exitCode = executeUpdate(); - - if (exitCode == ExitCode.RUNTIME_UPDATE) { - - // if updater has detected runtime update, stop now - System.exit(exitCode.getExitCode()); - - } - - if (exitCode != ExitCode.NORMAL) { - - // update fails - throw new RuntimeException("Tutti Updater has encountered a problem, program stopped.\nPlease check " + UPDATER_LOGFILE); - - } - - // launch application - exitCode = executeApplication(); - - if (exitCode == ExitCode.DELETE_DB) { - deleteDb(); - } - - } while (exitCode.isRelaunch()); - - if (exitCode != ExitCode.NORMAL) { - - // show exit code - throw new RuntimeException("exit code = " + exitCode); - - } - - } catch (Exception ex) { - JOptionPane.showMessageDialog(null, ex.toString(), APPLICATION_LANCHER_TITLE, JOptionPane.ERROR_MESSAGE); - } - - } - - protected ExitCode executeUpdate() throws Exception { - - Path updatePath = basedir.resolve(APPLICATION_DIR).resolve(UPDATER_JAR); - Path updateExecPath = basedir.resolve(UPDATER_JAR); - Files.copy(updatePath, updateExecPath, StandardCopyOption.REPLACE_EXISTING); - - Path logfile = basedir.resolve(UPDATER_LOGFILE); - - try { - - JavaCommand program = JavaCommand - .create(javaCommand) - .setJarPath(updateExecPath) - .setLogFile(logfile); - - ExitCode exitCode = program.execute(); - return exitCode; - - } finally { - - Files.delete(updateExecPath); - - } - - } - - protected ExitCode executeApplication() throws Exception { - - LauncherProperties launcherProperties = new LauncherProperties(basedir); - launcherProperties.load(); - - JavaCommand program = JavaCommand - .create(javaCommand) - .setDebug(debugMode) - .setInheritIO(true) - .addArguments(launcherProperties.getJavaOptions()) - .addArgument("-Dtutti.log.file=" + launcherProperties.getLogFile().toString()) - .setJarPath(launcherProperties.getJarFile()) - .addArguments("--launch-mode", FULL_LAUNCH_MODE) - .addArguments("--basedir", basedir.toString()) -// .addArgument("--config.path", basedir.toString()) - .addArgument(arguments); - - ExitCode exitCode = program.execute(); - return exitCode; - - } - - protected void deleteDb() throws Exception { - - Path dataPath = basedir.resolve(DATA_DIR); - Files.walkFileTree(dataPath.resolve("db"), new RecursiveDeleteFileVisitor()); - Files.walkFileTree(dataPath.resolve("dbcache"), new RecursiveDeleteFileVisitor()); - Files.walkFileTree(dataPath.resolve("meas_files"), new RecursiveDeleteFileVisitor()); - - } - - private class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - Files.deleteIfExists(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - Files.deleteIfExists(dir); - return FileVisitResult.CONTINUE; - } - - } - - /** - * Created on 1/3/15. - * - * @author Tony Chemit - chemit@codelutin.com - * @since 3.12 - */ - public static enum ExitCode { - - NORMAL(0, false), // Normal exist code, always quit program - UPDATE(88, true), // When an update was found, will relaunch application - DELETE_DB(89, true), // When a db deletion is required, will relaunch application - RUNTIME_UPDATE(90, false), // When a runtime update found, quit program to update runtime - UNKNOWN(-1, false); // For any other exit code, will always quit program - - private final int exitCode; - - private final boolean relaunch; - - ExitCode(int exitCode, boolean relaunch) { - this.exitCode = exitCode; - this.relaunch = relaunch; - } - - public int getExitCode() { - return exitCode; - } - - public boolean isRelaunch() { - return relaunch; - } - - public static ExitCode valueOf(int code) { - - ExitCode result = UNKNOWN; - - for (ExitCode exitCode : ExitCode.values()) { - if (code == exitCode.getExitCode()) { - result = exitCode; - } - } - - return result; - - } - } -} diff --git a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java b/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java deleted file mode 100644 index e0a3a88..0000000 --- a/tutti-ui-swing-launcher/src/main/java/fr/ifremer/tutti/ui/swing/launcher/LauncherProperties.java +++ /dev/null @@ -1,93 +0,0 @@ -package fr.ifremer.tutti.ui.swing.launcher; - -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -/** - * Created on 1/3/15. - * - * @author Tony Chemit - chemit@codelutin.com - * @since 3.12 - */ -public class LauncherProperties { - - public static final String LAUNCHER_PROPERTIES = "launcher.properties"; - - public static final String LAUNCHER_PROPERTIES_JAR = "JAR"; - - public static final String LAUNCHER_PROPERTIES_LOGFILE = "LOGFILE"; - - public static final String LAUNCHER_PROPERTIES_JAVA_OPTS = "JAVA_OPTS"; - - private final Path basedir; - - Properties launcherProperties; - - public LauncherProperties(Path basedir) { - this.basedir = basedir; - } - - public void load() throws IOException { - - // application launcher properties - Path applicationFile = basedir.resolve(Launcher.APPLICATION_DIR).resolve(LAUNCHER_PROPERTIES); - // local launcher properties - Path localFile = basedir.resolve(LAUNCHER_PROPERTIES); - - if (!(Files.exists(localFile) || Files.exists(applicationFile))) { - - throw new IOException("Could not find " + LAUNCHER_PROPERTIES); - - } - - Properties p1 = new Properties(); - if (Files.isReadable(applicationFile)) { - p1.load(new FileReader(applicationFile.toFile())); - } - - launcherProperties = new Properties(p1); - if (Files.isReadable(localFile)) { - launcherProperties.load(new FileReader(localFile.toFile())); - } - } - - public Path getJarFile() { - - String jarFileName = launcherProperties.getProperty(LAUNCHER_PROPERTIES_JAR); - Path jarFile = basedir.resolve(jarFileName); - return jarFile; - - } - - public Path getLogFile() { - - String logFileName = launcherProperties.getProperty(LAUNCHER_PROPERTIES_LOGFILE); - Path logFile = basedir.resolve(logFileName); - return logFile; - - } - - public List<String> getJavaOptions() { - - List<String> javaOptions = new ArrayList<>(); - String javaOpts = launcherProperties.getProperty(LAUNCHER_PROPERTIES_JAVA_OPTS); - if (!(javaOpts == null || javaOpts.trim().isEmpty())) { - String[] javaOptsArray = javaOpts.replaceAll("\"", "").split(" "); - for (String opt : javaOptsArray) { - if (!(opt == null || opt.trim().isEmpty())) { - javaOptions.add(opt); - } - } - } - - return javaOptions; - - } - - -} diff --git a/tutti-ui-swing-launcher/src/main/resources/splash.bmp b/tutti-ui-swing-launcher/src/main/resources/splash.bmp deleted file mode 100644 index 3d197f4..0000000 Binary files a/tutti-ui-swing-launcher/src/main/resources/splash.bmp and /dev/null differ diff --git a/tutti-ui-swing-launcher/src/main/resources/tutti.ico b/tutti-ui-swing-launcher/src/main/resources/tutti.ico deleted file mode 100644 index 3b36647..0000000 Binary files a/tutti-ui-swing-launcher/src/main/resources/tutti.ico and /dev/null differ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 84d4aaf9f1ad027bbbb3c9f61726ac4a962cbb69 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:20:03 2015 +0100 amelioration de la definition de distrourl --- pom.xml | 13 +++---------- src/update/tutti-application.properties | 10 +++++----- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index de499fe..3bedd44 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,6 @@ <module>tutti-persistence</module> <module>tutti-ichtyometer</module> <module>tutti-service</module> - <module>tutti-ui-swing-launcher</module> <module>tutti-ui-swing-updater</module> <module>tutti-ui-swing</module> </modules> @@ -158,10 +157,10 @@ <jreVersion>1.7.72</jreVersion> <!-- Last launcher version --> - <launcherVersion>1.0</launcherVersion> + <launcherVersion>1.0-SNAPSHOT</launcherVersion> <!-- Where are deployed software components --> - <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer/tutti</distroUrl> + <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases</distroUrl> <autoVersionSubmodules>false</autoVersionSubmodules> @@ -631,12 +630,6 @@ </plugin> <plugin> - <groupId>com.akathist.maven.plugins.launch4j</groupId> - <artifactId>launch4j-maven-plugin</artifactId> - <version>1.5.2</version> - </plugin> - - <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.9.1</version> @@ -955,7 +948,7 @@ <id>deploy-to-snapshot</id> <properties> <release.repository>${snapshot.repository}</release.repository> - <distroUrl>${snapshot.repository}/fr/ifremer/tutti</distroUrl> + <distroUrl>${snapshot.repository}</distroUrl> </properties> </profile> diff --git a/src/update/tutti-application.properties b/src/update/tutti-application.properties index bded225..0cbadf0 100644 --- a/src/update/tutti-application.properties +++ b/src/update/tutti-application.properties @@ -38,32 +38,32 @@ windows.x86.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/c ################################################################################ launcher.version=@launcherVersion@ -launcher.url=zip:@distroUrl@/tutti-ui-swing-launcher/@launcherVersion@/tutti-ui-swing-launcher-@launcherVersion@.zip +launcher.url=zip:@distroUrl@/fr/ifremer/tutti/tutti-launcher/@launcherVersion@/tutti-launcher-@launcherVersion@-bin.zip ################################################################################ ### Tutti Updates ############################################################## ################################################################################ tutti.version=@projectVersion@ -tutti.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-standalone.zip +tutti.url=zip:@distroUrl@/fr/ifremer/tutti/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-standalone.zip ################################################################################ ### I18n Updates ############################################################### ################################################################################ i18n.version=@projectVersion@ -i18n.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-i18n.zip +i18n.url=zip:@distroUrl@/fr/ifremer/tutti/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-i18n.zip ################################################################################ ### Help Updates ############################################################### ################################################################################ help.version=@projectVersion@ -help.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-help.zip +help.url=zip:@distroUrl@/fr/ifremer/tutti/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-help.zip ################################################################################ ### Ichtyometer Updates ######################################################## ################################################################################ ichtyometer.version=@projectVersion@ -ichtyometer.url=zip:@distroUrl@/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-ichtyometer.zip +ichtyometer.url=zip:@distroUrl@/fr/ifremer/tutti/tutti-ui-swing/@projectVersion@/tutti-ui-swing-@projectVersion@-ichtyometer.zip -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 818d7b6b36d4d64bf3f60006b433fc7906010f7c Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 16:21:20 2015 +0100 utilisation de tutti-launcher (mais pas inclut comme dépendance du module ui) --- tutti-ui-swing/pom.xml | 77 ++++++++++++++++++++-- .../src/main/assembly/full-linux-component.xml | 16 ++--- .../src/main/assembly/full-windows-component.xml | 16 ++--- 3 files changed, 88 insertions(+), 21 deletions(-) diff --git a/tutti-ui-swing/pom.xml b/tutti-ui-swing/pom.xml index f7fc9cc..9dff5a6 100644 --- a/tutti-ui-swing/pom.xml +++ b/tutti-ui-swing/pom.xml @@ -112,11 +112,6 @@ </dependency> <dependency> <groupId>${project.groupId}</groupId> - <artifactId>tutti-ui-swing-launcher</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> <artifactId>tutti-ui-swing-updater</artifactId> <version>${project.version}</version> </dependency> @@ -544,6 +539,23 @@ </artifactItems> </configuration> </execution> + <execution> + <id>get-linux-x64-launcher</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-launcher</artifactId> + <version>${launcherVersion}</version> + </artifactItem> + </artifactItems> + </configuration> + </execution> </executions> </plugin> @@ -610,6 +622,23 @@ </artifactItems> </configuration> </execution> + <execution> + <id>get-linux-586-launcher</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-launcher</artifactId> + <version>${launcherVersion}</version> + </artifactItem> + </artifactItems> + </configuration> + </execution> </executions> </plugin> @@ -676,6 +705,25 @@ </artifactItems> </configuration> </execution> + <execution> + <id>get-windows-i586-launcher</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-launcher</artifactId> + <version>${launcherVersion}</version> + <type>exe</type> + <classifier>bin</classifier> + </artifactItem> + </artifactItems> + </configuration> + </execution> </executions> </plugin> @@ -742,6 +790,25 @@ </artifactItems> </configuration> </execution> + <execution> + <id>get-windows-x64-launcher</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>tutti-launcher</artifactId> + <version>${launcherVersion}</version> + <type>exe</type> + <classifier>bin</classifier> + </artifactItem> + </artifactItems> + </configuration> + </execution> </executions> </plugin> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml index 4f8bfd3..9039a7a 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -7,13 +7,6 @@ <dependencySets> <dependencySet> - <outputDirectory/> - <outputFileNameMapping>launcher.jar</outputFileNameMapping> - <includes> - <include>fr.ifremer.tutti:tutti-ui-swing-launcher:jar:${project.version}</include> - </includes> - </dependencySet> - <dependencySet> <outputDirectory>tutti</outputDirectory> <outputFileNameMapping>updater.jar</outputFileNameMapping> <includes> @@ -22,6 +15,14 @@ </dependencySet> </dependencySets> + <files> + <file> + <source>${project.build.directory}/tutti-launcher-${launcherVersion}.jar</source> + <outputDirectory>tutti</outputDirectory> + <destName>launcher.jar</destName> + </file> + </files> + <fileSets> <fileSet> @@ -58,7 +59,6 @@ </includes> <excludes> <exclude>junit-*.jar</exclude> - <exclude>tutti-ui-swing-launcher-*.jar</exclude> <exclude>tutti-ui-swing-updater-*.jar</exclude> </excludes> </fileSet> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index b2452d0..8e228b8 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -7,13 +7,6 @@ <dependencySets> <dependencySet> - <outputDirectory/> - <outputFileNameMapping>tutti.exe</outputFileNameMapping> - <includes> - <include>fr.ifremer.tutti:tutti-ui-swing-launcher:exe:bin:${project.version}</include> - </includes> - </dependencySet> - <dependencySet> <outputDirectory>tutti</outputDirectory> <outputFileNameMapping>updater.jar</outputFileNameMapping> <includes> @@ -22,6 +15,14 @@ </dependencySet> </dependencySets> + <files> + <file> + <source>${project.build.directory}/tutti-launcher-${launcherVersion}-bin.exe</source> + <outputDirectory/> + <destName>tutti.exe</destName> + </file> + </files> + <fileSets> <fileSet> @@ -57,7 +58,6 @@ </includes> <excludes> <exclude>junit-*.jar</exclude> - <exclude>tutti-ui-swing-launcher-*.jar</exclude> <exclude>tutti-ui-swing-updater-*.jar</exclude> </excludes> </fileSet> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit c4735b6eb39a3a8b3583b465a4507ed58c0b37f0 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 22 17:09:10 2015 +0100 copie du launcher au bon endroit --- .../src/main/assembly/full-linux-component.xml | 26 +++++++++++++++++++++- .../src/main/assembly/full-windows-component.xml | 24 ++++++++++++++++++++ .../src/main/assembly/min/launcher.properties | 23 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml index 9039a7a..e32da6d 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -1,4 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: UI + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2012 - 2015 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" @@ -18,7 +42,7 @@ <files> <file> <source>${project.build.directory}/tutti-launcher-${launcherVersion}.jar</source> - <outputDirectory>tutti</outputDirectory> + <outputDirectory/> <destName>launcher.jar</destName> </file> </files> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 8e228b8..5e84a9c 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -1,4 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: UI + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2012 - 2015 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" diff --git a/tutti-ui-swing/src/main/assembly/min/launcher.properties b/tutti-ui-swing/src/main/assembly/min/launcher.properties index 9048ef8..d9b292b 100644 --- a/tutti-ui-swing/src/main/assembly/min/launcher.properties +++ b/tutti-ui-swing/src/main/assembly/min/launcher.properties @@ -1,3 +1,26 @@ +### +# #%L +# Tutti :: UI +# $Id:$ +# $HeadURL:$ +# %% +# Copyright (C) 2012 - 2015 Ifremer +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### JAR=tutti/${project.build.finalName}.${project.packaging} LOGFILE=data/tutti.log JAVA_OPTS="-XX:MaxPermSize=128M -XX:PermSize=64M -XX:MaxNewSize=32M -XX:NewSize=32M -Xms256m -Xmx1024m" -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 1b67b843efa202f7ffaf6fd4f4217c7d49442346 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 09:57:46 2015 +0100 fix application directory --- tutti-ui-swing/src/main/assembly/full-windows-component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 5e84a9c..918f6fc 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -68,7 +68,7 @@ <!-- tutti component --> <fileSet> <directory>target</directory> - <outputDirectory>obsdeb</outputDirectory> + <outputDirectory>tutti</outputDirectory> <includes> <include>${project.build.finalName}.${project.packaging}</include> </includes> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit c6126b531306711070d0f5812fe4b7a9b5bb008e Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 11:35:43 2015 +0100 amelioration du code de mise à jour --- .../fr/ifremer/tutti/ui/swing/updater/Module.java | 34 ++++ .../swing/updater/RecursiveDeleteFileVisitor.java | 61 ++++++ .../fr/ifremer/tutti/ui/swing/updater/Updater.java | 225 +++++++++++++-------- 3 files changed, 234 insertions(+), 86 deletions(-) diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java new file mode 100644 index 0000000..5ecd331 --- /dev/null +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java @@ -0,0 +1,34 @@ +package fr.ifremer.tutti.ui.swing.updater; + +/** +* Created on 1/26/15. +* +* @author Tony Chemit - chemit@codelutin.com +* @since 3.12 +*/ +public enum Module { + + launcher(true), + jre(true), + + application(false), + i18n(false), + help(false), + report(false), + ichtyometer(false); + + private final boolean runtimeUpdate; + + Module(boolean runtimeUpdate) { + this.runtimeUpdate = runtimeUpdate; + } + + public boolean isRuntimeUpdate() { + return runtimeUpdate; + } + + public String getModuleLoggerName() { + String moduleNameStr = String.format("[%s$10s]", name()); + return moduleNameStr; + } +} diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java new file mode 100644 index 0000000..ccc6f7a --- /dev/null +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java @@ -0,0 +1,61 @@ +package fr.ifremer.tutti.ui.swing.updater; + +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.PathMatcher; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; + +/** + * Created on 1/26/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.12 + */ +public class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { + + public static RecursiveDeleteFileVisitor newVisitor() { + return new RecursiveDeleteFileVisitor(null); + } + + public static RecursiveDeleteFileVisitor newVisitor(Path baseDir, String glob) { + + PathMatcher matcher; + if (glob != null) { + matcher = baseDir.getFileSystem().getPathMatcher("glob:" + glob); + } else { + matcher = null; + } + return new RecursiveDeleteFileVisitor(matcher); + } + + private final PathMatcher matcher; + + protected RecursiveDeleteFileVisitor(PathMatcher matcher) { + this.matcher = matcher; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + + // If the file name matches the glob or if no matcher, delete the file + if (matcher == null || matcher.matches(file.getFileName())) { + Files.deleteIfExists(file); + } + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + + // if no matcher, delete the directory + if (matcher == null) { + Files.deleteIfExists(dir); + } + + return FileVisitResult.CONTINUE; + } + +} diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java index 54b05b4..a8904fd 100644 --- a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java @@ -5,44 +5,33 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.PathMatcher; import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.PosixFilePermission; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.Set; /** - * @author Ludovic Pecquot <ludovic.pecquot@e-is.pro> + * @author Ludovic Pecquot (ludovic.pecquot@e-is.pro) + * @author tony Chemit (chemit@codelutin.com) + * @since 3.12 */ public class Updater { - public static final String APPLICATION_UPDATER_TITLE = "Allegro Campagne UI Updater"; + public static final String APPLICATION_UPDATER_TITLE = "Allegro Campaign UI Updater"; public static final String NEW_DIR = "NEW"; public static final String OLD_DIR = "OLD"; - public static final String JRE_DIR = "jre"; - public static final String LAUNCHER_DIR = "launcher"; - public static final String APPLICATION_DIR = "tutti"; - - public static final String I18N_DIR = "i18n"; - - public static final String HELP_DIR = "help"; - - public static final String REPORT_DIR = "report"; - - public static final String ICHTYOMETER_DIR = "report"; - public static final String UPDATE_RUNTIME_CMD = "update_runtime"; public static final String BATCH_WINDOWS_EXT = ".bat"; @@ -88,8 +77,22 @@ public class Updater { } + private Path getBackupDirectory() throws IOException { + + Path backupDirectory = baseDir.resolve(OLD_DIR); + if (!Files.isDirectory(backupDirectory)) { + Files.createDirectory(backupDirectory); + } + + return backupDirectory; + + } + + public int execute() { + System.out.println("updater started at " + new Date().toString()); + int exitCode; try { @@ -117,6 +120,8 @@ public class Updater { } + System.out.println("updater ended at " + new Date().toString()); + return exitCode; } @@ -131,10 +136,23 @@ public class Updater { boolean mustUpdateRuntime = false; - if (Files.isDirectory(baseDir.resolve(NEW_DIR).resolve(JRE_DIR)) - || Files.isDirectory(baseDir.resolve(NEW_DIR).resolve(LAUNCHER_DIR))) { + for (Module module : Module.values()) { + + if (module.isRuntimeUpdate()) { + + boolean updateFound = updateRuntimeModule(module); + + if (updateFound) { + mustUpdateRuntime = true; + } + + } + + } - // A new jre or/and a new launcher is available, so generate the script + if (mustUpdateRuntime) { + + // A runtime update is available, so generate the script URL resource = getClass().getResource("/" + scriptFilename); try (InputStream stream = resource.openStream()) { @@ -143,10 +161,11 @@ public class Updater { } + makeExecutable(runtimeUpdater); + String message = String.format("Runtime updates available.\nYou must execute '%s' manually to apply new runtime.", runtimeUpdater.getFileName()); System.out.println(message); JOptionPane.showMessageDialog(null, message); - mustUpdateRuntime = true; } @@ -156,49 +175,96 @@ public class Updater { protected void launchUpdate() throws IOException { - // Compute the date to create backup directories - Date now = new Date(); + for (Module module : Module.values()) { - System.out.println("updater started at " + now.toString()); + if (!module.isRuntimeUpdate()) { - updateModule(baseDir, APPLICATION_DIR); - updateModule(baseDir, I18N_DIR); - updateModule(baseDir, HELP_DIR); - updateModule(baseDir, REPORT_DIR); - updateModule(baseDir, ICHTYOMETER_DIR); + updateModule(module); + + } + } // Cleaning process cleanObsoleteFiles(); cleanPath(baseDir.resolve(NEW_DIR)); - System.out.println("updater ended at " + new Date().toString()); + } + + protected boolean updateRuntimeModule(Module module) throws IOException { + + boolean updateFound; + String moduleName = module.name(); + + String moduleNameStr = module.getModuleLoggerName(); + + Path moduleNewPath = baseDir.resolve(NEW_DIR).resolve(moduleName); + + if (Files.isDirectory(moduleNewPath)) { + + String newVersion = getVersion(moduleNewPath); + + System.out.println(String.format("%s New version detected %s", moduleNameStr, newVersion)); + + Path backupDirectory = getBackupDirectory(); + + // Remove older backup + System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory)); + cleanPath(backupDirectory, moduleName + "-*"); + + updateFound = true; + + } else { + + System.out.println(String.format("%s No update.", moduleNameStr)); + + updateFound = false; + } + + return updateFound; } - private void updateModule(Path basePath, String moduleName) throws IOException { + private void updateModule(Module module) throws IOException { + + String moduleName = module.name(); + + String moduleNameStr = module.getModuleLoggerName(); - // Update a single module. moduleName corresponds to the name of the directory inside the basePath - Path modulePath = basePath.resolve(moduleName); - Path moduleNewPath = basePath.resolve(NEW_DIR).resolve(moduleName); + // Update a single module. moduleName corresponds to the name of the directory inside the baseDir + Path moduleNewPath = baseDir.resolve(NEW_DIR).resolve(moduleName); if (Files.isDirectory(moduleNewPath)) { + String newVersion = getVersion(moduleNewPath); + System.out.println(String.format("%s New version detected %s", moduleNameStr, newVersion)); + + Path backupDirectory = getBackupDirectory(); + + // Remove older backup + System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory)); + cleanPath(backupDirectory, moduleName + "-*"); + // Backup existing module + Path modulePath = baseDir.resolve(moduleName); if (Files.isDirectory(modulePath)) { String oldVersion = getVersion(modulePath); - Path moduleOldPath = basePath.resolve(OLD_DIR).resolve(String.format("%s-%s-%s", moduleName, oldVersion, backupDate)); - System.out.println(String.format("backup %s %s to %s", moduleName, oldVersion, moduleOldPath.toString())); - if (!Files.isDirectory(basePath.resolve(OLD_DIR))) { - Files.createDirectory(basePath.resolve(OLD_DIR)); - } + Path moduleOldPath = backupDirectory.resolve(String.format("%s-%s-%s", moduleNameStr, oldVersion, backupDate)); + System.out.println(String.format("%s Backup old version %s to %s", moduleNameStr, oldVersion, moduleOldPath.toString())); + Files.move(modulePath, moduleOldPath); } // Installing new module - System.out.println(String.format("install %s %s", moduleName, newVersion)); + System.out.println(String.format("%s Install new version %s", moduleNameStr, newVersion)); Files.move(moduleNewPath, modulePath, StandardCopyOption.REPLACE_EXISTING); + + } else { + + System.out.println(String.format("%s No update.", moduleNameStr)); + } + } private String getVersion(Path path) throws IOException { @@ -214,30 +280,55 @@ public class Updater { private void cleanPath(Path path) throws IOException { if (Files.isDirectory(path)) { - Files.walkFileTree(path, new RecursiveDeleteFileVisitor()); + Files.walkFileTree(path, RecursiveDeleteFileVisitor.newVisitor()); } } private void cleanPath(Path path, String glob) throws IOException { if (Files.isDirectory(path)) { - Files.walkFileTree(path, new RecursiveDeleteFileVisitor(glob)); + Files.walkFileTree(path, RecursiveDeleteFileVisitor.newVisitor(baseDir, glob)); + } + } + + protected void makeExecutable(Path path) throws IOException { + + if (!windowsOS) { + + Set<PosixFilePermission> perms = new HashSet<>(); + //add owners permission + perms.add(PosixFilePermission.OWNER_READ); + perms.add(PosixFilePermission.OWNER_WRITE); + perms.add(PosixFilePermission.OWNER_EXECUTE); + //add group permissions + perms.add(PosixFilePermission.GROUP_READ); + perms.add(PosixFilePermission.GROUP_WRITE); + perms.add(PosixFilePermission.GROUP_EXECUTE); + //add others permissions + perms.add(PosixFilePermission.OTHERS_READ); + perms.add(PosixFilePermission.OTHERS_EXECUTE); + + Files.setPosixFilePermissions(path, perms); + } + } private void cleanObsoleteFiles() throws IOException { + Path applicationDirectoryPath = baseDir.resolve(Module.application.name()); + if (windowsOS) { // Delete obsolete batch files Files.deleteIfExists(baseDir.resolve("tutti.bat")); - Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("launch.bat")); + Files.deleteIfExists(applicationDirectoryPath.resolve("launch.bat")); // Delete non Windows files cleanPath(baseDir, "*" + BATCH_UNIX_EXT); } else { // Delete obsolete script files - Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("launch.sh")); + Files.deleteIfExists(applicationDirectoryPath.resolve("launch.sh")); // Delete Windows files cleanPath(baseDir, "*" + BATCH_WINDOWS_EXT); @@ -245,49 +336,11 @@ public class Updater { } // Delete embedded files - Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("tutti.exe")); - Files.deleteIfExists(baseDir.resolve(APPLICATION_DIR).resolve("tutti.sh")); - cleanPath(baseDir.resolve(APPLICATION_DIR).resolve("launcher")); + Files.deleteIfExists(applicationDirectoryPath.resolve("tutti.exe")); + Files.deleteIfExists(applicationDirectoryPath.resolve("tutti.sh")); + cleanPath(applicationDirectoryPath.resolve("launcher")); } - private class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { - - PathMatcher matcher; - - public RecursiveDeleteFileVisitor() { - // no matcher == delete all - } - - public RecursiveDeleteFileVisitor(String glob) { - super(); - - // Create a matcher according the glob parameter - matcher = baseDir.getFileSystem().getPathMatcher("glob:" + glob); - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - - // If the file name matches the glob or if no matcher, delete the file - if (matcher == null || matcher.matches(file.getFileName())) { - Files.deleteIfExists(file); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - - // if no matcher, delete the directory - if (matcher == null) { - Files.deleteIfExists(dir); - } - - return FileVisitResult.CONTINUE; - } - - } - } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 008931c31b70b1a2795e32a83179941b4365d6e4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 11:48:48 2015 +0100 do not use bin classifier on launcher + fix updater dependency scope --- tutti-ui-swing/pom.xml | 3 +-- tutti-ui-swing/src/main/assembly/full-windows-component.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tutti-ui-swing/pom.xml b/tutti-ui-swing/pom.xml index 9dff5a6..dc1588b 100644 --- a/tutti-ui-swing/pom.xml +++ b/tutti-ui-swing/pom.xml @@ -114,6 +114,7 @@ <groupId>${project.groupId}</groupId> <artifactId>tutti-ui-swing-updater</artifactId> <version>${project.version}</version> + <scope>runtime</scope> </dependency> <!-- Adagio --> @@ -719,7 +720,6 @@ <artifactId>tutti-launcher</artifactId> <version>${launcherVersion}</version> <type>exe</type> - <classifier>bin</classifier> </artifactItem> </artifactItems> </configuration> @@ -804,7 +804,6 @@ <artifactId>tutti-launcher</artifactId> <version>${launcherVersion}</version> <type>exe</type> - <classifier>bin</classifier> </artifactItem> </artifactItems> </configuration> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 918f6fc..8d56f8c 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -41,7 +41,7 @@ <files> <file> - <source>${project.build.directory}/tutti-launcher-${launcherVersion}-bin.exe</source> + <source>${project.build.directory}/tutti-launcher-${launcherVersion}.exe</source> <outputDirectory/> <destName>tutti.exe</destName> </file> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 7f0238dad854d4eb80843c7d0cf07c8f2f86eb33 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 12:17:02 2015 +0100 improve code --- .../java/fr/ifremer/tutti/ui/swing/updater/Module.java | 14 +++++++------- .../java/fr/ifremer/tutti/ui/swing/updater/Updater.java | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java index 5ecd331..8a45e7d 100644 --- a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Module.java @@ -11,24 +11,24 @@ public enum Module { launcher(true), jre(true), - application(false), + tutti(false), i18n(false), help(false), report(false), ichtyometer(false); - private final boolean runtimeUpdate; + private final boolean runtimeModule; - Module(boolean runtimeUpdate) { - this.runtimeUpdate = runtimeUpdate; + Module(boolean runtimeModule) { + this.runtimeModule = runtimeModule; } - public boolean isRuntimeUpdate() { - return runtimeUpdate; + public boolean isRuntimeModule() { + return runtimeModule; } public String getModuleLoggerName() { - String moduleNameStr = String.format("[%s$10s]", name()); + String moduleNameStr = String.format("[Module %1$-20s]", name()); return moduleNameStr; } } diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java index a8904fd..ba95d2f 100644 --- a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java @@ -138,7 +138,7 @@ public class Updater { for (Module module : Module.values()) { - if (module.isRuntimeUpdate()) { + if (module.isRuntimeModule()) { boolean updateFound = updateRuntimeModule(module); @@ -177,7 +177,7 @@ public class Updater { for (Module module : Module.values()) { - if (!module.isRuntimeUpdate()) { + if (!module.isRuntimeModule()) { updateModule(module); @@ -215,7 +215,11 @@ public class Updater { } else { - System.out.println(String.format("%s No update.", moduleNameStr)); + Path modulePath = baseDir.resolve(moduleName); + + String newVersion = getVersion(modulePath); + + System.out.println(String.format("%s No update (current version: %s)", moduleNameStr, newVersion)); updateFound = false; } @@ -261,7 +265,10 @@ public class Updater { } else { - System.out.println(String.format("%s No update.", moduleNameStr)); + Path modulePath = baseDir.resolve(moduleName); + String newVersion = getVersion(modulePath); + + System.out.println(String.format("%s No update (current version: %s).", moduleNameStr, newVersion)); } @@ -315,7 +322,7 @@ public class Updater { private void cleanObsoleteFiles() throws IOException { - Path applicationDirectoryPath = baseDir.resolve(Module.application.name()); + Path applicationDirectoryPath = baseDir.resolve(Module.tutti.name()); if (windowsOS) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit e80e9eb2525cf314e423de84562c2b311386df85 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 12:17:26 2015 +0100 add report null module + fix assembly --- tutti-ui-swing/src/main/assembly/full-linux-component.xml | 11 ++++++++++- tutti-ui-swing/src/main/assembly/full-windows-component.xml | 9 +++++++++ .../src/main/assembly/{full => }/report/version.appup | 0 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml index e32da6d..c7544db 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -107,7 +107,7 @@ <excludes> <exclude>*.sh</exclude> <exclude>*.bat</exclude> - <exclude>obsdeb.config</exclude> + <exclude>tutti.config</exclude> </excludes> </fileSet> @@ -158,5 +158,14 @@ </includes> </fileSet> + <!-- REPORT component --> + <fileSet> + <directory>src/main/report</directory> + <outputDirectory>report</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + </fileSets> </component> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 8d56f8c..05ec490 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -157,5 +157,14 @@ </includes> </fileSet> + <!-- REPORT component --> + <fileSet> + <directory>src/main/report</directory> + <outputDirectory>report</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + </fileSets> </component> diff --git a/tutti-ui-swing/src/main/assembly/full/report/version.appup b/tutti-ui-swing/src/main/assembly/report/version.appup similarity index 100% rename from tutti-ui-swing/src/main/assembly/full/report/version.appup rename to tutti-ui-swing/src/main/assembly/report/version.appup -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit aec898aa651fc14f379b42cf94fe3487c24341c2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 13:33:44 2015 +0100 fix report path --- tutti-ui-swing/src/main/assembly/full-linux-component.xml | 4 ++-- tutti-ui-swing/src/main/assembly/full-windows-component.xml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml index c7544db..f0fab70 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -55,7 +55,7 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> - <include>tutti.sh</include> + <include>*.sh</include> <include>README*</include> </includes> </fileSet> @@ -160,7 +160,7 @@ <!-- REPORT component --> <fileSet> - <directory>src/main/report</directory> + <directory>src/main/assembly/report</directory> <outputDirectory>report</outputDirectory> <includes> <include>**/*</include> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 05ec490..033fc4c 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -55,6 +55,7 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> + <include>*.bat</include> <include>README*</include> </includes> </fileSet> @@ -159,7 +160,7 @@ <!-- REPORT component --> <fileSet> - <directory>src/main/report</directory> + <directory>src/main/assembly/report</directory> <outputDirectory>report</outputDirectory> <includes> <include>**/*</include> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 9ea20f1e8b983a051ee3775714e8a2d31a10cc10 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 13:34:00 2015 +0100 fix readme --- tutti-ui-swing/src/main/assembly/full/README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutti-ui-swing/src/main/assembly/full/README.txt b/tutti-ui-swing/src/main/assembly/full/README.txt index ff473e4..0212ede 100644 --- a/tutti-ui-swing/src/main/assembly/full/README.txt +++ b/tutti-ui-swing/src/main/assembly/full/README.txt @@ -3,7 +3,7 @@ Pour démarrer Allegro Campagne Saisie # Sous windows -tutti.bat +tutti.exe # Sous Linux @@ -27,4 +27,4 @@ Consulter l'aide L'aide en ligne est consultable dans l'application ou bien sur le site -http://doc.codelutin.com/tutti/help/fr/index.html +http://tutti.codelutin.com/v/latest/help/fr/index.html -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 35cd49942498ee8fdbd61dc33fdc802a02860c18 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:10:25 2015 +0100 Do not delete i18n component when updates tutti --- .../ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java index 613b613..6ccef48 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java @@ -204,14 +204,6 @@ public class TuttiApplicationUpdaterCallBack implements ApplicationUpdaterCallba TuttiConfiguration config = context.getConfig(); - //FIXME-check this is necessary: i18n is no more generated ? - // must also remove i18n directory - File i18nDirectory = context.getConfig().getI18nDirectory(); - ApplicationIOUtil.forceDeleteOnExit( - i18nDirectory, - t("tutti.applicationUpdater.updateDone.deleteDirectory.i18n.error", i18nDirectory) - ); - // must remove db cache directory File cacheDirectory = config.getCacheDirectory(); ApplicationIOUtil.forceDeleteOnExit( -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit e2a97c583e1b0d778deca578fc84b63596dc1b24 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:06 2015 +0100 improve updater code --- .../tutti/ui/swing/updater/DeleteHelper.java | 143 +++++++++++++++++++++ .../fr/ifremer/tutti/ui/swing/updater/Updater.java | 61 ++++----- 2 files changed, 169 insertions(+), 35 deletions(-) diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/DeleteHelper.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/DeleteHelper.java new file mode 100644 index 0000000..8d7bc16 --- /dev/null +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/DeleteHelper.java @@ -0,0 +1,143 @@ +package fr.ifremer.tutti.ui.swing.updater; + +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.PathMatcher; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; + +/** + * Created on 1/26/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.12 + */ +public class DeleteHelper { + + public static void deleteDirectories(Path path, String glob) throws IOException { + + PathMatcher matcher = path.getFileSystem().getPathMatcher("glob:" + glob); + if (Files.isDirectory(path)) { + + DeleteDirectories deleteDirectories = new DeleteDirectories(matcher); + Files.walkFileTree(path, deleteDirectories); + } + + } + + public static void deleteFiles(Path path, String glob) throws IOException { + if (Files.isDirectory(path)) { + + PathMatcher matcher = path.getFileSystem().getPathMatcher("glob:" + glob); + DeleteFiles deleteFiles = new DeleteFiles(matcher); + Files.walkFileTree(path, deleteFiles); + } + + } + + public static void deleteDirectory(Path path) throws IOException { + if (Files.isDirectory(path)) { + DeleteDirectory deleteDirectory = new DeleteDirectory(); + Files.walkFileTree(path, deleteDirectory); + } + } + + /** + * To delete the given directory. + */ + public static class DeleteDirectory extends SimpleFileVisitor<Path> { + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + Files.deleteIfExists(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + Files.deleteIfExists(dir); + return FileVisitResult.CONTINUE; + } + + } + + /** + * To delete all files that are matching the given matcher. + */ + public static class DeleteFiles extends SimpleFileVisitor<Path> { + + private final PathMatcher matcher; + + protected DeleteFiles(PathMatcher matcher) { + this.matcher = matcher; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + + // If the file name matches the glob or if no matcher, delete the file + if (matcher.matches(file.getFileName())) { + Files.deleteIfExists(file); + } + return FileVisitResult.CONTINUE; + } + + } + + /** + * To delete all directories which names are matching the given matcher. + */ + public static class DeleteDirectories extends SimpleFileVisitor<Path> { + + private final PathMatcher matcher; + + protected DeleteDirectories(PathMatcher matcher) { + this.matcher = matcher; + } + + private Path deleteDir; + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + + if (deleteDir == null) { + if (matcher.matches(dir.getFileName())) { + System.out.println("Match directory name to delete: " + dir); + deleteDir = dir; + } + } + return FileVisitResult.CONTINUE; + + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + + if (deleteDir != null) { + Files.deleteIfExists(file); + } + return FileVisitResult.CONTINUE; + + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + + if (deleteDir != null) { + + Files.deleteIfExists(dir); + + if (dir.equals(deleteDir)) { + deleteDir = null; + } + + } + + return FileVisitResult.CONTINUE; + + } + + } +} diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java index ba95d2f..f6d9089 100644 --- a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java +++ b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/Updater.java @@ -1,6 +1,7 @@ package fr.ifremer.tutti.ui.swing.updater; import javax.swing.JOptionPane; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -186,7 +187,7 @@ public class Updater { // Cleaning process cleanObsoleteFiles(); - cleanPath(baseDir.resolve(NEW_DIR)); + DeleteHelper.deleteDirectory(baseDir.resolve(NEW_DIR)); } @@ -195,8 +196,13 @@ public class Updater { boolean updateFound; String moduleName = module.name(); + Path modulePath = baseDir.resolve(moduleName); + String oldVersion = getVersion(modulePath); + String moduleNameStr = module.getModuleLoggerName(); + System.out.println(String.format("%s Current version: %s", moduleNameStr, oldVersion)); + Path moduleNewPath = baseDir.resolve(NEW_DIR).resolve(moduleName); if (Files.isDirectory(moduleNewPath)) { @@ -208,20 +214,16 @@ public class Updater { Path backupDirectory = getBackupDirectory(); // Remove older backup - System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory)); - cleanPath(backupDirectory, moduleName + "-*"); + System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory + File.separator + moduleName + "-*")); + DeleteHelper.deleteDirectories(backupDirectory, moduleName + "-*"); updateFound = true; } else { - Path modulePath = baseDir.resolve(moduleName); - - String newVersion = getVersion(modulePath); - - System.out.println(String.format("%s No update (current version: %s)", moduleNameStr, newVersion)); - + System.out.println(String.format("%s No update found", moduleNameStr)); updateFound = false; + } return updateFound; @@ -232,8 +234,13 @@ public class Updater { String moduleName = module.name(); + Path modulePath = baseDir.resolve(moduleName); + String oldVersion = getVersion(modulePath); + String moduleNameStr = module.getModuleLoggerName(); + System.out.println(String.format("%s Current version: %s", moduleNameStr, oldVersion)); + // Update a single module. moduleName corresponds to the name of the directory inside the baseDir Path moduleNewPath = baseDir.resolve(NEW_DIR).resolve(moduleName); @@ -246,17 +253,16 @@ public class Updater { Path backupDirectory = getBackupDirectory(); // Remove older backup - System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory)); - cleanPath(backupDirectory, moduleName + "-*"); + System.out.println(String.format("%s Clean backup directory %s", moduleNameStr, backupDirectory + File.separator + moduleName + "-*")); + DeleteHelper.deleteDirectories(backupDirectory, moduleName + "-*"); // Backup existing module - Path modulePath = baseDir.resolve(moduleName); if (Files.isDirectory(modulePath)) { - String oldVersion = getVersion(modulePath); - Path moduleOldPath = backupDirectory.resolve(String.format("%s-%s-%s", moduleNameStr, oldVersion, backupDate)); - System.out.println(String.format("%s Backup old version %s to %s", moduleNameStr, oldVersion, moduleOldPath.toString())); + Path moduleOldPath = backupDirectory.resolve(String.format("%s-%s-%s", moduleName, oldVersion, backupDate)); + System.out.println(String.format("%s Backup old version %s to %s", moduleNameStr, oldVersion, moduleOldPath.toString())); Files.move(modulePath, moduleOldPath); + } // Installing new module @@ -265,10 +271,7 @@ public class Updater { } else { - Path modulePath = baseDir.resolve(moduleName); - String newVersion = getVersion(modulePath); - - System.out.println(String.format("%s No update (current version: %s).", moduleNameStr, newVersion)); + System.out.println(String.format("%s No update found", moduleNameStr)); } @@ -285,18 +288,6 @@ public class Updater { return lines.get(0); } - private void cleanPath(Path path) throws IOException { - if (Files.isDirectory(path)) { - Files.walkFileTree(path, RecursiveDeleteFileVisitor.newVisitor()); - } - } - - private void cleanPath(Path path, String glob) throws IOException { - if (Files.isDirectory(path)) { - Files.walkFileTree(path, RecursiveDeleteFileVisitor.newVisitor(baseDir, glob)); - } - } - protected void makeExecutable(Path path) throws IOException { if (!windowsOS) { @@ -331,21 +322,21 @@ public class Updater { Files.deleteIfExists(applicationDirectoryPath.resolve("launch.bat")); // Delete non Windows files - cleanPath(baseDir, "*" + BATCH_UNIX_EXT); + DeleteHelper.deleteFiles(baseDir, "*" + BATCH_UNIX_EXT); } else { // Delete obsolete script files Files.deleteIfExists(applicationDirectoryPath.resolve("launch.sh")); // Delete Windows files - cleanPath(baseDir, "*" + BATCH_WINDOWS_EXT); - cleanPath(baseDir, "*.exe"); + DeleteHelper.deleteFiles(baseDir, "*" + BATCH_WINDOWS_EXT); + DeleteHelper.deleteFiles(baseDir, "*.exe"); } // Delete embedded files Files.deleteIfExists(applicationDirectoryPath.resolve("tutti.exe")); Files.deleteIfExists(applicationDirectoryPath.resolve("tutti.sh")); - cleanPath(applicationDirectoryPath.resolve("launcher")); + DeleteHelper.deleteDirectory(applicationDirectoryPath.resolve("launcher")); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 06fc14d17a5cd48f16a74fe553e872ec0a2fa8cb Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:31 2015 +0100 remove code --- .../swing/updater/RecursiveDeleteFileVisitor.java | 61 ---------------------- 1 file changed, 61 deletions(-) diff --git a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java b/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java deleted file mode 100644 index ccc6f7a..0000000 --- a/tutti-ui-swing-updater/src/main/java/fr/ifremer/tutti/ui/swing/updater/RecursiveDeleteFileVisitor.java +++ /dev/null @@ -1,61 +0,0 @@ -package fr.ifremer.tutti.ui.swing.updater; - -import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.PathMatcher; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; - -/** - * Created on 1/26/15. - * - * @author Tony Chemit - chemit@codelutin.com - * @since 3.12 - */ -public class RecursiveDeleteFileVisitor extends SimpleFileVisitor<Path> { - - public static RecursiveDeleteFileVisitor newVisitor() { - return new RecursiveDeleteFileVisitor(null); - } - - public static RecursiveDeleteFileVisitor newVisitor(Path baseDir, String glob) { - - PathMatcher matcher; - if (glob != null) { - matcher = baseDir.getFileSystem().getPathMatcher("glob:" + glob); - } else { - matcher = null; - } - return new RecursiveDeleteFileVisitor(matcher); - } - - private final PathMatcher matcher; - - protected RecursiveDeleteFileVisitor(PathMatcher matcher) { - this.matcher = matcher; - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - - // If the file name matches the glob or if no matcher, delete the file - if (matcher == null || matcher.matches(file.getFileName())) { - Files.deleteIfExists(file); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - - // if no matcher, delete the directory - if (matcher == null) { - Files.deleteIfExists(dir); - } - - return FileVisitResult.CONTINUE; - } - -} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 02e8bf4f74ecceed42e9c018832494cbdc4af2e4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:11:58 2015 +0100 improve assembly files --- .../src/main/assembly/full-linux-component.xml | 120 +-------------------- .../src/main/assembly/full-linux-i586.xml | 5 +- .../src/main/assembly/full-linux-x64.xml | 5 +- ...nux-component.xml => full-shared-component.xml} | 64 ++++++----- .../src/main/assembly/full-windows-component.xml | 110 +------------------ .../src/main/assembly/full-windows-i586.xml | 5 +- .../src/main/assembly/full-windows-x64.xml | 5 +- .../main/assembly/full/{ => linux}/tutti-sanity.sh | 0 .../src/main/assembly/full/{ => linux}/tutti.sh | 0 .../assembly/full/{ => windows}/tutti-sanity.bat | 0 tutti-ui-swing/src/main/assembly/min/launch.bat | 7 -- tutti-ui-swing/src/main/assembly/min/launch.sh | 7 -- tutti-ui-swing/src/main/assembly/min/update.bat | 14 --- tutti-ui-swing/src/main/assembly/min/update.sh | 12 --- tutti-ui-swing/src/main/assembly/standalone.xml | 15 --- 15 files changed, 40 insertions(+), 329 deletions(-) diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-linux-component.xml index f0fab70..4aa4cdc 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-component.xml @@ -29,16 +29,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd"> - <dependencySets> - <dependencySet> - <outputDirectory>tutti</outputDirectory> - <outputFileNameMapping>updater.jar</outputFileNameMapping> - <includes> - <include>fr.ifremer.tutti:tutti-ui-swing-updater:jar:${project.version}</include> - </includes> - </dependencySet> - </dependencySets> - <files> <file> <source>${project.build.directory}/tutti-launcher-${launcherVersion}.jar</source> @@ -50,120 +40,12 @@ <fileSets> <fileSet> - <directory>src/main/assembly/full</directory> + <directory>src/main/assembly/full/linux</directory> <outputDirectory/> <filtered>true</filtered> <fileMode>0755</fileMode> <includes> <include>*.sh</include> - <include>README*</include> - </includes> - </fileSet> - - <fileSet> - <includes> - <include>LICENSE*</include> - </includes> - </fileSet> - - <!-- TUTTI component --> - <fileSet> - <directory>target</directory> - <outputDirectory>tutti</outputDirectory> - <includes> - <include>${project.build.finalName}.${project.packaging}</include> - </includes> - </fileSet> - - <fileSet> - <directory>target/lib</directory> - <outputDirectory>tutti/lib</outputDirectory> - <includes> - <include>*.jar</include> - </includes> - <excludes> - <exclude>junit-*.jar</exclude> - <exclude>tutti-ui-swing-updater-*.jar</exclude> - </excludes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>tutti</outputDirectory> - <filtered>true</filtered> - <fileMode>0755</fileMode> - <includes> - <include>*.sh</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>tutti</outputDirectory> - <filtered>true</filtered> - <includes> - <include>*</include> - </includes> - <excludes> - <exclude>*.sh</exclude> - <exclude>*.bat</exclude> - <exclude>tutti.config</exclude> - </excludes> - </fileSet> - - <!-- Launcher component --> - <fileSet> - <directory>src/main/assembly/launcher</directory> - <outputDirectory>launcher</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <!-- I18N component --> - <fileSet> - <directory>target/classes/META-INF</directory> - <outputDirectory>i18n</outputDirectory> - <includes> - <include>tutti-i18n*.properties</include> - <include>tutti-i18n*.csv</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>i18n</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <!-- HELP component --> - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>help</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/help</directory> - <outputDirectory>help</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - - <!-- REPORT component --> - <fileSet> - <directory>src/main/assembly/report</directory> - <outputDirectory>report</outputDirectory> - <includes> - <include>**/*</include> </includes> </fileSet> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-i586.xml b/tutti-ui-swing/src/main/assembly/full-linux-i586.xml index 2cb2d4b..93aee64 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-i586.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-i586.xml @@ -32,9 +32,8 @@ </formats> <componentDescriptors> - <componentDescriptor> - src/main/assembly/full-linux-component.xml - </componentDescriptor> + <componentDescriptor>src/main/assembly/full-linux-component.xml</componentDescriptor> + <componentDescriptor>src/main/assembly/full-shared-component.xml</componentDescriptor> </componentDescriptors> <fileSets> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-x64.xml b/tutti-ui-swing/src/main/assembly/full-linux-x64.xml index 7f12a20..466b7c7 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-x64.xml +++ b/tutti-ui-swing/src/main/assembly/full-linux-x64.xml @@ -32,9 +32,8 @@ </formats> <componentDescriptors> - <componentDescriptor> - src/main/assembly/full-linux-component.xml - </componentDescriptor> + <componentDescriptor>src/main/assembly/full-linux-component.xml</componentDescriptor> + <componentDescriptor>src/main/assembly/full-shared-component.xml</componentDescriptor> </componentDescriptors> <fileSets> diff --git a/tutti-ui-swing/src/main/assembly/full-linux-component.xml b/tutti-ui-swing/src/main/assembly/full-shared-component.xml similarity index 88% copy from tutti-ui-swing/src/main/assembly/full-linux-component.xml copy to tutti-ui-swing/src/main/assembly/full-shared-component.xml index f0fab70..2f620b1 100644 --- a/tutti-ui-swing/src/main/assembly/full-linux-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-shared-component.xml @@ -11,19 +11,18 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> - <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -37,33 +36,27 @@ <include>fr.ifremer.tutti:tutti-ui-swing-updater:jar:${project.version}</include> </includes> </dependencySet> - </dependencySets> - - <files> - <file> - <source>${project.build.directory}/tutti-launcher-${launcherVersion}.jar</source> - <outputDirectory/> - <destName>launcher.jar</destName> - </file> - </files> + </dependencySets> <fileSets> <fileSet> - <directory>src/main/assembly/full</directory> - <outputDirectory/> - <filtered>true</filtered> - <fileMode>0755</fileMode> <includes> - <include>*.sh</include> - <include>README*</include> + <include>LICENSE*</include> </includes> </fileSet> <fileSet> + <directory>src/main/assembly/full</directory> + <outputDirectory>tutti</outputDirectory> + <filtered>true</filtered> <includes> - <include>LICENSE*</include> + <include>*</include> </includes> + <excludes> + <exclude>linux</exclude> + <exclude>windows</exclude> + </excludes> </fileSet> <!-- TUTTI component --> @@ -91,24 +84,9 @@ <directory>src/main/assembly/min</directory> <outputDirectory>tutti</outputDirectory> <filtered>true</filtered> - <fileMode>0755</fileMode> - <includes> - <include>*.sh</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>tutti</outputDirectory> - <filtered>true</filtered> <includes> <include>*</include> </includes> - <excludes> - <exclude>*.sh</exclude> - <exclude>*.bat</exclude> - <exclude>tutti.config</exclude> - </excludes> </fileSet> <!-- Launcher component --> @@ -167,5 +145,23 @@ </includes> </fileSet> + <!-- Ichtyometer component --> + <fileSet> + <directory>src/main/ichtyometer</directory> + <outputDirectory>ichtyometer</outputDirectory> + <includes> + <include>*</include> + </includes> + </fileSet> + + <fileSet> + <directory>src/main/assembly/min</directory> + <outputDirectory>ichtyometer</outputDirectory> + <filtered>true</filtered> + <includes> + <include>version.appup</include> + </includes> + </fileSet> + </fileSets> </component> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-component.xml b/tutti-ui-swing/src/main/assembly/full-windows-component.xml index 033fc4c..4a13b5b 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-component.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-component.xml @@ -50,120 +50,12 @@ <fileSets> <fileSet> - <directory>src/main/assembly/full</directory> + <directory>src/main/assembly/full/windows</directory> <outputDirectory/> <filtered>true</filtered> <fileMode>0755</fileMode> <includes> <include>*.bat</include> - <include>README*</include> - </includes> - </fileSet> - - <fileSet> - <includes> - <include>LICENSE*</include> - </includes> - </fileSet> - - <!-- tutti component --> - <fileSet> - <directory>target</directory> - <outputDirectory>tutti</outputDirectory> - <includes> - <include>${project.build.finalName}.${project.packaging}</include> - </includes> - </fileSet> - - <fileSet> - <directory>target/lib</directory> - <outputDirectory>tutti/lib</outputDirectory> - <includes> - <include>*.jar</include> - </includes> - <excludes> - <exclude>junit-*.jar</exclude> - <exclude>tutti-ui-swing-updater-*.jar</exclude> - </excludes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>tutti</outputDirectory> - <filtered>true</filtered> - <fileMode>0755</fileMode> - <includes> - <include>*.bat</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>tutti</outputDirectory> - <filtered>true</filtered> - <includes> - <include>*</include> - </includes> - <excludes> - <exclude>*.sh</exclude> - <exclude>*.bat</exclude> - <exclude>tutti.config</exclude> - </excludes> - </fileSet> - - <!-- Launcher component --> - <fileSet> - <directory>src/main/assembly/launcher</directory> - <outputDirectory>launcher</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <!-- I18N component --> - <fileSet> - <directory>target/classes/META-INF</directory> - <outputDirectory>i18n</outputDirectory> - <includes> - <include>tutti-i18n*.properties</include> - <include>tutti-i18n*.csv</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>i18n</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <!-- HELP component --> - <fileSet> - <directory>src/main/assembly/min</directory> - <outputDirectory>help</outputDirectory> - <filtered>true</filtered> - <includes> - <include>version.appup</include> - </includes> - </fileSet> - - <fileSet> - <directory>src/main/help</directory> - <outputDirectory>help</outputDirectory> - <includes> - <include>**/*</include> - </includes> - </fileSet> - - <!-- REPORT component --> - <fileSet> - <directory>src/main/assembly/report</directory> - <outputDirectory>report</outputDirectory> - <includes> - <include>**/*</include> </includes> </fileSet> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-i586.xml b/tutti-ui-swing/src/main/assembly/full-windows-i586.xml index f3592db..67daeff 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-i586.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-i586.xml @@ -32,9 +32,8 @@ </formats> <componentDescriptors> - <componentDescriptor> - src/main/assembly/full-windows-component.xml - </componentDescriptor> + <componentDescriptor>src/main/assembly/full-windows-component.xml</componentDescriptor> + <componentDescriptor>src/main/assembly/full-shared-component.xml</componentDescriptor> </componentDescriptors> <fileSets> diff --git a/tutti-ui-swing/src/main/assembly/full-windows-x64.xml b/tutti-ui-swing/src/main/assembly/full-windows-x64.xml index 5ccdb55..b731055 100644 --- a/tutti-ui-swing/src/main/assembly/full-windows-x64.xml +++ b/tutti-ui-swing/src/main/assembly/full-windows-x64.xml @@ -32,9 +32,8 @@ </formats> <componentDescriptors> - <componentDescriptor> - src/main/assembly/full-windows-component.xml - </componentDescriptor> + <componentDescriptor>src/main/assembly/full-windows-component.xml</componentDescriptor> + <componentDescriptor>src/main/assembly/full-shared-component.xml</componentDescriptor> </componentDescriptors> <fileSets> diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh b/tutti-ui-swing/src/main/assembly/full/linux/tutti-sanity.sh similarity index 100% rename from tutti-ui-swing/src/main/assembly/full/tutti-sanity.sh rename to tutti-ui-swing/src/main/assembly/full/linux/tutti-sanity.sh diff --git a/tutti-ui-swing/src/main/assembly/full/tutti.sh b/tutti-ui-swing/src/main/assembly/full/linux/tutti.sh similarity index 100% rename from tutti-ui-swing/src/main/assembly/full/tutti.sh rename to tutti-ui-swing/src/main/assembly/full/linux/tutti.sh diff --git a/tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat b/tutti-ui-swing/src/main/assembly/full/windows/tutti-sanity.bat similarity index 100% rename from tutti-ui-swing/src/main/assembly/full/tutti-sanity.bat rename to tutti-ui-swing/src/main/assembly/full/windows/tutti-sanity.bat diff --git a/tutti-ui-swing/src/main/assembly/min/launch.bat b/tutti-ui-swing/src/main/assembly/min/launch.bat deleted file mode 100644 index fbdb84c..0000000 --- a/tutti-ui-swing/src/main/assembly/min/launch.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -rem move embedded launcher file to tutti root -verify on -move /Y tutti\launcher launcher -move /Y tutti\tutti.exe tutti.exe -start tutti.exe diff --git a/tutti-ui-swing/src/main/assembly/min/launch.sh b/tutti-ui-swing/src/main/assembly/min/launch.sh deleted file mode 100755 index be75bd5..0000000 --- a/tutti-ui-swing/src/main/assembly/min/launch.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -echo "Move embedded script file to tutti root" -mv -f tutti/launcher . -mv tutti/tutti.sh . -chmod +x tutti.sh -./tutti.sh diff --git a/tutti-ui-swing/src/main/assembly/min/update.bat b/tutti-ui-swing/src/main/assembly/min/update.bat deleted file mode 100644 index 7fbfba8..0000000 --- a/tutti-ui-swing/src/main/assembly/min/update.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo ! ! -echo ! THE LAUNCH AND UPDATE PROCESSES HAVE BEEN CHANGED ! -echo ! PLEASE EXECUTE 'tutti.exe' ! -echo ! ! -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo ! ! -echo ! LES PROCESSUS DE DEMARRAGE ET MISE A JOUR ONT CHANGES ! -echo ! VEUILLEZ EXECUTER 'tutti.exe' ! -echo ! ! -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -pause \ No newline at end of file diff --git a/tutti-ui-swing/src/main/assembly/min/update.sh b/tutti-ui-swing/src/main/assembly/min/update.sh deleted file mode 100644 index 9adea09..0000000 --- a/tutti-ui-swing/src/main/assembly/min/update.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo ! ! -echo ! THE LAUNCH AND UPDATE PROCESSES HAVE BEEN CHANGED ! -echo ! PLEASE EXECUTE './tutti.sh' ! -echo ! ! -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -echo ! ! -echo ! LES PROCESSUS DE DEMARRAGE ET MISE A JOUR ONT CHANGES ! -echo ! VEUILLEZ EXECUTER './tutti.sh' ! -echo ! ! -echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \ No newline at end of file diff --git a/tutti-ui-swing/src/main/assembly/standalone.xml b/tutti-ui-swing/src/main/assembly/standalone.xml index efb16d7..4431d52 100644 --- a/tutti-ui-swing/src/main/assembly/standalone.xml +++ b/tutti-ui-swing/src/main/assembly/standalone.xml @@ -57,21 +57,6 @@ <filtered>true</filtered> <fileMode>0755</fileMode> <includes> - <include>launcher.properties</include> - <include>launch.sh</include> - <include>launch.bat</include> - <include>update.sh</include> - <include>update.bat</include> - <include>version.appup</include> - </includes> - </fileSet> - - <!--add embedded launcher directory (TODO :should be removed in further version)--> - <fileSet> - <directory>src/main/assembly/launcher</directory> - <outputDirectory>launcher</outputDirectory> - <filtered>true</filtered> - <includes> <include>*</include> </includes> </fileSet> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 416435ef854088c50585f8bb805b24d056e30d08 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 17:49:53 2015 +0100 use tutti-launcher 1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3bedd44..9f36e3b 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ <jreVersion>1.7.72</jreVersion> <!-- Last launcher version --> - <launcherVersion>1.0-SNAPSHOT</launcherVersion> + <launcherVersion>1.0</launcherVersion> <!-- Where are deployed software components --> <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases</distroUrl> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 06037f2be6a1944baf87856b903058a4cf64ba58 Merge: 410b9db 416435e Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 26 18:22:53 2015 +0100 merge 6376 to develop pom.xml | 22 ++ src/update/tutti-application.properties | 15 +- .../java/fr/ifremer/tutti/TuttiConfiguration.java | 6 + tutti-ui-swing-updater/LICENSE.txt | 0 tutti-ui-swing-updater/README.txt | 0 tutti-ui-swing-updater/pom.xml | 70 +++++ .../tutti/ui/swing/updater/DeleteHelper.java | 143 +++++++++ .../fr/ifremer/tutti/ui/swing/updater/Module.java | 34 ++ .../fr/ifremer/tutti/ui/swing/updater/Updater.java | 344 +++++++++++++++++++++ .../src/main/resources/update_runtime.bat | 31 ++ .../src/main/resources/update_runtime.sh | 36 +++ tutti-ui-swing/pom.xml | 76 +++++ ...ull-linux-i586.xml => full-linux-component.xml} | 43 +-- .../src/main/assembly/full-linux-i586.xml | 5 +- .../src/main/assembly/full-linux-x64.xml | 5 +- ...ull-component.xml => full-shared-component.xml} | 86 ++++-- .../src/main/assembly/full-windows-component.xml | 63 ++++ .../src/main/assembly/full-windows-i586.xml | 5 +- .../src/main/assembly/full-windows-x64.xml | 5 +- tutti-ui-swing/src/main/assembly/full/README.txt | 4 +- .../src/main/assembly/full/linux/tutti-sanity.sh | 10 + .../src/main/assembly/full/linux/tutti.sh | 10 + .../src/main/assembly/full/tutti-sanity.bat | 44 --- .../src/main/assembly/full/tutti-sanity.sh | 41 --- tutti-ui-swing/src/main/assembly/full/tutti.bat | 44 --- tutti-ui-swing/src/main/assembly/full/tutti.sh | 41 --- .../main/assembly/full/windows/tutti-sanity.bat | 3 + .../src/main/assembly/launcher/version.appup | 1 + tutti-ui-swing/src/main/assembly/min/launch.bat | 10 - tutti-ui-swing/src/main/assembly/min/launch.sh | 15 - .../src/main/assembly/min/launcher.properties | 26 ++ tutti-ui-swing/src/main/assembly/min/update.bat | 84 ----- tutti-ui-swing/src/main/assembly/min/update.sh | 74 ----- .../main/assembly/{full => }/report/version.appup | 0 tutti-ui-swing/src/main/assembly/standalone.xml | 6 +- .../ui/swing/TuttiApplicationUpdaterCallBack.java | 8 - 36 files changed, 978 insertions(+), 432 deletions(-) diff --cc pom.xml index 2b72235,9f36e3b..fc632be --- a/pom.xml +++ b/pom.xml @@@ -156,7 -156,14 +157,13 @@@ <!-- Last JRE version to use --> <jreVersion>1.7.72</jreVersion> + <!-- Last launcher version --> + <launcherVersion>1.0</launcherVersion> + + <!-- Where are deployed software components --> + <distroUrl>http://nexus.nuiton.org/nexus/content/repositories/other-releases</distroUrl> + - <autoVersionSubmodules>false</autoVersionSubmodules> - + <xmlApisVersion>1.3.04</xmlApisVersion> </properties> <repositories> @@@ -873,6 -794,7 +886,7 @@@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> - <version>1.0</version> ++ <version>1.0-beta-4</version> <executions> <execution> <id>deploy tutti-application.properties</id> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm