Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
143 lines (130 sloc) 4.96 KB
<?xml version="1.0" encoding="utf-8"?>
<!--
// Parliament is licensed under the BSD License from the Open Source
// Initiative, http://www.opensource.org/licenses/bsd-license.php
//
// Copyright (c) 2001-2019, BBN Technologies, Inc.
// All rights reserved.
-->
<project name="CommonBuildScriptElements" xmlns:ivy="antlib:org.apache.ivy.ant">
<description>Build script elements common to all Parliament projects.</description>
<property environment="env"/>
<dirname property="kbRootDir" file="${ant.file.CommonBuildScriptElements}"/>
<property name="targetDir" value="${kbRootDir}/target"/>
<property name="artifactsDir" value="${targetDir}/artifacts"/>
<property name="reportsDir" value="${targetDir}/reports"/>
<property name="ivyDir" location="${kbRootDir}/ivy"/>
<condition property="parliamentDependenciesDir"
value="${env.PARLIAMENT_DEPENDENCIES}"
else="${kbRootDir}/dependencies">
<isset property="env.PARLIAMENT_DEPENDENCIES"/>
</condition>
<property name="deployableServersFile" value="${targetDir}/bin/DeployableServerDirs.txt"/>
<property name="antRunnableServersFile" value="${targetDir}/bin/AntRunnableServerDirs.txt"/>
<property name="testKbConfigFile" value="${targetDir}/test-bin/ParliamentKbConfig.txt"/>
<property name="testLogConfigFile" value="${targetDir}/test-bin/ParliamentLogConfig.txt"/>
<!-- Include ant-contrib -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="${parliamentDependenciesDir}/ant-contrib" includes="ant-contrib-*.jar"/>
</classpath>
</taskdef>
<!-- Load Ivy setting file -->
<ivy:settings file="${ivyDir}/ivysettings.xml"/>
<target name="resolveUpToDateCheck">
<uptodate property="isResolveUpToDate" srcfile="ivy.xml"
targetfile="lib/LastResolvePerformedAt.txt"/>
</target>
<target name="resolve" depends="resolveUpToDateCheck" unless="isResolveUpToDate">
<ivy:retrieve type="jar,bundle,native-src"/>
<touch file="lib/LastResolvePerformedAt.txt" mkdirs="true"/>
</target>
<target name="report" depends="resolve">
<ivy:report todir="${reportsDir}/ivy"/>
</target>
<target name="clean-cache">
<ivy:cleancache/>
</target>
<!-- Compute the Parliament version -->
<loadfile property="parliamentVersion"
srcFile="${kbRootDir}/Parliament/KbCore/parliament/Version.h">
<filterchain>
<tokenfilter delimoutput="">
<containsregex
pattern="^.*PARLIAMENT_VERSION_STRING[ \t]*&quot;([0-9\.]+)\.0&quot;.*$"
replace="\1"/>
<trim/>
<ignoreblank/>
</tokenfilter>
</filterchain>
</loadfile>
<!-- Load the appropriate properties file -->
<condition property="buildPropFile"
value="${kbRootDir}/build.properties"
else="${kbRootDir}/build.properties.default">
<available file="${kbRootDir}/build.properties"/>
</condition>
<property file="${buildPropFile}"/>
<target name="buildDeployableServerList">
<!-- Extract the list of deployable server dirs from the file left by the native build -->
<propertyregex property="escapedTargetDir"
input="${targetDir}"
regexp="\\"
replace="/"
casesensitive="false"
defaultValue="${targetDir}"/>
<loadfile property="deployableServerList" srcFile="${deployableServersFile}">
<filterchain>
<sortfilter/>
<tokenfilter delimoutput="|">
<trim/>
<ignoreblank/>
<uniqfilter/>
<replaceregex pattern="^(.*)$" replace="${escapedTargetDir}/\1" flags="s"/>
</tokenfilter>
</filterchain>
</loadfile>
<loadfile property="antRunnableServerList" srcFile="${antRunnableServersFile}">
<filterchain>
<sortfilter/>
<tokenfilter delimoutput="|">
<trim/>
<ignoreblank/>
<uniqfilter/>
<replaceregex pattern="^(.*)$" replace="${escapedTargetDir}/\1" flags="s"/>
</tokenfilter>
</filterchain>
</loadfile>
</target>
<!--
Create configuration files for testing with:
* Console logging off to reduce the spew of text scrolling by during a build,
* A test-specific KB directory to sequester those temporary files, and
* Reduced initial statement and resource capacity to make test run faster.
-->
<target name="createTestConfig">
<copy todir="${targetDir}/test-bin" preservelastmodified="true" flatten="true">
<fileset dir="${kbRootDir}/Parliament/KbCore" includes="Parliament*Config.txt"/>
</copy>
<replaceregexp flags="mig"
match="(logToConsole *= *)yes"
replace="\1no">
<fileset dir="${targetDir}/test-bin" includes="Parliament*Config.txt"/>
</replaceregexp>
<replaceregexp flags="mig"
match="(kbDirectoryPath *= *)kb-data"
replace="\1test-kb-data">
<fileset dir="${targetDir}/test-bin" includes="Parliament*Config.txt"/>
</replaceregexp>
<replaceregexp flags="mig"
match="(initial((Rsrc)|(Stmt))Capacity *= *)[0-9]+"
replace="\120">
<fileset dir="${targetDir}/test-bin" includes="Parliament*Config.txt"/>
</replaceregexp>
<replaceregexp flags="mig"
match="(((rsrc)|(stmt))GrowthIncrement *= *)[0-9]+"
replace="\120">
<fileset dir="${targetDir}/test-bin" includes="Parliament*Config.txt"/>
</replaceregexp>
</target>
</project>
You can’t perform that action at this time.