blob: acc8d7537f8c45792c2dea038ce7256ce694b76a [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="o.n.swing.tabcontrol" default="test-beanjar" basedir=".">
<!-- Stuff here is only used when compiling a standalone jar
of the tab control for use outside netbeans. What you need:
- A complete checkout of this module
- A checkout of at least the dir src/org/openide/awt from the cvs
module openide
What it will do:
- Copy the current version of the NetBeans fast HTML renderer into
the beanstubs subdir
- Compile it, along with a stub version of org.openide.ErrorManager
which just prints to the console
- Create a jar consisting of the tab control, the ErrorManager stub
and the three classes that make up the HTML renderer
-->
<available type="file" file="../openide/src/org/openide/awt/HtmlRenderer.java" property="found-openide"/>
<target name="check-openide" unless="found-openide">
<property name="dont-do-checkout" value="true"/>
<fail message="You need a checkout of openide to build this jar. Only three needed classes from it will be compiled and included in the resulting jar from this build."/>
</target>
<target name="set-openide-dir" if="found-openide">
<property value="../openide/src" name="openide-source-dir"/>
<echo message="Openide src dir set to ${openide-source-dir}"/>
</target>
<target name="prepare-beanjar" depends="check-openide,set-openide-dir">
<mkdir dir="beanstubs/org/openide/awt"/>
<copy file="../openide/src/org/openide/awt/HtmlRenderer.java" todir="beanstubs/org/openide/awt" failonerror="true"/>
<copy file="../openide/src/org/openide/awt/HtmlLabelUI.java" todir="beanstubs/org/openide/awt" failonerror="true"/>
<copy file="../openide/src/org/openide/awt/HtmlRendererImpl.java" todir="beanstubs/org/openide/awt" failonerror="true"/>
</target>
<target name="compile-bean" depends="prepare-beanjar">
<mkdir dir="beanclasses"/>
<javac debug="true" destdir="beanclasses" source="1.4">
<src path="beanstubs"/>
<src path="src"/>
</javac>
</target>
<target name="beanjar" description="Compiles the tabbed control as a standalone library" depends="compile-bean">
<jar basedir="beanclasses" jarfile="tabbedcontainer.jar"/>
</target>
<target name="rebuild-beanjar" depends="clean-bean,beanjar"/>
<target name="clean-bean" description="Clean build products from creating the bean jar">
<delete dir="beanstubs/org/openide/awt"/>
<delete dir="beanclasses"/>
<delete file="tabbedcontainer.jar"/>
</target>
<target name="test-beanjar" depends="rebuild-beanjar,compile-beanjar-demo" description="Runs the demo based on a build of the bean jar rather than class files">
<echo message="Demo args: ${application.args}"/>
<java fork="true" classname="org.netbeans.swing.tabcontrol.demo.TestFrame" args="${application.args}">
<classpath refid="beanjar-demo.cp"/>
</java>
</target>
<target name="beanjar-demo-init">
<path id="beanjar-demo.cp">
<pathelement location="build/democlasses"/>
<fileset file="tabbedcontainer.jar"/>
</path>
</target>
<target name="compile-beanjar-demo" depends="beanjar-demo-init,beanjar">
<mkdir dir="build/democlasses"/>
<javac srcdir="demosrc" destdir="build/democlasses" debug="true" source="1.4" deprecation="false" includeantruntime="false">
<classpath refid="beanjar-demo.cp"/>
</javac>
</target>
</project>