<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>piouPiouM&#039;s dev&#187; Archives pour le tag macrodef – piouPiouM&#039;s dev</title>
	<atom:link href="http://pioupioum.fr/tag/macrodef/feed/" rel="self" type="application/rss+xml" />
	<link>http://pioupioum.fr</link>
	<description>Bloc-note d&#039;un développeur web</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:47:44 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Générer des bookmarklets via Ant</title>
		<link>http://pioupioum.fr/snippets/ant-bookmarklet-macrodef.html</link>
		<comments>http://pioupioum.fr/snippets/ant-bookmarklet-macrodef.html#comments</comments>
		<pubDate>Wed, 29 Jul 2009 09:30:13 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automatisation]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[macrodef]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=138</guid>
		<description><![CDATA[Dans un build file Ant, pour convertir des fichiers JavaScript destinés à être utilisé en tant que bookmarklet, utiliser/adapter la tâche macrodef suivante&#160;:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
&#60;macrodef name=&#34;jstobookmarklet&#34;&#62;
    &#60;attribute name=&#34;srcdir&#34;/&#62;
    &#60;attribute name=&#34;srcfiles&#34;/&#62;
    &#60;attribute name=&#34;verbose&#34; default=&#34;false&#34;/&#62;
    &#60;attribute name=&#34;todir&#34; default=&#34;${dir.dist}&#34;/&#62;
    &#60;sequential&#62;
      [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Dans un build file <a href="http://fr.wikipedia.org/wiki/Apache_Ant" title="Apache Ant - Wikipédia">Ant</a>, pour convertir des fichiers JavaScript destinés à être utilisé en tant que bookmarklet, utiliser/adapter la tâche <a href="http://ant.apache.org/manual/CoreTasks/macrodef.html" title="MacroDef Task">macrodef</a> suivante&#160;:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;macrodef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jstobookmarklet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;srcdir&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;srcfiles&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;verbose&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;todir&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;${dir.dist}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequential<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;@{todir}&quot;</span> <span style="color: #000066;">overwrite</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;@{verbose}&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000066;">outputencoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filelist</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;@{srcdir}&quot;</span> <span style="color: #000066;">files</span>=<span style="color: #ff0000;">&quot;@{srcfiles}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filterchain<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregex</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;\n| &quot;</span> <span style="color: #000066;">replace</span>=<span style="color: #ff0000;">&quot;%20&quot;</span> <span style="color: #000066;">flags</span>=<span style="color: #ff0000;">&quot;g&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregex</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^&quot;</span> <span style="color: #000066;">replace</span>=<span style="color: #ff0000;">&quot;javascript:&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filterchain<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sequential<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/macrodef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>


<p>Qui s&#8217;utilise ainsi&#160;:</p>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jstobookmarklet</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${dir.build}&quot;</span> <span style="color: #000066;">srcfiles</span>=<span style="color: #ff0000;">&quot;myfile.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>


<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/developpement/phing-header-task.html' title='Phing Header : une tâche pour ajouter un en-tête aux fichiers'>Phing Header&#160;: une tâche pour ajouter un en-tête aux fichiers</a></li><li><a href='http://pioupioum.fr/outils-astuces/dailymotion-download-bookmarklet.html' title='Dailymotion Download Bookmarklet'>Dailymotion Download Bookmarklet</a></li></ul>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/snippets/ant-bookmarklet-macrodef.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
