Re: Same build using multiple JDKs?

"Mark Derricutt" <mark-eB0Nx5sQHd/[email protected]> Sun, 21 Jan 2007 15:02:55 +1300
Newsgroups gmane.comp.java.anthill
Message-ID <[email protected]>
--===============0439898119==
Content-Type: multipart/alternative; 
	boundary="----=_Part_153012_17016365.1169344975710"

------=_Part_153012_17016365.1169344975710
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 1/19/07, Adi <[email protected]> wrote:
>
> We are using Anthill OS version 1.8.0.264. We have a requirement to build
> using multiple JDKs.
> Is there a way of building a project with multiple JDK versions.
> Example: Fire a build project using JDK 1.4.2 and then repeat the same
> build with JDK 1.3.1
>

Whilst Anthill doesn't support this, its easily accomplished using Ant
itself thou.  Our Anthill install was running 1.4 but I wanted to compile
with 1.5 - I did this by adding the following to the build.xml file to
define a path to the JDK and changing the calls to javac:

<!-- JDK definitions -->
<property name="jdk.bin.1.5" value="${jdk.home.1.5}/bin"/>
<path id="jdk.classpath.1.5">
    <fileset dir="${jdk.home.1.5}">
        <include name="jre/lib/jce.jar"/>
        <include name="jre/lib/javaws.jar"/>
        <include name="jre/lib/jsse.jar"/>
        <include name="jre/lib/deploy.jar"/>
        <include name="jre/lib/rt.jar"/>
        <include name="jre/lib/charsets.jar"/>
        <include name="jre/lib/plugin.jar"/>
        <include name="jre/lib/ext/sunjce_provider.jar"/>
        <include name="jre/lib/ext/sunpkcs11.jar"/>
        <include name="jre/lib/ext/dnsns.jar"/>
        <include name="jre/lib/ext/localedata.jar"/>
    </fileset>
</path>

<property name="project.jdk.home" value="${jdk.home.1.5}"/>
<property name="project.jdk.bin" value="${jdk.bin.1.5}"/>

...

<javac destdir="classes" fork="true" executable="${project.jdk.bin}/javac">
    <classpath refid="project.jdk.classpath"/>
</javac>

Hope this helps.





-- 
It was not the presence of God that formed me, but his absence which broke
me.

http://www.talios.com
http://www.flickr.com/photos/talios

------=_Part_153012_17016365.1169344975710
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 1/19/07, <b class="gmail_sendername">Adi</b> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 We are using Anthill OS version 1.8.0.264. We have a requirement to build using multiple JDKs.<br>Is there a way of building a project with multiple JDK versions.<br>Example: Fire a build project using JDK 1.4.2 and then repeat the same build with JDK 
1.3.1<br></blockquote></div><br>Whilst Anthill doesn&#39;t support this, its easily accomplished using Ant itself thou.&nbsp; Our Anthill install was running 1.4 but I wanted to compile with 1.5 - I did this by adding the following to the 
build.xml file to define a path to the JDK and changing the calls to javac:<br><br><div class="code"><div class="codeContent">
<pre class="code-xml"><span class="code-tag"><span class="code-comment">&lt;!-- JDK definitions --&gt;</span></span><br><span class="code-tag">&lt;property name=<span class="code-quote">&quot;jdk.bin.1.5&quot;</span> value=
<span class="code-quote">&quot;${jdk.home.1.5}/bin&quot;</span>/&gt;</span><br><span class="code-tag">&lt;path id=<span class="code-quote">&quot;jdk.classpath.1.5&quot;</span>&gt;</span><br>    <span class="code-tag">&lt;fileset dir=
<span class="code-quote">&quot;${jdk.home.1.5}&quot;</span>&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/jce.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">
&lt;include name=<span class="code-quote">&quot;jre/lib/javaws.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/jsse.jar&quot;</span>/&gt;</span><br>        
<span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/deploy.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/rt.jar&quot;</span>
/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/charsets.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/plugin.jar&quot;
</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/ext/sunjce_provider.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">
&quot;jre/lib/ext/sunpkcs11.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=<span class="code-quote">&quot;jre/lib/ext/dnsns.jar&quot;</span>/&gt;</span><br>        <span class="code-tag">&lt;include name=
<span class="code-quote">&quot;jre/lib/ext/localedata.jar&quot;</span>/&gt;</span><br>    <span class="code-tag">&lt;/fileset&gt;</span><br><span class="code-tag">&lt;/path&gt;</span><br><br><span class="code-tag">&lt;property name=
<span class="code-quote">&quot;project.jdk.home&quot;</span> value=<span class="code-quote">&quot;${jdk.home.1.5}&quot;</span>/&gt;</span><br><span class="code-tag">&lt;property name=<span class="code-quote">&quot;project.jdk.bin
&quot;</span> value=<span class="code-quote">&quot;${jdk.bin.1.5}&quot;</span>/&gt;<br><br>...<br><br></span></pre><div class="code"><div class="codeContent">
<pre class="code-xml"><span class="code-tag">&lt;javac destdir=<span class="code-quote">&quot;classes&quot;</span> fork=<span class="code-quote">&quot;true&quot;</span> executable=<span class="code-quote">&quot;${project.jdk.bin
}/javac&quot;</span>&gt;</span><br>    <span class="code-tag">&lt;classpath refid=<span class="code-quote">&quot;project.jdk.classpath&quot;</span>/&gt;</span><br><span class="code-tag">&lt;/javac&gt;<br><br>Hope this helps.
<br></span></pre>
</div></div><pre class="code-xml"><br></pre>
</div></div><br><br><br>-- <br>It was not the presence of God that formed me, but his absence which broke me.<br><br><a href="http://www.talios.com">http://www.talios.com</a><br><a href="http://www.flickr.com/photos/talios">
http://www.flickr.com/photos/talios</a>

------=_Part_153012_17016365.1169344975710--

--===============0439898119==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Anthill mailing list
Anthill-IWHQxnLZ/[email protected]
http://lists.urbancode.com/mailman/listinfo/anthill

--===============0439898119==--