svn-gvsig-desktop / tags / org.gvsig.desktop-2.0.30 / org.gvsig.desktop.installer / pom.xml
History | View | Annotate | Download (10.3 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 | 41222 | jjdelcerro | def getVersionWithBuildNumber(pakageinfo) { |
67 | 41271 | jjdelcerro | return pakageinfo.getProperty("version")+"-"+pakageinfo.getProperty("buildNumber") |
68 | 41222 | jjdelcerro | } |
69 | |||
70 | def getVersionWithoutBuildNumber(pakageinfo) { |
||
71 | 41271 | jjdelcerro | return pakageinfo.getProperty("version") // .replaceFirst("-[0-9]*\$","") |
72 | 41222 | jjdelcerro | } |
73 | |||
74 | |||
75 | 40538 | jjdelcerro | ant = new AntBuilder() |
76 | log.info("For create windows launchers launch4j is requiered in the PATH. In linux link launch4j to launch4jc.") |
||
77 | log.info("For create installer InstallJammer is required in the PATH.") |
||
78 | 40531 | jjdelcerro | |
79 | 40538 | jjdelcerro | installation_folder = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop" |
80 | pool_folder = project.basedir.getAbsolutePath()+"/target/pool.d" |
||
81 | new File(installation_folder).mkdirs() |
||
82 | new File(pool_folder,"pool").mkdirs() |
||
83 | 40435 | jjdelcerro | |
84 | 40538 | jjdelcerro | gvsig_product_folder_path = project.properties["gvsig.product.folder.path"] |
85 | 40435 | jjdelcerro | |
86 | 40497 | jjdelcerro | |
87 | 40538 | jjdelcerro | log.info("Getting a local copy of product folder...") |
88 | ant.copy( todir: installation_folder ) { |
||
89 | fileset( dir: gvsig_product_folder_path ) |
||
90 | } |
||
91 | gvsig_product_folder_path = installation_folder |
||
92 | 40535 | jjdelcerro | |
93 | 40538 | jjdelcerro | |
94 | log.info("Populate the pool folder...") |
||
95 | ant.move( todir: pool_folder + "/pool" ) { |
||
96 | fileset( dir: installation_folder + "/install/" ) |
||
97 | } |
||
98 | new File(installation_folder,"install").mkdirs() |
||
99 | |||
100 | log.info("Preparing basic package set (gvspks)...") |
||
101 | gvspks_folder = new File(project.basedir,"target/gvspks") |
||
102 | gvspks_folder.mkdirs() |
||
103 | filenames = new FileNameFinder().getFileNames(pool_folder,"**/*.gvspkg") |
||
104 | for( filename in filenames ) { |
||
105 | file = new File(filename) |
||
106 | ant.copy(file:filename, todir:gvspks_folder.getAbsolutePath()) |
||
107 | } |
||
108 | 40598 | jjdelcerro | ant.copy(file:"src/main/config/defaultPackages", todir:gvspks_folder.getAbsolutePath()) |
109 | 40538 | jjdelcerro | |
110 | log.info("Finding andami updater jar...") |
||
111 | org_gvsig_andami_updater_jar = new FileNameFinder().getFileNames( |
||
112 | gvsig_product_folder_path+"/lib", |
||
113 | 'org.gvsig.andami.updater-*.jar' |
||
114 | )[0] |
||
115 | 40542 | jjdelcerro | if( org_gvsig_andami_updater_jar == null ) { |
116 | log.error("Can't find andami updater jar") |
||
117 | assert false |
||
118 | } |
||
119 | 40538 | jjdelcerro | org_gvsig_andami_updater_jar = new File(org_gvsig_andami_updater_jar).getName() |
120 | log.info("Found andami updater :"+org_gvsig_andami_updater_jar) |
||
121 | |||
122 | File file = new File(gvsig_product_folder_path + "/gvSIG/extensiones/org.gvsig.app.mainplugin/package.info") |
||
123 | log.info("Loading package.info - " + file.getAbsolutePath()) |
||
124 | pakageinfo = new Properties() |
||
125 | pakageinfo.load(file.newDataInputStream()) |
||
126 | |||
127 | 41271 | jjdelcerro | log.info("Creating gvsig-desktop.exe windows launcher...") |
128 | 40538 | jjdelcerro | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop.xml" |
129 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-desktop.xml" |
130 | 40538 | jjdelcerro | s = new File(source).text |
131 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
132 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
133 | 41222 | jjdelcerro | s = s.replaceAll("@@version@@", getVersionWithBuildNumber(pakageinfo).replace("-",".")) |
134 | 40538 | jjdelcerro | new File(target).write(s) |
135 | log.info("Created "+target) |
||
136 | ant.exec( command:"launch4jc "+ target ) |
||
137 | log.info("Created gvsig-desktop.exe windows launcher.") |
||
138 | |||
139 | log.info("Creating gvsig-desktop-devel.exe windows launcher...") |
||
140 | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop-devel.xml" |
||
141 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-desktop-devel.xml" |
142 | 40538 | jjdelcerro | s = new File(source).text |
143 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
144 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
145 | 41222 | jjdelcerro | s = s.replaceAll("@@version@@", getVersionWithBuildNumber(pakageinfo).replace("-",".")) |
146 | 40538 | jjdelcerro | new File(target).write(s) |
147 | log.info("Created "+target) |
||
148 | ant.exec( command:"launch4jc "+ target ) |
||
149 | log.info("Created gvsig-desktop-devel.exe windows launcher") |
||
150 | |||
151 | log.info("Creating gvsig-package-installer.exe windows launcher...") |
||
152 | source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-package-installer.xml" |
||
153 | 40890 | jjdelcerro | target = project.basedir.getAbsolutePath()+"/target/product/gvsig-desktop/gvsig-package-installer.xml" |
154 | 40538 | jjdelcerro | s = new File(source).text |
155 | s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path) |
||
156 | s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar) |
||
157 | 41222 | jjdelcerro | s = s.replaceAll("@@version@@", getVersionWithBuildNumber(pakageinfo).replace("-",".")) |
158 | 40538 | jjdelcerro | new File(target).write(s) |
159 | log.info("Created "+target) |
||
160 | ant.exec( command:"launch4jc "+ target ) |
||
161 | log.info("Created gvsig-package-installer.exe windows launcher") |
||
162 | |||
163 | jre_pkg_name = "gvSIG-desktop-2.0.0-jre_6_windows_i586-1.6.26-0-devel-win-x86-j1_6.gvspkg" |
||
164 | url = "http://downloads.gvsig.org/download/gvsig-desktop/pool/jre_6_windows_i586/" + jre_pkg_name |
||
165 | target = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name |
||
166 | 40581 | jjdelcerro | if(! new File(target).exists() ) { |
167 | if( project.properties["jre.path"]!=null ) { |
||
168 | if( project.properties["jre.path"].endsWith(".gvspkg") ) { |
||
169 | source = project.properties["jre.path"] |
||
170 | } else { |
||
171 | source = project.properties["jre.path"] + "/" + jre_pkg_name |
||
172 | } |
||
173 | if (source.startsWith("~" + File.separator)) { |
||
174 | source = System.getenv().get("HOME") + source.substring(1); |
||
175 | } |
||
176 | if( ! new File(source).exists() ) { |
||
177 | log.info("jre specified in jre.path variable not found - "+source) |
||
178 | log.info("Downloading windows jre plugin") |
||
179 | ant.get(src: url, dest: target) |
||
180 | } else { |
||
181 | log.info("Copy windows jre plugin") |
||
182 | ant.copy(file:source, todir:project.basedir.getAbsolutePath() + "/target/") |
||
183 | } |
||
184 | } else { |
||
185 | log.info("Downloading windows jre plugin") |
||
186 | ant.get(src: url, dest: target) |
||
187 | } |
||
188 | 40538 | jjdelcerro | } else { |
189 | log.info("Skip download of jre, it exist in local filesystem.") |
||
190 | } |
||
191 | 40842 | jjdelcerro | |
192 | log.info("Download busybox.exe.") |
||
193 | ant.get(src: "http://downloads.gvsig.org/download/gvsig-desktop/runtimes/winutils/busybox.exe", dest: gvsig_product_folder_path+"/busybox.exe") |
||
194 | 40538 | jjdelcerro | |
195 | source = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name |
||
196 | target = gvsig_product_folder_path + "/gvSIG/extensiones/" |
||
197 | log.info("Installing plugin windows jre plugin to " + target + "...") |
||
198 | ant.unzip(src: source, dest: target) |
||
199 | log.info("jre installed.") |
||
200 | |||
201 | log.info("Building zip installer...") |
||
202 | source = project.basedir.getAbsolutePath()+"/target/product" |
||
203 | target = project.basedir.getAbsolutePath() + |
||
204 | "/target/gvSIG-desktop-" + |
||
205 | 41222 | jjdelcerro | getVersionWithBuildNumber(pakageinfo) + "-" + |
206 | 40538 | jjdelcerro | pakageinfo.getProperty("state") + "-all-x86-online.zip" |
207 | ant.zip(destfile: target, basedir: source) |
||
208 | |||
209 | log.info("Building pool zip...") |
||
210 | source = project.basedir.getAbsolutePath()+"/target/pool.d" |
||
211 | target = project.basedir.getAbsolutePath() + |
||
212 | "/target/gvSIG-desktop-" + |
||
213 | 41222 | jjdelcerro | getVersionWithBuildNumber(pakageinfo) + "-" + |
214 | 40538 | jjdelcerro | pakageinfo.getProperty("state") + "-all-all-pool.zip" |
215 | ant.zip(destfile: target, basedir: source) |
||
216 | |||
217 | log.info("Building basic package-set (gvspks)...") |
||
218 | source = project.basedir.getAbsolutePath()+"/target/gvspks" |
||
219 | target = project.basedir.getAbsolutePath() + |
||
220 | "/target/gvSIG-desktop-" + |
||
221 | 41222 | jjdelcerro | getVersionWithBuildNumber(pakageinfo) + "-" + |
222 | 40538 | jjdelcerro | pakageinfo.getProperty("state") + "-all-all.gvspks" |
223 | ant.zip(destfile: target, basedir: source) |
||
224 | |||
225 | |||
226 | cmd = [ "installjammer" , |
||
227 | "--output-dir", project.basedir.getAbsolutePath() + "/target", |
||
228 | "-DBaseDir", gvsig_product_folder_path, |
||
229 | 41222 | jjdelcerro | "-DVersion", getVersionWithoutBuildNumber(pakageinfo), |
230 | "-DInstallVersion", getVersionWithoutBuildNumber(pakageinfo), |
||
231 | 40538 | jjdelcerro | "-DDevelState", pakageinfo.getProperty("state"), |
232 | "-DBuildVersion", pakageinfo.getProperty("buildNumber"), |
||
233 | "--build-for-release", |
||
234 | "--build-dir", project.basedir.getAbsolutePath() + "/target/installjammer", |
||
235 | "--build-log-file", project.basedir.getAbsolutePath() + "/target/installjammer.log", |
||
236 | "--verbose", |
||
237 | "--build", |
||
238 | project.basedir.getAbsolutePath() + "/src/main/installjammer/gvsig-standard-installer.mpi" |
||
239 | ] |
||
240 | log.info("Launching InstallJammer - " + cmd.join(" ") ) |
||
241 | ant.exec( command: cmd.join(" ") ) |
||
242 | |||
243 | 40497 | jjdelcerro | ]]></source> |
244 | </configuration>
|
||
245 | </execution>
|
||
246 | 40435 | jjdelcerro | </executions>
|
247 | </plugin>
|
||
248 | </plugins>
|
||
249 | </build>
|
||
250 | 40497 | jjdelcerro | |
251 | 40538 | jjdelcerro | </project> |