Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.installer / pom.xml @ 40535

History | View | Annotate | Download (7.55 KB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<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

    
4
        <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

    
11
  <build>
12
  
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
      <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
                                      <!-- Define gvsig.product.folder.path in this property -->
44
                                      <file>${user.home}/.gvsig-devel.properties</file>
45
                                      <file>${project.basedir}/gvsig-devel.properties</file>
46
                          </files>
47
                          <quiet>true</quiet>
48
                      </configuration>
49
                  </execution>
50
              </executions>
51
          </plugin>
52
          
53
          <plugin>
54
              <groupId>org.codehaus.gmaven</groupId>
55
              <artifactId>gmaven-plugin</artifactId>
56
                          <inherited>false</inherited>
57
              <executions>
58
                <execution>
59
                  <id>release</id>
60
                  <phase>install</phase>
61
                  <goals>
62
                    <goal>execute</goal>
63
                  </goals>
64
                  <configuration>
65
                    <source><![CDATA[
66
                      ant = new AntBuilder()
67
                                          log.info("For create windows launchers launch4j is requiered in the PATH. In linux link launch4j to launch4jc.")
68
                                          log.info("For create installer InstallJammer is required in the PATH.")
69

    
70
                      new File(project.basedir,"target").mkdirs()
71
                      
72
                      gvsig_product_folder_path = project.properties["gvsig.product.folder.path"]
73
                                          org_gvsig_andami_updater_jar = new FileNameFinder().getFileNames(gvsig_product_folder_path+"/lib",'org.gvsig.andami.updater-*.jar')[0]
74
                                          org_gvsig_andami_updater_jar = new File(org_gvsig_andami_updater_jar).getName()
75
                      
76
                      File file = new File(gvsig_product_folder_path + "/gvSIG/extensiones/org.gvsig.app.mainplugin/package.info")
77
                      log.info("Loading package.info - " + file.getAbsolutePath())
78
                      pakageinfo = new Properties()
79
                      pakageinfo.load(file.newDataInputStream())
80

    
81
                                          source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop.xml"
82
                                          target = project.basedir.getAbsolutePath()+"/target/gvsig-desktop.xml"
83
                                          s = new File(source).text
84
                                          s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path)
85
                                          s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar)
86
                                          s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber"))
87
                      new File(target).write(s)
88
                                          log.info("Created "+target)
89
                                          ant.exec( command:"launch4jc "+ target )
90
                                          log.info("Created gvsig-desktop.exe windows launcher.")
91

    
92
                                          source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-desktop-devel.xml"
93
                                          target = project.basedir.getAbsolutePath()+"/target/gvsig-desktop-devel.xml"
94
                                          s = new File(source).text
95
                                          s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path)
96
                                          s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar)
97
                                          s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber"))
98
                      new File(target).write(s)
99
                                          log.info("Created "+target)
100
                                          ant.exec( command:"launch4jc "+ target )
101
                                          log.info("Created gvsig-desktop-devel.exe windows launcher")
102

    
103
                                          source = project.basedir.getAbsolutePath()+"/src/main/launch4j/gvsig-package-installer.xml"
104
                                          target = project.basedir.getAbsolutePath()+"/target/gvsig-package-installer.xml"
105
                                          s = new File(source).text
106
                                          s = s.replaceAll("@@gvsig.product.folder.path@@", gvsig_product_folder_path)
107
                                          s = s.replaceAll("@@org.gvsig.andami.updater.jar@@", org_gvsig_andami_updater_jar)
108
                                          s = s.replaceAll("@@version@@", pakageinfo.getProperty("version")+"."+pakageinfo.getProperty("buildNumber"))
109
                      new File(target).write(s)
110
                                          log.info("Created "+target)
111
                                          ant.exec( command:"launch4jc "+ target )
112
                                          log.info("Created gvsig-package-installer.exe windows launcher")
113

    
114
                                          jre_pkg_name = "gvSIG-desktop-2.0.0-jre_6_windows_i586-1.6.26-0-devel-win-x86-j1_6.gvspkg"
115
                                          url = "http://downloads.gvsig.org/download/gvsig-desktop/pool/jre_6_windows_i586/" + jre_pkg_name
116
                                          target = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name
117
                                          if(! new File(target).exists() ) {                                            
118
                              log.info("Downloading windows jre plugin")
119
                                                  ant.get(
120
                                                          src: url, 
121
                                                          dest: target
122
                                                  )
123
                                          } else {
124
                                                  log.info("Skip download of jre, it exist in local filesystem.")
125
                                          }
126
                                          source = project.basedir.getAbsolutePath() + "/target/" + jre_pkg_name
127
                      target = gvsig_product_folder_path + "/gvSIG/extensiones/"
128
                      log.info("Install plugin windows jre plugin to " + target)
129
                      ant.unzip(src: source, dest: target)
130
                                          
131
                      cmd = [ "installjammer" , 
132
                        "--output-dir", project.basedir.getAbsolutePath() + "/target",
133
                        "-DBaseDir", gvsig_product_folder_path,
134
                        "-DVersion", pakageinfo.getProperty("version"),
135
                        "-DInstallVersion", pakageinfo.getProperty("version"),
136
                        "-DDevelState", pakageinfo.getProperty("state"),
137
                        "-DBuildVersion", pakageinfo.getProperty("buildNumber"), 
138
                        "--build-for-release",
139
                        "--build-dir", project.basedir.getAbsolutePath() + "/target/installjammer", 
140
                        "--build-log-file", project.basedir.getAbsolutePath() + "/target/installjammer.log",
141
                        "--verbose",
142
                        "--build",
143
                                                project.basedir.getAbsolutePath() + "/src/main/installjammer/gvsig-standard-installer.mpi"
144
                                          ]
145
                      log.info("Launching InstallJammer - " + cmd.join(" ") )
146
                      ant.exec( command: cmd.join(" ") )
147
                    ]]></source>
148
                  </configuration>
149
                </execution>
150
              </executions>
151
          </plugin>
152
      </plugins>
153
  </build>
154
  <properties>
155
          <org.gvsig.andami.updater.jar>org.gvsig.andami.updater-2.0.10-SNAPSHOT.jar</org.gvsig.andami.updater.jar>
156
  </properties>
157

    
158
</project>