blob: 0a027b9b7721ece010e1629cff4b0f2e97ab66c7 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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.
-->
<!-- ==================================================================== -->
<!-- Apache Derby build file -->
<!-- ==================================================================== -->
<project default="tools" basedir="../..">
<!-- ==================================================================== -->
<!-- Set properties -->
<!-- ==================================================================== -->
<property name="properties.dir" value="tools/ant/properties"/>
<!-- User settings -->
<property file="${user.home}/ant.properties"/>
<!-- Significant dirs -->
<property file="${properties.dir}/dirs.properties"/>
<!-- Compiler settings -->
<property file="${properties.dir}/defaultcompiler.properties"/>
<property file="${properties.dir}/${build.compiler}.properties"/>
<!-- Parser properties -->
<property file="${properties.dir}/parser.properties"/>
<!-- Compile-time classpath properties files -->
<property file="${properties.dir}/extrapath.properties"/>
<property file="${properties.dir}/compilepath.properties"/>
<property name="ijConstants.src" value="${generated.src.tools.dir}/${derby.dir}/impl/tools/ij/ijConstants.java"/>
<property name="ijTokenManager.src" value="${generated.src.tools.dir}/${derby.dir}/impl/tools/ij/ijTokenManager.java"/>
<!-- Release and Version info -->
<property file="${properties.dir}/release.properties"/>
<!-- ============ Begin Targets ============== -->
<target name="tools" depends="tools_base"
description="Build Derby tools">
</target>
<target name="tools_base" depends="parser">
<javac
source="${min.version}"
target="${min.version}"
nowarn="on"
debug="${debug}" debuglevel="${debuglevel}"
depend="${depend}"
deprecation="${deprecation}"
optimize="${optimize}"
proceed="${proceed}"
verbose="${verbose}"
srcdir="${derby.tools.src.dir}:${generated.src.tools.dir}"
destdir="${out.tools.dir}">
<compilerarg value="-Xlint"/>
<modulepath>
<pathelement location="${out.shared.dir}"/>
<pathelement location="${out.engine.dir}"/>
<pathelement location="${out.client.dir}"/>
</modulepath>
</javac>
<copy todir="${loc.tools.dir}" flatten="true">
<fileset dir="${derby.tools.locales.dir}">
<include name="sysinfoMessages.properties"/>
<include name="toolsmessages.properties"/>
</fileset>
</copy>
<antcall target="copyLocalization">
<param name="localization" value="en"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="cs"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="de_DE"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="es"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="hu"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="ja_JP"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="ko_KR"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="qq_PP_testOnly"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="pl"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="pt_BR"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="ru"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="zh_CN"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="zh_TW"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="it"/>
</antcall>
<antcall target="copyLocalization">
<param name="localization" value="fr"/>
</antcall>
</target>
<target name="copyLocalization">
<property name="locale.output.dir" value="${out.dir}/${locale.stub}${localization}/org/apache/derby/loc/tools/${locale.stub}${localization}"/>
<mkdir dir="${locale.output.dir}"/>
<copy todir="${locale.output.dir}">
<fileset dir="${derby.tools.locales.dir}">
<include name="sysinfoMessages_${localization}.properties"/>
<include name="toolsmessages_${localization}.properties"/>
</fileset>
</copy>
</target>
<target name="parser">
<ant antfile="${src.dir}/build.xml" target="genParser">
<property name="msg" value="Generating ij parser..."/>
<property name="outroot" value="${generated.src.tools.dir}"/>
<property name="srcroot" value="org.apache.derby.tools"/>
<property name="directory" value="${derby.dir}/impl/tools/ij"/>
<property name="rmfiles" value="ijimplparser_rm.files"/>
<property name="jjfile" value="ij.jj"/>
<property name="chkfile" value="ij.java"/>
<property name="constantsfile" value="ijConstants"/>
</ant>
<ant antfile="${src.dir}/build.xml" target="genParser">
<property name="msg" value="Generating mtGrammar parser..."/>
<property name="outroot" value="${generated.src.tools.dir}"/>
<property name="srcroot" value="org.apache.derby.tools"/>
<property name="directory" value="${derby.dir}/impl/tools/ij"/>
<property name="rmfiles" value="mtparser_rm.files"/>
<property name="jjfile" value="mtGrammar.jj"/>
<property name="chkfile" value="mtGrammar.java"/>
<property name="constantsfile" value="mtGrammarConstants"/>
</ant>
<!--
The following files were just generated:
CharStream.java
ij.java
ijConstants.java
ijTokenManager.java
mtGrammar.java
mtGrammarConstants.java
mtGrammarTokenManager.java
ParseException.java
SimpleCharStream.java
Token.java
TokenMgrError.java
1 of those files is checked into the codeline:
ParseException.java
We don't want generated code to clash with the checked-in versions. So
we delete the conflicting class here.
-->
<delete>
<fileset dir="${generated.src.tools.dir}/${derby.dir}/impl/tools/ij">
<include name="ParseException.java"/>
</fileset>
</delete>
<!-- reduce the visibility of these files from public to package protection -->
<replaceregexp file="${ijConstants.src}" match="public interface" replace="interface"/>
<replaceregexp file="${ijTokenManager.src}" match="public class" replace="class"/>
</target>
<!-- ============= End Targets ============== -->
<!-- ============= End Project ============== -->
</project>