~vcs-imports/audio-player/trunk

« back to all changes in this revision

Viewing changes to build.xml

  • Committer: doryphores
  • Date: 2007-11-13 22:52:02 UTC
  • Revision ID: svn-v4:c76fdd7b-d127-0410-94b4-a831279d9d2e:audio-player/branches/version2:139
Added ant task jar files
Improved build file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
2
<project name="Audio Player WordPress plugin" basedir="." default="deploy.default">
3
 
        <taskdef name="jsmin" classname="net.matthaynes.jsmin.JSMin_Task" classpath="${ant.library.dir}/jsmin.0.2.2.jar"/>
4
 
        <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${ant.library.dir}/ant-contrib-1.0b3.jar"/>
5
 
 
6
 
        <path id="svnant.lib.path">
7
 
                <fileset dir="${ant.library.dir}">
 
3
        <path id="tasks.classpath">
 
4
                <fileset dir="lib">
 
5
                        <include name="ant-contrib-1.0b3.jar"/>
 
6
                        <include name="jsmin.0.2.2.jar"/>
8
7
                        <include name="svnant.jar"/>
9
 
                        <include name="svnjavahl.jar"/>
10
8
                        <include name="svnClientAdapter.jar"/>
11
9
                        <include name="javasvn.jar"/>
12
10
                </fileset>
13
11
        </path> 
14
12
        
15
 
        <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.lib.path"/>
 
13
        <taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP"/>
 
14
        <taskdef name="jsmin" classname="net.matthaynes.jsmin.JSMin_Task" classpathref="tasks.classpath"/>
 
15
        <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="tasks.classpath"/>
 
16
        
 
17
        <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="tasks.classpath"/>
16
18
        
17
19
        <property name="build" value="build"/>
18
20
        <property name="dist" value="dist"/>
21
23
 
22
24
        <property name="swfcompile.jsfl" value="${basedir}/swfcompile.jsfl"/>
23
25
        
24
 
        <target name="init" depends="clean">
 
26
        <target name="-init" depends="clean">
25
27
                <mkdir dir="${build}"/>
26
28
                <mkdir dir="${dist}"/>
27
29
        </target>
33
35
        </target>
34
36
 
35
37
        <target name="deploy.to.all" depends="build" description="Deploy to all local test sites">
36
 
                <foreach target="deploy" param="deploy.dir">
 
38
                <foreach target="-deploy" param="deploy.dir">
37
39
                        <path>
38
40
                                <dirset dir="${deploy.path}" includes="wp*"/>
39
41
                        </path>
43
45
 
44
46
        <target name="deploy.to" depends="build" description="Deploy to one local test site">
45
47
                <input message="Please select test site to deploy to:" addproperty="wp.version" defaultvalue="wp23"/>
46
 
                <antcall target="deploy">
 
48
                <antcall target="-deploy">
47
49
                        <param name="deploy.dir" value="${deploy.path}/${wp.version}"/>
48
50
                </antcall>
49
51
                <antcall target="clean"/>
56
58
                <antcall target="clean"/>
57
59
        </target>
58
60
 
59
 
        <target name="deploy">
 
61
        <target name="-deploy">
60
62
                <delete dir="${deploy.dir}/wp-content/plugins/audio-player"/>
61
63
                <unzip src="${dist}/audio-player.zip" dest="${deploy.dir}/wp-content/plugins/audio-player" overwrite="true"/>
62
64
        </target>
63
65
 
64
 
        <target name="build" depends="init" description="Build plugin archive">
 
66
        <target name="build" depends="-init" description="Build plugin archive">
65
67
                <copy todir="${build}">
66
68
                        <fileset dir="./plugin">
67
69
                                <include name="**/*.*"/>
78
80
                <available file="source/player.swf"/>
79
81
            </condition>
80
82
                
81
 
                <antcall target="compileIfMissing"/>
 
83
                <antcall target="-compileIfMissing"/>
82
84
                
83
85
                <copy todir="${build}/assets" file="source/player.swf"/>
84
86
                
90
92
                <zip destfile="${dist}/audio-player.zip" basedir="${build}"/>
91
93
        </target>
92
94
        
93
 
        <target name="compileIfMissing" unless="swfExists">
 
95
        <target name="-compileIfMissing" unless="swfExists">
94
96
                <antcall target="compile"/>
95
97
        </target>
96
98
                
104
106
            </exec>
105
107
        </target>
106
108
        
107
 
        <target name="release" depends="build" description="Release to WP plugins repository">
108
 
                <svn javasvn="true" username="${svn.username}" password="${svn.password}">
109
 
                        <delete url="http://svn.wp-plugins.org/audio-player/branches/release" message="Deleted release"/>
110
 
                        <import url="http://svn.wp-plugins.org/audio-player/branches/release" path="${build}" message="TEST: Imported new version"/>
111
 
                        <copy srcUrl="http://svn.wp-plugins.org/audio-player/branches/release" destUrl="http://svn.wp-plugins.org/audio-player/branches/${version.tag}" message="Tagged version ${version.tag}"/>
 
109
        <target name="release" depends="build" description="Release and deploy new version">
 
110
                <!--<input message="New version number:" addproperty="version.tag"/>-->
 
111
                
 
112
                <!-- Release to 1pixelout.net -->
 
113
                <ftp server="${ftp.server}" action="put" binary="true" password="${ftp.password}" userid="${ftp.username}" remotedir="${ftp.path}">
 
114
                        <fileset dir="dist" includes="audio-player.zip"/>
 
115
                </ftp>
 
116
                
 
117
                <!-- Release to WP plugins repository -->
 
118
                <svn javasvn="true" javahl="false" username="${svn.username}" password="${svn.password}">
 
119
                        <delete url="${svn.url}/trunk" message="Deleted current trunk"/>
 
120
                        <import url="${svn.url}/trunk" path="${build}" message="Imported new release to trunk"/>
 
121
                        <copy srcUrl="${svn.url}/trunk" destUrl="${svn.url}/tags/${version.tag}" message="Tagged version ${version.tag}"/>
112
122
                </svn>
113
123
                
114
124
                <antcall target="clean"/>