Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.mkmvnproject.app / org.gvsig.mkmvnproject.app.mainplugin / src / main / resources-plugin / scripts / fortunecookies.xml @ 41097

History | View | Annotate | Download (6.23 KB)

1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<!--
3

4
    gvSIG. Desktop Geographic Information System.
5

6
    Copyright (C) 2007-2013 gvSIG Association.
7

8
    This program is free software; you can redistribute it and/or
9
    modify it under the terms of the GNU General Public License
10
    as published by the Free Software Foundation; either version 3
11
    of the License, or (at your option) any later version.
12

13
    This program is distributed in the hope that it will be useful,
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
    GNU General Public License for more details.
17

18
    You should have received a copy of the GNU General Public License
19
    along with this program; if not, write to the Free Software
20
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
    MA  02110-1301, USA.
22

23
    For any additional information, do not hesitate to contact us
24
    at info AT gvsig.com, or visit our website www.gvsig.com.
25

26
-->
27
<project name="gvSIG-make-maven-project" default="mkproject-build-basic" basedir=".">
28

    
29
        <!-- Get current file location folder -->
30
        <dirname property="gvSIG-make-maven-project.basedir" file="${ant.file.gvSIG-make-maven-project}" />
31

    
32
        <!-- Libraries folder in the gvSIG extension -->
33
        <property name="lib.folder" location="${gvSIG-make-maven-project.basedir}/../lib" />
34
        <!-- Templates folder in the gvSIG extension -->
35
        <property name="templates.folder" location="${gvSIG-make-maven-project.basedir}/../templates" />
36

    
37
        <property name="gvsiglogo" location="${basedir}/../gvSIG.png" />
38

    
39
        <!-- Load some ant external utility tasks -->
40
        <property name="antform.lib" location="${lib.folder}/antform-2.0.jar" />
41
        <property name="antcontrib.lib" location="${lib.folder}/ant-contrib-1.0b3.jar" />
42
        <property name="antelope.lib" location="${lib.folder}/antelopetasks-3.2.10.jar" />
43

    
44
        <taskdef resource="net/sf/antcontrib/antlib.xml">
45
                <classpath>
46
                        <pathelement location="${antcontrib.lib}" />
47
                </classpath>
48
        </taskdef>
49

    
50
        <taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="${antform.lib}" />
51

    
52
        <taskdef name="antmenu" classname="com.sardak.antform.AntMenu" classpath="${antform.lib}" />
53

    
54
        <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpath="${antelope.lib}" />
55

    
56
        <target name="mkproject-build-cancelled">
57
                <antform title="Project creation cancelled" width="${form.width}" image="${gvsiglogo}">
58
                        <textProperty label="" editable="false" columns="40" property="form.title" />
59
                        <label>Creation cancelled.</label>
60
                        <separator />
61
                        <controlbar>
62
                                <button type="cancel" label=" Close " />
63
                        </controlbar>
64
                </antform>
65
        </target>
66

    
67
    <target name="mkproject-build-basic">
68
        <antcall target="mkproject-build">
69
            <param name="project.type" value="1" />
70
        </antcall>
71
    </target>
72
    
73
    <target name="mkproject-build-provider">
74
        <antcall target="mkproject-build">
75
            <param name="project.type" value="2" />
76
        </antcall>
77
    </target>
78
    
79
        <target name="mkproject-build">
80
                <echo>
81
  Project name: "${project.name}"
82
  Project name capitalized: "${project.name.capitalized}"
83
  Project name lowercase: ${project.name.lowercase}"
84
  Group id: "${project.group.id}"
85
  ArtifactId: "${project.artifact.id}"
86
  Project folder: "${project.folder}"
87
  Project type: "${project.type}"
88
        </echo>
89

    
90
                <if>
91
                        <equals arg1="${project.type}" arg2="1" />
92
                        <then>
93
                                <echo>Unzipping the basic template project</echo>
94
                                <unzip src="${templates.folder}/fortunecookies-basic.zip" dest="${project.folder}" />
95
                        </then>
96
                        <!--
97
                        <else>
98
                                <echo>Unzipping the provider based implementation template project</echo>
99
                                <unzip src="${templates.folder}/fortunecookies-pbi.zip" dest="${project.folder}" />
100
                        </else>
101
                        -->
102
                </if>
103

    
104
                <!-- Calculate the project artifact id as PATH -->
105
                <propertyregex property="project.artifact.id.folder" input="${project.artifact.id}" regexp="([^\.]*).([^\.]*)" replace="\1/\2" />
106

    
107
                <echo>Renaming folder ${project.folder}/org.gvsig.fortunecookies to 
108
            ${project.folder}/${project.artifact.id}</echo>
109
                <move todir="${project.folder}">
110
                        <fileset dir="${project.folder}">
111
                                <include name="org.gvsig.fortunecookies/**" />
112
                                <include name="org.gvsig.fortunecookies.app/**" />
113
                        </fileset>
114
                        <mapper>
115
                                <filtermapper>
116
                                        <replacestring from="org.gvsig.fortunecookies" to="${project.artifact.id}" />
117
                                        <replacestring from="org${file.separator}gvsig${file.separator}fortunecookies" to="${project.artifact.id.folder}" />
118
                                        <replacestring from="FortuneCookie" to="${project.name.capitalized}" />
119
                                </filtermapper>
120
                        </mapper>
121
                        <filterchain>
122
                                <tokenfilter>
123
                                        <!-- Replace fortune cookie server url as it contains the FortuneCookie word in it. -->
124
                                        <replacestring from="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" to="FC_URL_TO_PRESERVE" />
125
                                </tokenfilter>
126
                                <tokenfilter>
127
                                        <replacestring from="org.gvsig.fortunecookies" to="${project.artifact.id}" />
128
                                </tokenfilter>
129
                                <tokenfilter>
130
                                        <replacestring from="FortuneCookies" to="${project.name.capitalized}" />
131
                                        <replacestring from="Fortune Cookies" to="${project.name.capitalized}" />
132
                                        <replacestring from="Fortune cookies" to="${project.name.capitalized}" />
133
                                        <replacestring from="fortune cookies" to="${project.name.capitalized}" />
134
                                        <replacestring from="gvsig-fortunecookies" to="gvsig-${project.name.lowercase}" />
135
                                        <replacestring from="fortunecookies" to="${project.name.capitalized}" />
136
                                </tokenfilter>
137
                                <tokenfilter>
138
                                        <replacestring from="FortuneCookie" to="${project.name.capitalized}" />
139
                                        <replacestring from="Fortune Cookie" to="${project.name.capitalized}" />
140
                                        <replacestring from="Fortune cookie" to="${project.name.capitalized}" />
141
                                        <replacestring from="fortune cookie" to="${project.name.capitalized}" />
142
                                        <replacestring from="gvsig-fortunecookie" to="gvsig-${project.name.lowercase}" />
143
                                        <replacestring from="fortunecookie" to="${project.name.capitalized}" />
144
                                </tokenfilter>
145
                                <tokenfilter>
146
                                        <!-- Restore the fortune cookie server URL -->
147
                                        <replacestring from="FC_URL_TO_PRESERVE" to="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" />
148
                                </tokenfilter>
149
                        </filterchain>
150
                </move>
151
                
152
        </target>
153

    
154

    
155
</project>