summaryrefslogtreecommitdiff
blob: 83dd73ea905510c708d155cd16e778735f44dc8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE project [
  <!ENTITY build-COMMON SYSTEM "common.xml">
  <!ENTITY build-COMMONDEVJAVANET SYSTEM "common-devjavanet.xml">
]>

<!--
  Skin Look And Feel Build
-->
<project name="skinlf" default="compile.java" basedir=".">

  <!-- Allow user to override settings -->
  <property file="${user.home}/skinlf-ant.properties" />
  <property file="build.properties" />

  <!-- Project Identification -->
  <property name="project" value="skinlf"/>
  <property name="version" value="1.2.12"/>
  <property name="year"    value="2000-2005"/>
  <property name="project.fullname" value="Skin Look And Feel"/>
  <property name="project.nativeskin" value="nativeskin"/>

  <property name="javadoc.packagenames" value="com.l2fprod.gui,com.l2fprod.gui.plaf.skin,com.l2fprod.gui.region,com.l2fprod.gui.nativeskin"/>

  <path id="classpath">
    <pathelement location="lib/imageconversion.jar"/>
    <pathelement location="lib/JimiProClasses.zip"/>
    <pathelement location="lib/xalan.jar"/>
    <pathelement location="lib/xercesImpl.jar"/>
    <pathelement location="lib/xml-apis.jar"/>
  </path>

  <property name="classpath.asprop" refid="classpath"/>

  &build-COMMON;
  &build-COMMONDEVJAVANET;

  <!-- get some of the dependant jars from maven repository -->
  <target name="init.jars">
    <get src="http://www.ibiblio.org/maven/javacc/jars/JavaCC.zip"
	 dest="lib/JavaCC.zip"
	 verbose="true"
	 usetimestamp="true"/>
    <get src="http://www.ibiblio.org/maven/xalan/jars/xalan-2.5.1.jar"
         dest="lib/xalan.jar"
	 verbose="true"
	 usetimestamp="true"/>
    <get src="http://www.ibiblio.org/maven/xerces/jars/xercesImpl-2.4.0.jar"
	 dest="lib/xercesImpl.jar"
	 verbose="true"
	 usetimestamp="true"/>
    <get src="http://www.ibiblio.org/maven/xml-apis/jars/xml-apis-2.0.2.jar"
	 dest="lib/xml-apis.jar"
	 verbose="true"
	 usetimestamp="true"/>
  </target>

  <target name="compile.javacc" depends="init">
    <javacc target="src/com/l2fprod/gui/plaf/skin/impl/gtk/parser/GtkParser.jj"
            outputdirectory="src/com/l2fprod/gui/plaf/skin/impl/gtk/parser"
            javacchome="lib"
            static="false"
            javaunicodeescape="true" />
  </target>

  <target name="compile" depends="init">
  </target>
   
  <!--
    Utility targets to use the style converters
  -->
  <target name="convert.msstyles">
    <fail unless="msstyle" message="Specify path to msstyle xml -Dmsstyle=pathtoxml"/>
    <fail unless="skin"    message="Specify themepack folder -Dskin=pathtothemepackdir"/>
    <java classname="com.l2fprod.tools.msstyles.MsStylesToSkinLF"
          classpath="${classpath.asprop}:${java.src.dir}:${build.classes}"
          fork="yes">
      <arg value="${msstyle}" />
      <arg value="${msstyle}.xml" />
      <arg value="${skin}" />
    </java>
    <copy todir="${skin}">
      <fileset dir="src/themepacks/skeletonthemepack" includes="**"/>
    </copy>
  </target>

  <!--
    Start Demos
  -->
  <target name="demo">
    <java classname="examples.demo"
          classpath="${classpath.asprop}:${java.src.dir}:${build.classes}"
          fork="yes">
      <arg value="${skin}" />
    </java>
  </target>

  <!-- Dist targets -->
  <target name="jar" depends="compile.java">
    <jar destfile="${build.dir}/${project}.jar">
      <fileset dir="${build.classes}" includes="*.class,com/**/*.class" excludes="**/region/**,**/nativeskin/**"/>
      <fileset dir="${java.src.dir}" includes="com/**/*.properties"/>
      <fileset dir="${java.src.dir}" includes="com/**/*.template"/>
      <fileset dir="${java.src.dir}" includes="com/**/*.gif"/>
      <manifest>
        <attribute name="Built-by" value="${user.name}"/>
        <attribute name="Main-Class" value="com.l2fprod.gui.plaf.skin.Skinit"/>
        <section name="com/l2fprod/gui/plaf/skin">
          <attribute name="Specification-Title" value="${project.fullname}"/>
          <attribute name="Specification-Version" value="${version}"/>
          <attribute name="Specification-Vendor" value="L2FProd.com"/>
          <attribute name="Implementation-Title" value="${project.fullname}"/>
          <attribute name="Implementation-Version" value="${version}"/> 
          <attribute name="Implementation-Vendor" value="L2FProd.com"/>
        </section>
      </manifest>
    </jar>
  </target>

  <target name="obfuscate" depends="jar">
    <taskdef name="proguard"
             classname="proguard.ant.ProGuardTask"
             classpath="lib/proguard.jar"/>
    <move file="${build.dir}/${project}.jar"
    	  tofile="${build.dir}/${project}-toobfuscate.jar"/>
    <proguard
              outjar="${build.dir}/${project}.jar"
              obfuscate="yes"
              usemixedclassnames="no"
              overloadaggressively="yes"
              printmapping="obfuscatemapping.txt"
              printusage="obfuscateusage.txt">
      <libraryjar name="${java.home}/lib/rt.jar"/>
      <injar name="${build.dir}/${project}-toobfuscate.jar"/>
      <keep access="public" type="class" name="Skinit">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.SkinApplet">
        <method name="*"/>
      </keep>      
      <keep access="public" type="class" name="com.l2fprod.gui.SkinChooser">
        <method name="*"/>
      </keep>      
      <keep access="public" type="class" name="com.l2fprod.gui.WindowSnapping">
        <method name="*"/>
      </keep>      
      <keep access="public" type="class" name="com.l2fprod.gui.nativeskin.**">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.CompoundSkin">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.IncorrectVersionException">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.LinuxLookAndFeel">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.Skin">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinButton">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinFrame">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.Skinit">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinLookAndFeel">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinPersonality">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinPreviewWindow">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinProgress">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinScrollbar">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinSeparator">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinSlider">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinSplitPane">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.SkinTab">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.impl.*">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.impl.gtk.GtkSkin">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.plaf.skin.impl.kde.KdeSkin">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.gui.region.*">
        <method name="*"/>
      </keep>
      <keep access="public" type="class" name="com.l2fprod.tools.**">
        <method name="*"/>
      </keep>
      <keep type="class" name="com.l2fprod.util.**">
        <method name="*"/>
      </keep>
    </proguard>
  </target>

  <target name="dist.pre" depends="jar">
    <!-- examples.jar -->
    <jar destfile="${build.dist.lib}/examples.jar">
      <fileset dir="${build.classes}" includes="examples/**.class"/>
      <fileset dir="${java.src.dir}" includes="examples/**.properties,examples/**.gif,examples/**.jpg"/>
    </jar>
    <!-- nativeskin.jar -->
    <jar jarfile="${build.dist.lib}/nativeskin.jar">
      <fileset dir="${build.classes}"
               includes="com/l2fprod/gui/region/**,com/l2fprod/gui/nativeskin/**,com/l2fprod/util/OS**,,com/l2fprod/util/Access**"
               excludes="**/*.html"/>
    </jar>
    <!-- batch files -->
    <copy todir="${build.dist.bin}"
	  flatten="yes"
	  preservelastmodified="yes">
      <fileset dir="src" includes="**/*.bat"/>
    </copy>
    <!-- dlls -->
    <copy todir="${build.dist.lib}">
      <fileset dir="src/native/win32" includes="*.dll"/>
    </copy>
    <!-- default theme -->
    <zip destfile="${build.dist.lib}/themepack.zip">
      <zipfileset dir="src/themepacks/whistlerthemepack"/>
    </zip>
  </target>

  <!--
    Publish the new version of SKinLF
  -->
  <target name="publish" depends="init">
    <!-- copy zip to dist folder -->
    <copy todir="${publish.download.dir}"
          file="${project}-${version}-${build.version}.zip"/>

    <filter token="WEB" value="${publish.web.url}"/>
    <!-- update the jnlp website with the new release -->
    <!-- put skinlf.jar in jnlp folder -->
    <copy todir="${publish.skinlf.home}/jnlp/" filtering="on" overwrite="yes">
      <fileset dir="src/jnlp" includes="*.jnlp"/>
    </copy>
    <copy file="${build.dist.lib}/${project}.jar" todir="${publish.skinlf.home}/jnlp/"/>
    <copy file="${build.dist.lib}/examples.jar" todir="${publish.skinlf.home}/jnlp/"/>
    <copy file="${build.dist.lib}/themepack.zip" todir="${publish.skinlf.home}/jnlp/"/>
    <copy file="${build.dist.lib}/nativeskin.jar" todir="${publish.skinlf.home}/jnlp"/>
    <jar destfile="${publish.skinlf.home}/jnlp/nativeskinlibs.jar"
         basedir="${build.dist.lib}" includes="*.dll"/>

    <!-- copy the documentation
    <copy todir="${web.skinlf.home}/documentation">
      <fileset dir="${javadoc.destdir}"/>
    </copy>
    -->
    <!-- Sign all Jars -->
    <signjar keystore="../common/keystore" alias="L2FProd.com" storepass="L2FProd.com">
       <fileset dir="${publish.skinlf.home}/jnlp" includes="*.jar"/>
    </signjar>

  </target>

  <target name="themes">
    <zip destfile="${build.www.themedir}/cellshadedthemepack.zip"
	 basedir="src/themepacks/cellshadedthemepack"/>
    <zip destfile="${build.www.themedir}/whistlerthemepack.zip"
	 basedir="src/themepacks/whistlerthemepack"/>
    <zip destfile="${build.www.themedir}/xplunathemepack.zip"
	 basedir="src/themepacks/xplunathemepack"/>
    <zip destfile="${build.www.themedir}/toxicthemepack.zip"
	 basedir="src/themepacks/toxicthemepack"/>
    <zip destfile="${build.www.themedir}/beigeazulthemepack.zip"
	 basedir="src/themepacks/beigeazulthemepack"/>


    <!-- png for these themepacks are not in cvs -->
    <zip destfile="${build.www.themedir}/aquathemepack.zip"
	 basedir="src/themepacks/aquathemepack"/>
    <zip destfile="${build.www.themedir}/alloythemepack.zip"
	 basedir="src/themepacks/alloythemepack"/>
  </target>

</project>