svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.installer / pom.xml @ 41203
History | View | Annotate | Download (10.2 KB)
1 | 40435 | jjdelcerro | <?xml version="1.0" encoding="UTF-8"?>
|
---|---|---|---|
2 | 40497 | jjdelcerro | <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"> |
3 | 40435 | jjdelcerro | |
4 | 40531 | jjdelcerro | <modelVersion>4.0.0</modelVersion> |
5 | <groupId>org.gvsig</groupId> |
||
6 | <artifactId>org.gvsig.desktop.installer</artifactId> |
||
7 | <version>1.0.0</version> |
||
8 | <packaging>pom</packaging> |
||
9 | <name>${project.artifactId}</name> |
||
10 | 40435 | jjdelcerro | |
11 | <build>
|
||
12 | 40531 | jjdelcerro | |
13 | <pluginManagement>
|
||
14 | <plugins>
|
||
15 | |||
16 | <plugin>
|
||
17 | <groupId>org.codehaus.gmaven</groupId> |
||
18 | <artifactId>gmaven-plugin</artifactId> |
||
19 | <version>1.4</version> |
||
20 | </plugin>
|
||
21 | |||
22 | <plugin>
|
||
23 | <groupId>org.codehaus.mojo</groupId> |
||
24 | <artifactId>properties-maven-plugin</artifactId> |
||
25 | <version>1.0-alpha-2</version> |
||
26 | </plugin>
|
||
27 | |||
28 | </plugins>
|
||
29 | </pluginManagement>
|
||
30 | |||
31 | 40435 | jjdelcerro | <plugins>
|
32 | <plugin>
|
||
33 | <groupId>org.codehaus.mojo</groupId> |
||
34 | <artifactId>properties-maven-plugin</artifactId> |
||
35 | <executions>
|
||
36 | <execution>
|
||
37 | <phase>install</phase> |
||
38 | <goals>
|
||
39 | <goal>read-project-properties</goal> |
||
40 | </goals>
|
||
41 | <configuration>
|
||
42 | <files>
|
||
43 | 40538 | jjdelcerro | <!-- Define gvsig.product.folder.path in this property -->
|
44 | 40581 | jjdelcerro | <file>${env.HOME}/.gvsig-devel.properties</file> |
45 | 40538 | jjdelcerro | <file>${project.basedir}/gvsig-devel.properties</file> |
46 | 40435 | jjdelcerro | </files>
|
47 | 40531 | jjdelcerro | <quiet>true</quiet> |
48 | 40435 | jjdelcerro | </configuration>
|
49 | </execution>
|
||
50 | </executions>
|
||
51 | </plugin>
|
||
52 | 40497 | jjdelcerro | |
53 | 40435 | jjdelcerro | <plugin>
|
54 | 40497 | jjdelcerro | <groupId>org.codehaus.gmaven</groupId> |
55 | <artifactId>gmaven-plugin</artifactId> |
||
56 | 40538 | jjdelcerro | <inherited>false</inherited> |
57 | 40435 | jjdelcerro | <executions>
|
58 | 40497 | jjdelcerro | <execution>
|
59 | <id>release</id> |
||
60 | <phase>install</phase> |
||
61 | <goals>
|
||
62 | <goal>execute</goal> |
||
63 | </goals>
|
||
64 | <configuration>
|
||
65 | <source><![CDATA[ |
||
66 | 40581 | jjdelcerro | |
67 | 40538 | jjdelcerro | ant = new AntBuilder() |
68 | log.info("For create windows launchers launch4j is requiered in the PATH. In linux link launch4j to launch4jc.") |
||
69 | log.info("For create installer InstallJammer is required in the PATH.") |
||
70 | 40531 | jjdelcerro | |
71 | 40538 | jjdelcerro | installation_folder = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop" |
72 | pool_folder = project.basedir.getAbsolutePath()+"/target/pool.d" |
||
73 | new File(installation_folder).mkdirs() |
||
74 | new File(pool_folder,"pool").mkdirs() |
||
75 | 40435 | jjdelcerro | |
76 | 40538 | jjdelcerro | gvsig_product_folder_path = project.properties["gvsig.product.folder.path"] |
77 | 40435 | jjdelcerro | |
78 | 40497 | jjdelcerro | |
79 | 40538 | jjdelcerro | log.info("Getting a local copy of product folder...") |
80 | ant.copy( todir: installation_folder ) { |
||
81 | fileset( dir: gvsig_product_folder_path ) |
||
82 | } |
||
83 | gvsig_product_folder_path = installation_folder |
||
84 | 40535 | jjdelcerro | |
85 | 40538 | jjdelcerro | |
86 | log.info("Populate the pool folder...") |
||
87 | ant.move( todir: pool_folder + "/pool" ) { |
||
88 | fileset( dir: installation_folder + "/install/" ) |
||
89 | } |
||
90 | new File(installation_folder,"install").mkdirs() |
||
91 | |||
92 | log.info("Preparing basic package set (gvspks)...") |
||
93 | gvspks_folder = new File(project.basedir,"target/gvspks") |
||
94 | gvspks_folder.mkdirs() |
||
95 | filenames = new FileNameFinder().getFileNames(pool_folder,"**/*.gvspkg") |
||
96 | for( filename in filenames ) { |
||
97 | file = new File(filename) |
||
98 | ant.copy(file:filename, todir:gvspks_folder.getAbsolutePath()) |
||
99 | } |
||
100 | 40598 | jjdelcerro | ant.copy(file:"src/main/config/defaultPackages", todir:gvspks_folder.getAbsolutePath()) |
101 | 40538 | jjdelcerro | |
102 | log.info("Finding andami updater jar...") |
||
103 | org_gvsig_andami_updater_jar = new FileNameFinder().getFileNames( |
||
104 | gvsig_product_folder_path+"/lib", |
||
105 | 'org.gvsig.andami.updater-*.jar' |
||
106 | )[0] |
||
107 | 40542 | jjdelcerro | if( org_gvsig_andami_updater_jar == null ) { |
108 | log.error("Can't find andami updater jar") |
||
109 | assert false |
||
110 | } |
||
111 | 40538 | jjdelcerro | org_gvsig_andami_updater_jar = new File(org_gvsig_andami_updater_jar).getName() |
112 | log.info("Found andami updater :"+org_gvsig_andami_updater_jar) |
||
113 | |||
114 | File file = new File(gvsig_product_folder_path + "/gvSIG/extensiones/org.gvsig.app.mainplugin/package.info") |
||
115 | log.info("Loading package.info - " + file.getAbsolutePath()) |
||
116 | pakageinfo = new Properties() |
||
117 | pakageinfo.load(file.newDataInputStream()) |
||
118 | |||
119 | 40598 | jjdelcerro | log.info("Creating gvsig-desktdefaultPackagesop.exe windows launcher...") |
120 | 40538 | jjdelcerro | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop.xml" |
121 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-desktop.xml" |
122 | 40538 | jjdelcerro | s = new File(source).text |
123 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
124 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
125 | s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber")) |
||
126 | new File(target).write(s) |
||
127 | log.info("Created "+target) |
||
128 | ant.exec( command:"launch4jc "+ target ) |
||
129 | log.info("Created gvsig-desktop.exe windows launcher.") |
||
130 | |||
131 | log.info("Creating gvsig-desktop-devel.exe windows launcher...") |
||
132 | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop-devel.xml" |
||
133 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-desktop-devel.xml" |
134 | 40538 | jjdelcerro | s = new File(source).text |
135 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
136 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
137 | s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber")) |
||
138 | new File(target).write(s) |
||
139 | log.info("Created "+target) |
||
140 | ant.exec( command:"launch4jc "+ target ) |
||
141 | log.info("Created gvsig-desktop-devel.exe windows launcher") |
||
142 | |||
143 | log.info("Creating gvsig-package-installer.exe windows launcher...") |
||
144 | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-package-installer.xml" |
||
145 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-package-installer.xml" |
146 | 40538 | jjdelcerro | s = new File(source).text |
147 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
148 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
149 | s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber")) |
||
150 | new File(target).write(s) |
||
151 | log.info("Created "+target) |
||
152 | ant.exec( command:"launch4jc "+ target ) |
||
153 | log.info("Created gvsig-package-installer.exe windows launcher") |
||
154 | |||
155 | jre_pkg_name = "gvSIG-desktop-2.0.0-jre_6_windows_i586-1.6.26-0-devel-win-x86-j1_6.gvspkg" |
||
156 | url = "http://downloads.gvsig.org/download/gvsig-desktop/pool/jre_6_windows_i586/" + jre_pkg_name |
||
157 | target = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name |
||
158 | 40581 | jjdelcerro | if(! new File(target).exists() ) { |
159 | if( project.properties["jre.path"]!=null ) { |
||
160 | if( project.properties["jre.path"].endsWith(".gvspkg") ) { |
||
161 | source = project.properties["jre.path"] |
||
162 | } else { |
||
163 | source = project.properties["jre.path"] + "/" + jre_pkg_name |
||
164 | } |
||
165 | if (source.startsWith("~" + File.separator)) { |
||
166 | source = System.getenv().get("HOME") + source.substring(1); |
||
167 | } |
||
168 | if( ! new File(source).exists() ) { |
||
169 | log.info("jre specified in jre.path variable not found - "+source) |
||
170 | log.info("Downloading windows jre plugin") |
||
171 | ant.get(src: url, dest: target) |
||
172 | } else { |
||
173 | log.info("Copy windows jre plugin") |
||
174 | ant.copy(file:source, todir:project.basedir.getAbsolutePath() + "/target/") |
||
175 | } |
||
176 | } else { |
||
177 | log.info("Downloading windows jre plugin") |
||
178 | ant.get(src: url, dest: target) |
||
179 | } |
||
180 | 40538 | jjdelcerro | } else { |
181 | log.info("Skip download of jre, it exist in local filesystem.") |
||
182 | } |
||
183 | 40842 | jjdelcerro | |
184 | log.info("Download busybox.exe.") |
||
185 | ant.get(src: "http://downloads.gvsig.org/download/gvsig-desktop/runtimes/winutils/busybox.exe", dest: gvsig_product_folder_path+"/busybox.exe") |
||
186 | 40538 | jjdelcerro | |
187 | source = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name |
||
188 | target = gvsig_product_folder_path + "/gvSIG/extensiones/" |
||
189 | log.info("Installing plugin windows jre plugin to " + target + "...") |
||
190 | ant.unzip(src: source, dest: target) |
||
191 | log.info("jre installed.") |
||
192 | |||
193 | log.info("Building zip installer...") |
||
194 | source = project.basedir.getAbsolutePath()+"/target/product" |
||
195 | target = project.basedir.getAbsolutePath() + |
||
196 | "/target/gvSIG-desktop-" + |
||
197 | pakageinfo.getProperty("version") + "-" + |
||
198 | pakageinfo.getProperty("buildNumber") + "-" + |
||
199 | pakageinfo.getProperty("state") + "-all-x86-online.zip" |
||
200 | ant.zip(destfile: target, basedir: source) |
||
201 | |||
202 | log.info("Building pool zip...") |
||
203 | source = project.basedir.getAbsolutePath()+"/target/pool.d" |
||
204 | target = project.basedir.getAbsolutePath() + |
||
205 | "/target/gvSIG-desktop-" + |
||
206 | pakageinfo.getProperty("version") + "-" + |
||
207 | pakageinfo.getProperty("buildNumber") + "-" + |
||
208 | pakageinfo.getProperty("state") + "-all-all-pool.zip" |
||
209 | ant.zip(destfile: target, basedir: source) |
||
210 | |||
211 | log.info("Building basic package-set (gvspks)...") |
||
212 | source = project.basedir.getAbsolutePath()+"/target/gvspks" |
||
213 | target = project.basedir.getAbsolutePath() + |
||
214 | "/target/gvSIG-desktop-" + |
||
215 | pakageinfo.getProperty("version") + "-" + |
||
216 | pakageinfo.getProperty("buildNumber") + "-" + |
||
217 | pakageinfo.getProperty("state") + "-all-all.gvspks" |
||
218 | ant.zip(destfile: target, basedir: source) |
||
219 | |||
220 | |||
221 | cmd = [ "installjammer" , |
||
222 | "--output-dir", project.basedir.getAbsolutePath() + "/target", |
||
223 | "-DBaseDir", gvsig_product_folder_path, |
||
224 | "-DVersion", pakageinfo.getProperty("version"), |
||
225 | "-DInstallVersion", pakageinfo.getProperty("version"), |
||
226 | "-DDevelState", pakageinfo.getProperty("state"), |
||
227 | "-DBuildVersion", pakageinfo.getProperty("buildNumber"), |
||
228 | "--build-for-release", |
||
229 | "--build-dir", project.basedir.getAbsolutePath() + "/target/installjammer", |
||
230 | "--build-log-file", project.basedir.getAbsolutePath() + "/target/installjammer.log", |
||
231 | "--verbose", |
||
232 | "--build", |
||
233 | project.basedir.getAbsolutePath() + "/src/main/installjammer/gvsig-standard-installer.mpi" |
||
234 | ] |
||
235 | log.info("Launching InstallJammer - " + cmd.join(" ") ) |
||
236 | ant.exec( command: cmd.join(" ") ) |
||
237 | |||
238 | 40497 | jjdelcerro | ]]></source> |
239 | </configuration>
|
||
240 | </execution>
|
||
241 | 40435 | jjdelcerro | </executions>
|
242 | </plugin>
|
||
243 | </plugins>
|
||
244 | </build>
|
||
245 | 40497 | jjdelcerro | |
246 | 40538 | jjdelcerro | </project> |