myantce.ant 2.3 KB
Newer Older
1
2
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myantce">
3
4
5
6
7
8
9
  
  <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  
  <property name="in" location="${basedir}/input"/>
  <property name="out" location="${basedir}/output"/>
  <property name="tmp" location="${basedir}/tmp"/>
  <property name="xsl" location="${basedir}/xsl"/>
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
  <property name="lib" location="${basedir}/lib"/>
  <property name="log" location="${basedir}/log"/>
  
  <delete dir="${tmp}" failonerror="false"/>
  <mkdir dir="${tmp}"/>
  <delete dir="${out}" failonerror="false"/>
  <mkdir dir="${out}"/>
  <delete dir="${log}" failonerror="false"/>
  <mkdir dir="${log}"/>
  <mkdir dir="${tmp}/extract"/>
  <mkdir dir="${tmp}/internationalisation"/>
  
  <echo message="Extract files..."/>
  
  <for param="archive">
    <path>
      <fileset dir="${in}" includes="*"/>
    </path>
    <sequential>
      <echo message="@{archive}"></echo>
      <unzip src="@{archive}" dest="${tmp}/extract"></unzip>
    </sequential>
  </for>
  
  <echo message="Internationalize files..."/>
36

37
38
39
40
41
42
43
44
45
46
47
  <xslt useImplicitFileset="false" destdir="${tmp}/internationalisation" style="${xsl}/internalisation.xsl">
    <param name="currentDir" expression="."/>
    <fileset dir="${tmp}/extract">
      <!-- only converting the root files -->
      <include name="*/*.paper"/>
      <include name="*/*.section"/>
      <include name="*/*.website"/>
      <include name="*/*.slideshow"/>
      <include name="*/*.webpage"/>
    </fileset>
  </xslt>
48

49
50
51
  <echo message="Convert to hdoc..."/>
  
  <xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/>
52

53
  <echo message="Copy ressources files..."/>
54

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
  <copy todir="${out}">
    <fileset dir="${tmp}/extract">
      <!-- only copying resources files -->
      <exclude name="*/*.paper"/>
      <exclude name="*/*.section"/>
      <exclude name="*/*.website"/>
      <exclude name="*/*.slideshow"/>
      <exclude name="*/*.webpage"/>
    </fileset>
  </copy>
  
  <echo message="Zip result..."/>
 
  <for param="folder">
    <path>
      <dirset dir="${out}" includes="*"/>
    </path>
    <sequential>
      <local name="folder_name"/>
      <basename property="folder_name" file="@{folder}"/>
      <zip destfile="${out}/${folder_name}.zip" basedir="@{folder}" ></zip>
    </sequential>
  </for>
78
79
    
</project>