All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iteralmind.codelet.0.1.2.source-code.build.xml Maven / Gradle / Ivy

Go to download

**Codelet**: Automated insertion of *already unit-tested* example code (its source code, console output, and input text-files) into JavaDoc using inline taglets--Codelet makes it possible to have *always accurate documentation*.

There is a newer version: 0.1.4.1
Show newest version
<project name="codelet" default="help" basedir=".">

   <property environment="ENV"/>

<!-- Global properties...START -->

   <!--
      Read in the properties file.  For each directory variable in the property file...
         xbn.dir.whatever=subdir
      ...copy it into this file, replacing the name's periods with underscores, and its value with the *entire* directory...
         xbn_dir_whatever=${xbn.dir.parent}\${xbn.dir.whatever}
   -->
   <property file="build.properties"/>

   <property name="fs" value="${file.separator}"/>      <!-- Shortcut -->

   <property name="project_name_fs" value="${project.name}${fs}"/>
   <property name="project_name_for_dir" value="${project.name}-${version.number}"/>

   <!-- com.github.xbn..., ignoring base directories -->
   <property name="com_github_alit" value="com${fs}github${fs}aliteralmind${fs}"/>
      <property name="cg_alit_codelet" value="${com_github_alit}${project.name}${fs}"/>
         <property name="cga_codelet_examples" value="${cg_alit_codelet}examples${fs}"/>
         <property name="cga_codelet_test" value="${cg_alit_codelet}test${fs}"/>

   <!-- Using base directories -->
   <property name="dir_sandbox_parent" value="${sandbox.dir}${fs}"/>
      <property name="dir_sandbox" value="${dir_sandbox_parent}${project_name_fs}"/>
         <property name="dir_sandbox_src" value="${dir_sandbox}src${fs}"/>
            <property name="dir_src_codelet" value="${dir_sandbox_src}${cg_alit_codelet}"/>
         <property name="dir_sandbox_examples" value="${dir_sandbox}examples${fs}"/>
         <property name="dir_sandbox_test" value="${dir_sandbox}test${fs}"/>
         <property name="dir_sandbox_bldfiles" value="${dir_sandbox}z_build${fs}"/>
            <property name="dir_sandbox_jar_dependencies" value="${dir_sandbox_bldfiles}jar_dependencies${fs}"/>

   <property name="dir_build_parent" value="${build.dir}${fs}"/>
      <property name="dir_classes_parent" value="${build.class.dir}${fs}"/>
      <property name="dir_classes" value="${dir_classes_parent}${com_github_alit}"/>
   <property name="dir_build" value="${dir_build_parent}${project_name_for_dir}${fs}"/>
   <property name="dir_build_download" value="${dir_build}download${fs}"/>
      <property name="dir_build_download_codelet_all_jar" value="${dir_build_download}${project_name_for_dir}-all.jar"/>
      <property name="dir_bld_docs" value="${dir_build}documentation${fs}"/>
         <property name="dir_build_docs_javadoc" value="${dir_bld_docs}javadoc${fs}"/>

      <property name="dir_working" value="${working.dir}${fs}${project_name_fs}"/>

      <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.JakartaOroRegexp"/>

<!-- Global properties...END -->

   <!-- See: http://stackoverflow.com/questions/5103384/ant-warning-includeantruntime-was-not-set -->
   <property name="includeantruntime" value="false"/>

<!-- CLASSPATH and custom tasks...START -->
   <path id="project_classpath">
      <fileset dir="${dir_sandbox_jar_dependencies}" includes="*.jar"/>
      <pathelement location="${build.class.dir}"/>
<!--
      <fileset dir="${dir_sandbox_jar_dependencies}">
         <include name="commons-collections4-4.0.jar"/>
         <include name="commons-io-2.4.jar"/>
         <include name="commons-lang3-3.3.2.jar"/>
         <include name="junit-4.8.2.jar"/>
         <include name="xbnjava_0p1p0-all.jar"/>
         <include name="templatefeather_0p1p0-all.jar"/>
         <include name="guava-16.0.1.jar"/>
      </fileset>
 -->
   </path>

   <taskdef name="propfromrplc" classname="com.github.xbn.testdev.ant.ATPropFromRplc" classpathref="project_classpath"/>
   <taskdef name="replaceindent" classname="com.github.xbn.testdev.ant.ATPropFromRplc" classpathref="project_classpath"/>

<!-- CLASSPATH and custom tasks...END -->
   <target name="help" description="Getting started information">
      <echo>This is the Ant build file for ${project.name}.  Try
ant -projecthelp

Installation of the Codelet build process is done in a single step: By changing 'base.dir', in build.properties, to your installation directory.

To do a full build of Codelet:  ant publish</echo>
   </target>

   <property name="dir_sandbox_ant_subxml" value="${dir_sandbox_bldfiles}ant_sub_files${fs}"/>
   <import file="${dir_sandbox_ant_subxml}backup.xml"/>
   <import file="${dir_sandbox_ant_subxml}compile_examples.xml"/>
   <import file="${dir_sandbox_ant_subxml}compile_main.xml"/>
   <import file="${dir_sandbox_ant_subxml}compile_proper.xml"/>
   <import file="${dir_sandbox_ant_subxml}compile_tests.xml"/>
   <import file="${dir_sandbox_ant_subxml}javadoc.xml"/>
   <import file="${dir_sandbox_ant_subxml}javadoc_replace_headers_in_one_dir.xml"/>
   <import file="${dir_sandbox_ant_subxml}refresh.xml"/>
   <import file="${dir_sandbox_ant_subxml}zip.xml"/>

   <!-- For Jeff Epstein only. This file does not exist in published version: -->
      <import file="${dir_sandbox_ant_subxml}gitonly_sandbox__execute_from_main_sandbox_only.xml"
         optional="true"/>

   <target name="copyxbnandtmpljars" description="Duplicates the 'core' jars files from the XBN-Java and Template Featherweight build directories.">
      <property name="xbnjava_project_name_and_version" value="xbnjava-${xbnjava_project_version}"/>
<echo>xbnjava_project_name_and_version=${xbnjava_project_name_and_version}</echo>
      <copy file="${base.dir}\\build\\${xbnjava_project_name_and_version}\\download\\${xbnjava_project_name_and_version}-all.jar" todir="${dir_sandbox_jar_dependencies}"/>

      <property name="templatefeather_project_name_and_version" value="templatefeather-${templatefeather_project_version}"/>
      <copy file="${base.dir}\\build\\${templatefeather_project_name_and_version}\\download\\${templatefeather_project_name_and_version}-all.jar" todir="${dir_sandbox_jar_dependencies}"/>
   </target>
   <target name="-autocopyxbnandtmpljars" if="do.auto.copy.xbn.jars">
      <antcall target="copyxbnandtmpljars"/>
   </target>

   <target name="cp" description="Shortcut for cleanpublish.">
      <antcall target="cleanpublish"/>
   </target>
   <target name="cleanpublish" description="refresh, publish">
      <antcall target="refresh"/>
      <antcall target="publish"/>
   </target>
   <target name="publish" description="Publish Codelet: compileproper, publish2">
      <record name="${dir_build}build_log.txt" action="start"/>
      <antcall target="-autocopyxbnandtmpljars"/>
      <antcall target="compileproper"/>
      <antcall target="publish2"/>
      <record name="${dir_build}build_log.txt" action="stop"/>
   </target>

   <target name="publish2" description="compileexamples, publish3">
      <antcall target="compileexamples"/>
      <antcall target="publish3"/>
   </target>

   <target name="publish3" description="compiletests, unit, jar, doczip, preppom">
      <antcall target="compiletests"/>
      <antcall target="unit"/>
      <antcall target="jar"/>
      <antcall target="doczip"/>
      <antcall target="preppom"/>
   </target>

   <target name="unit" description="Executes com.github.xbn.unittests.UnitTestRunner">
      <java classname="com.github.aliteralmind.codelet.test.UnitTestRunner" failonerror="true" classpathref="project_classpath"/>
   </target>

   <target name="dz" description="Shortcut for doczip.">
      <antcall target="doczip"/>
   </target>
   <target name="doczip" description="doc, doc2, zip, zip2">
      <record name="${dir_build}javadoc_and_zip_log.txt" action="start"/>
      <antcall target="doc"/>
      <antcall target="doc2"/>
      <antcall target="zip"/>
      <antcall target="zip2"/>
      <record name="${dir_build}javadoc_and_zip_log.txt" action="stop"/>
   </target>

   <target name="pp" description="Shortcut for preppom.">
      <antcall target="preppom"/>
   </target>
   <target name="preppom" description="Moves z_build/pom_source_file.xml to pom.xml, and sets the proper version number.">
      <property name="pom_xml_dest" value="${dir_sandbox}pom.xml"/>
      <delete file="${pom_xml_dest}"/><!-- Originates in task preppom. Needed by task clean -->
      <copy file="${dir_sandbox_bldfiles}pom_source_file.xml" tofile="${pom_xml_dest}"/>
      <replace file="${pom_xml_dest}" summary="yes"
         token="^{project_version_number}" value="${version.number}"/>
      <replace file="${pom_xml_dest}" summary="yes"
         token="^{project_build_dir}" value="${dir_build_parent}"/>
      <replace file="${pom_xml_dest}" summary="yes"
         token="^{templatefeather_project_version}" value="${templatefeather_project_version}"/>
   </target>

   <!-- See http://ant.apache.org/faq.html#propertyvalue-as-name-for-property -->
   <macrodef name="propertywithdynamicallynamedvalue">
      <attribute name="propname"/>
      <attribute name="valuepropname"/>
      <sequential>
         <property name="@{propname}" value="${@{valuepropname}}"/>
      </sequential>
   </macrodef>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy