Created
August 2, 2012 01:54
-
-
Save Mparaiso/3232405 to your computer and use it in GitHub Desktop.
hello-ant-js a simple ant configuration exemple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
css_dir = css | |
js_dir = js | |
assets_dir = assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project name="Compress, Concatenate, and FTP CSS and JS " default="initialize"> | |
<target name="hello_ant"> | |
<echo>Hello Ant!</echo> | |
</target> | |
<!-- cible initiale --> | |
<target name="initialize" depends="get_properties"> | |
<mkdir dir="${assets_dir}"/> | |
<antcall target="compress_all"/> | |
</target> | |
<target name="clean_up" depends="get_properties"> | |
<delete dir="${assets_dir}"/> | |
</target> | |
<target name="compress_all"> | |
<antcall target="compress_css"/> | |
<antcall target="compress_js"/> | |
</target> | |
<target name="get_properties"> | |
<!-- importer le fichier de propri?t?s externes--> | |
<property file="ant.properties"></property> | |
<echo>Imported Properties</echo> | |
</target> | |
<target name="compress_css" depends="get_properties"> | |
<antcall target="compress"> | |
<param name="dir" value="${css_dir}"/> | |
<param name="file" value="style.css"/> | |
</antcall> | |
</target> | |
<target name="compress_js" depends="get_properties"> | |
<antcall target="compress"> | |
<param name="dir" value="${js_dir}"/> | |
<param name="file" value="script.js"/> | |
</antcall> | |
</target> | |
<target name="compress" depends="get_properties"> | |
<!-- les répertoires requis seront crées --> | |
<mkdir dir="${assets_dir}/${dir}"/> | |
<java fork="true" jar="C:\jar\yuicompressor-2.4.7.jar"> | |
<arg value="${dir}/${file}"/> | |
<arg value="-o"/> | |
<arg value="${assets_dir}/${dir}/${file}"/> | |
</java> | |
<echo>${file}</echo> | |
</target> | |
<target name="upload_files" depends="initialize,get_properties"> | |
<echo> | |
Uploading files on the server. | |
</echo> | |
<ftp server="ftpperso.free.fr" | |
userid="login" | |
password="pass" | |
port="21" | |
remotedir="/" | |
passive="yes" | |
binary="true"> | |
<fileset dir="${assets_dir}"> | |
</fileset> | |
<fileset dir="."> | |
<include name="index.html"/> | |
</fileset> | |
</ftp> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment