/ build / build.xml
build.xml
   1  <?xml version="1.0"?>
   2  <project name="ArchivesSpace" default="help">
   3    <!-- PROPERTIES -->
   4    <!-- This section contains configuration used by the build tasks -->
   5  
   6    <!-- Don't forget to change any jruby versions in any Gemfiles! -->
   7  
   8    <!-- This needs to match version installed by bundler 2.x: `./build/run bootstrap` -->
   9    <property name="jruby_version" value="9.4.9.0" />
  10    <!-- Then find version at: build/gems/jruby/$version -->
  11    <property name="jruby_build_version" value="3.1.0" />
  12    <!-- Path to jruby bin directory relative to aspace ./build -->
  13    <property name="jruby_build_bin_path" value="./gems/jruby/${jruby_build_version}/bin" />
  14    <!-- Properties for ArchivesSpace build of the JRuby Rack jar -->
  15    <!-- The versions need to match the gem versions in: build/gems/jruby/$version  -->
  16    <property name="jruby_rack_version" value="1.2.6" />
  17    <property name="rack_version" value="2.2.21" />
  18    <property name="bundler_version" value="2.6.9" />
  19    <property name="jetty_version" value="10.0.26" />
  20    <property name="jruby_rack_file" value="jruby-rack-${jruby_rack_version}.jar" />
  21  
  22    <property name="jruby_rack_url" value="https://repo1.maven.org/maven2/org/jruby/rack/jruby-rack/${jruby_rack_version}/jruby-rack-${jruby_rack_version}.jar" />
  23    <property name="jruby_url" value="https://repo1.maven.org/maven2/org/jruby/jruby-complete/${jruby_version}/jruby-complete-${jruby_version}.jar" />
  24    <property name="jruby_file" value="jruby-complete-${jruby_version}.jar" />
  25  
  26    <property name="jettyrunner_url" value="https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-runner/${jetty_version}/jetty-runner-${jetty_version}.jar" />
  27    <property name="jettyrunner_file" value="jetty-runner-${jettry_version}.jar" />
  28    <property name="jettywebapp_url" value="https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-webapp/${jetty_version}/jetty-webapp-${jetty_version}.jar" />
  29    <property name="jettywebapp_file" value="jetty-webapp-${jetty_version}.jar" />
  30  
  31    <property name="gem_home" location="gems" />
  32    <property name="aspace.backend.port" value="4567" />
  33    <property name="aspace.oai.port" value="4568" />
  34    <property name="aspace.frontend.port" value="3000" />
  35    <property name="aspace.public.port" value="3001" />
  36    <property name="aspace.db_url.dev" value="jdbc:mysql://127.0.0.1:3306/archivesspace?useUnicode=true&amp;characterEncoding=UTF-8&amp;user=as&amp;password=as123&amp;useSSL=false&amp;allowPublicKeyRetrieval=true" />
  37    <property name="aspace.db_url.test" value="jdbc:mysql://127.0.0.1:3307/archivesspace?useUnicode=true&amp;characterEncoding=UTF-8&amp;user=as&amp;password=as123&amp;useSSL=false&amp;allowPublicKeyRetrieval=true" />
  38    <property name="aspace.db_host.test" value="127.0.0.1" />
  39    <property name="aspace.db_port.test" value="3307" />
  40    <property name="aspace.db_name.test" value="archivesspace" />
  41    <property name="aspace.db_user.test" value="as" />
  42    <property name="aspace.db_password.test" value="as123" />
  43    <property name="aspace.db_root_password.test" value="123456" />
  44    <property name="aspace.solr_url.dev" value="http://127.0.0.1:8983/solr/archivesspace" />
  45    <property name="aspace.solr_url.test" value="http://127.0.0.1:8984/solr/archivesspace" />
  46    <property name="aspace.data_directory.dev" value="${basedir}/../build/dev" />
  47    <property name="aspace.data_directory.test" value="${basedir}/../build/test" />
  48    <property name="aspace.public_url.test" value="http://127.0.0.1:13001" />
  49  
  50    <property environment="env"/>
  51    <!--
  52        Extra options for people who like lots of GC detail: -verbose:gc -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime
  53    -->
  54    <property name="env.JAVA_OPTS" value="" />
  55    <!-- Setup defaults for MySQL and Solr dev / test environment -->
  56    <!-- the ant properties are defaults; you can set the env value yourself and these lines will have no effect -->
  57    <property name="env.APPCONFIG_DB_URL" value="${aspace.db_url.dev}" />
  58    <property name="env.APPCONFIG_SOLR_URL" value="${aspace.solr_url.dev}" />
  59    <property name="env.APPCONFIG_DATA_DIRECTORY" value="${aspace.data_directory.dev}" />
  60    <property name="env.ASPACE_TEST_DB_URL" value="${aspace.db_url.test}" />
  61    <property name="env.ASPACE_TEST_SOLR_URL" value="${aspace.solr_url.test}" />
  62    <property name="env.ASPACE_TEST_DATA_DIRECTORY" value="${aspace.data_directory.test}" />
  63    <property name="env.APPCONFIG_BACKEND_LOG" value="default" />
  64  
  65    <condition property="java_version_compatibility"  value="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" else="">
  66      <javaversion atleast="17"/>
  67    </condition>
  68  
  69    <property name="default_java_options" value="-Djava.security.egd=file:/dev/./urandom -Xmx2048m -Xss2m -Dfile.encoding=UTF-8 -Daspace.config.search_user_secret=devserver -Daspace.config.public_user_secret=devserver -Daspace.config.staff_user_secret=devserver -Daspace.devserver=true -Daspace.config.frontend_cookie_secret=devserver -Daspace.config.public_cookie_secret=devserver ${java_version_compatibility}" />
  70  
  71    <!-- TASKS -->
  72    <!-- Build tasks invoked using `./build/run [$task]` from the aspace directory -->
  73  
  74    <!-- RUBOCOP -->
  75    <target name="rubocop" depends="set-classpath, bootstrap-jruby" description="Run rubocop against directory">
  76      <property name="build.home" location="."/>
  77      <property name="correct" value="false" />
  78      <property name="dir" value="." />
  79      <condition property="correct-arg" value="--autocorrect" else="">
  80        <istrue value="${correct}" />
  81      </condition>
  82      <antcall target="bundler">
  83        <param name="gemfile" value="../Gemfile" />
  84        <param name="excluded-gem-groups" value="default development test release_notes docs thor" />
  85        <param name="included-gem-groups" value="rubocop" />
  86      </antcall>
  87      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
  88        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
  89        <env key="GEM_HOME" value="${gem_home}" />
  90        <env key="GEM_PATH" value="" />
  91        <env key="BUNDLE_PATH" value="${gem_home}" />
  92        <env key="HOME" value="${build.home}" />
  93        <arg line="../build/${jruby_build_bin_path}/rubocop -f s ${correct-arg} ../${dir}" />
  94      </java>
  95    </target>
  96  
  97    <!-- BACKEND -->
  98    <target name="backend:coverage" depends="set-classpath, backend:test" description="Generate coverage reports for the backend">
  99    </target>
 100  
 101    <target name="backend:devserver" depends="set-classpath" description="Start an instance of the ArchivesSpace backend development server">
 102      <delete dir="${java.io.tmpdir}/jettyrunner.${user.name}" />
 103      <mkdir dir="${java.io.tmpdir}/jettyrunner.${user.name}" />
 104      <parallel>
 105        <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
 106          <jvmarg line="-Daspace.service=backend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} -Daspace.config.ignore_schema_info_check=true ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
 107          <env key="GEM_HOME" value="${gem_home}" />
 108          <env key="GEM_PATH" value="" />
 109          <env key="BUNDLE_PATH" value="${gem_home}" />
 110          <env key="BUNDLE_GEMFILE" value="" />
 111          <env key="ASPACE_ENV" value="development" />
 112          <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
 113          <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
 114          <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 115          <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
 116          <env key="APPCONFIG_BACKEND_LOG" value="${env.APPCONFIG_BACKEND_LOG}" />
 117          <arg line="app/main.rb ${aspace.backend.port}" />
 118        </java>
 119      </parallel>
 120    </target>
 121  
 122    <target name="oai:devserver" depends="set-classpath" description="Start an instance of the OAI development server">
 123      <delete dir="${java.io.tmpdir}/jettyrunner.${user.name}" />
 124      <mkdir dir="${java.io.tmpdir}/jettyrunner.${user.name}" />
 125      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../oai">
 126        <jvmarg line="-Daspace.service=oai -Daspace.config.backend_url=http://localhost:${aspace.backend.port} -Daspace.config.oai_url=http://localhost:${aspace.oai.port} ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
 127        <env key="GEM_HOME" value="${gem_home}" />
 128        <env key="GEM_PATH" value="" />
 129        <env key="BUNDLE_PATH" value="${gem_home}" />
 130        <env key="BUNDLE_GEMFILE" value="" />
 131        <env key="ASPACE_ENV" value="development" />
 132        <arg line="app/main.rb ${aspace.oai.port}" />
 133      </java>
 134    </target>
 135  
 136    <target name="backend:doc" depends="set-classpath" description="Generate documentation for endpoints">
 137      <property name="match" value=""/>
 138      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
 139        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 140        <env key="GEM_HOME" value="${gem_home}" />
 141        <env key="GEM_PATH" value="" />
 142        <env key="BUNDLE_PATH" value="${gem_home}" />
 143        <arg line="-Iapp scripts/endpoint_doc.rb"/>
 144        <arg value="${match}"/>
 145      </java>
 146    </target>
 147  
 148    <target name="backend:integration" depends="set-classpath, setup-integration" description="Run the integration test suite">
 149      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
 150        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 151        <env key="GEM_HOME" value="${gem_home}" />
 152        <env key="GEM_PATH" value="" />
 153        <env key="BUNDLE_PATH" value="${gem_home}" />
 154        <env key="COVERAGE_REPORTS" value="${COVERAGE_REPORTS}" />
 155        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.ASPACE_TEST_DATA_DIRECTORY}" />
 156        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 157        <env key="APPCONFIG_SOLR_URL" value="${env.ASPACE_TEST_SOLR_URL}" />
 158        <arg line="tests/integration.rb" />
 159      </java>
 160    </target>
 161  
 162    <target name="backend:integration:coverage" depends="set-classpath, backend:integration" description="Generate coverage reports for the backend's integration tests">
 163    </target>
 164  
 165    <target name="backend:test" depends="set-classpath, setup-integration" description="Run backend tests">
 166      <dirset id="plugins" dir="../plugins">
 167        <include name="**/backend/spec"/>
 168      </dirset>
 169      <pathconvert pathsep=" " property="plugin-spec-dirs" refid="plugins"/>
 170      <antcall target="rspec">
 171        <param name="dir" value="../backend" />
 172        <param name="coverage_reports" value="true" />
 173        <param name="coverage_report_dir" value="backend" />
 174        <param name="extra-spec-paths" value="${plugin-spec-dirs}"/>
 175      </antcall>
 176    </target>
 177  
 178    <target name="backend:test:no-setup" depends="set-classpath" description="Run backend tests without setting up the database, to be used while developing tests">
 179      <dirset id="plugins" dir="../plugins">
 180        <include name="**/backend/spec"/>
 181      </dirset>
 182      <pathconvert pathsep=" " property="plugin-spec-dirs" refid="plugins"/>
 183      <antcall target="rspec">
 184        <param name="dir" value="../backend" />
 185        <param name="coverage_reports" value="true" />
 186        <param name="coverage_report_dir" value="backend" />
 187        <param name="extra-spec-paths" value="${plugin-spec-dirs}"/>
 188      </antcall>
 189    </target>
 190  
 191    <!-- Run the tests from a plugin directory -->
 192    <target name="backend:test:plugin" depends="set-classpath, setup-integration" description="Run the unit test suite">
 193      <property name="spec" value=""/>
 194      <condition property="example-arg" value="-e &quot;${example}&quot;" else="">
 195        <isset property="example"/>
 196      </condition>
 197      <dirset id="plugins" dir="../..">
 198        <include name="backend/spec"/>
 199        <include name="archivesspace/plugins/**/backend/spec" />
 200      </dirset>
 201      <pathconvert pathsep=" " property="plugin-spec-dirs" refid="plugins"/>
 202      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
 203        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 204        <env key="GEM_HOME" value="${gem_home}" />
 205        <env key="GEM_PATH" value="" />
 206        <env key="BUNDLE_PATH" value="${gem_home}" />
 207        <env key="COVERAGE_REPORTS" value="${COVERAGE_REPORTS}" />
 208        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.ASPACE_TEST_DATA_DIRECTORY}" />
 209        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 210        <env key="APPCONFIG_SOLR_URL" value="${env.ASPACE_TEST_SOLR_URL}" />
 211        <arg line="-X-C ../build/${jruby_build_bin_path}/rspec -b --format d -P '*_spec.rb' --order rand:1 ${example-arg} ${plugin-spec-dirs}" />
 212      </java>
 213    </target>
 214  
 215    <target name="backend:war" depends="set-classpath" description="Deploy the backend application as a .war file">
 216      <antcall target="bundler">
 217        <param name="gemfile" value="../backend/Gemfile" />
 218        <param name="excluded-gem-groups" value="test development doc build" />
 219        <param name="included-gem-groups" value="" />
 220      </antcall>
 221      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
 222        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 223        <env key="GEM_HOME" value="${gem_home}" />
 224        <env key="GEM_PATH" value="" />
 225        <env key="BUNDLE_PATH" value="${gem_home}" />
 226        <arg line="../build/${jruby_build_bin_path}/warble war" />
 227      </java>
 228      <delete file="../backend/.bundle/config" />
 229    </target>
 230  
 231    <!-- BOOTSTRAP -->
 232    <target name="bootstrap" depends="bootstrap-downloads" description="Download JRuby and install all required gems">
 233      <delete dir="gems" />
 234      <!-- Delete any bundler configs to avoid exclude groups sticking around between runs. -->
 235      <delete>
 236        <fileset dir=".." includes="*/.bundle/config" />
 237      </delete>
 238      <property name="excluded-gem-groups" value="" />
 239      <property name="build.home" location="."/>
 240      <java classpath="${jruby_file}" classname="org.jruby.Main" fork="true" failonerror="true">
 241        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 242        <env key="GEM_HOME" value="${gem_home}" />
 243        <env key="GEM_PATH" value="" />
 244        <env key="BUNDLE_PATH" value="${gem_home}" />
 245        <env key="HOME" value="${build.home}" />
 246        <arg line="-S gem install bundler -v ${bundler_version}" />
 247      </java>
 248      <antcall target="bundler">
 249        <param name="gemfile" value="../backend/Gemfile" />
 250        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 251      </antcall>
 252      <antcall target="bundler">
 253        <param name="gemfile" value="../frontend/Gemfile" />
 254        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 255      </antcall>
 256      <antcall target="bundler">
 257        <param name="gemfile" value="../_yard/Gemfile" />
 258        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 259      </antcall>
 260      <antcall target="bundler">
 261        <param name="gemfile" value="../public/Gemfile" />
 262        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 263      </antcall>
 264      <antcall target="bundler">
 265        <param name="gemfile" value="../indexer/Gemfile" />
 266        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 267      </antcall>
 268      <antcall target="bundler">
 269        <param name="gemfile" value="../oai/Gemfile" />
 270        <param name="excluded-gem-groups" value="${excluded-gem-groups}" />
 271      </antcall>
 272    </target>
 273  
 274    <target name="bootstrap-jruby" description="Just jruby and bundler for jobs that do not run the apps">
 275      <property name="build.home" location="."/>
 276        <delete>
 277        <fileset dir="." includes="jruby-complete*.jar" excludes="${jruby_file}" />
 278      </delete>
 279      <get src="${jruby_url}" dest="${jruby_file}" skipexisting="true" verbose="true" usetimestamp="true" />
 280  
 281      <java classpath="${jruby_file}" classname="org.jruby.Main" fork="true" failonerror="true">
 282        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 283        <env key="GEM_HOME" value="${gem_home}" />
 284        <env key="GEM_PATH" value="" />
 285        <env key="BUNDLE_PATH" value="${gem_home}" />
 286        <env key="HOME" value="${build.home}" />
 287        <arg line="-S gem install bundler -v ${bundler_version} --conservative" />
 288      </java>
 289    </target>
 290  
 291    <target name="bootstrap-downloads" description="Download static files used for bootstrapping">
 292      <delete>
 293        <fileset dir="." includes="jruby-complete*.jar" excludes="${jruby_file}" />
 294      </delete>
 295      <mkdir dir="../launcher/lib" />
 296      <delete>
 297        <fileset dir="../launcher/lib" includes="*.jar" excludes="${jettyrunner_file},#{jettywebapp_file}" />
 298      </delete>
 299      <get src="${jruby_url}" dest="${jruby_file}" skipexisting="true" verbose="true" usetimestamp="true" />
 300      <get src="${jruby_rack_url}" dest="${jruby_rack_file}" skipexisting="true" verbose="true" usetimestamp="true" />
 301      <get src="${jettyrunner_url}" dest="../launcher/lib/${jettyrunner_file}" skipexisting="true" verbose="true" usetimestamp="true" />
 302      <get src="${jettywebapp_url}" dest="../launcher/lib/${jettywebapp_file}" skipexisting="true" verbose="true" usetimestamp="true" />
 303    </target>
 304  
 305    <!-- BUILD -->
 306    <target name="build-dist" description="Build a standalone distribution zip of all components">
 307      <antcall target="set-classpath" />
 308      <antcall target="bootstrap">
 309        <param name="excluded-gem-groups" value="test development doc" />
 310      </antcall>
 311      <!-- we want to use warbler for this build task, but since it is going to be filtered out
 312           of the zip (see below), we don't want Bundler whining about it when Bundle.require
 313           is invoked at runtime, so the next line is just about getting a new .bundle/config
 314           file in the backend.war -->
 315      <antcall target="bundler">
 316        <param name="gemfile" value="../backend/Gemfile" />
 317        <param name="excluded-gem-groups" value="test development doc build" />
 318      </antcall>
 319      <parallel>
 320        <antcall target="backend:war" />
 321        <antcall target="frontend:war" />
 322        <antcall target="indexer:war" />
 323        <antcall target="oai:war" />
 324        <antcall target="public:war" />
 325      </parallel>
 326      <antcall target="build-zip" />
 327      <delete dir=".local" failonerror="false" />
 328    </target>
 329  
 330    <target name="build-docker-conf-package" depends="set-classpath" description="Bundle the default configuration, plugins and docker-compose file into a zip file">
 331      <delete failonerror="true" dir="docker_prod" />
 332      <mkdir dir="docker_prod/archivesspace/config" />
 333      <mkdir dir="docker_prod/archivesspace/stylesheets" />
 334      <mkdir dir="docker_prod/archivesspace/backups" />
 335      <mkdir dir="docker_prod/archivesspace/locales" />
 336      <mkdir dir="docker_prod/archivesspace/locales/public" />
 337      <mkdir dir="docker_prod/archivesspace/plugins" />
 338      <mkdir dir="docker_prod/archivesspace/plugins/lcnaf" />
 339      <mkdir dir="docker_prod/archivesspace/plugins/local/indexer" />
 340      <mkdir dir="docker_prod/archivesspace/plugins/local/schemas" />
 341      <mkdir dir="docker_prod/archivesspace/plugins/local/backend/model/mixins" />
 342      <mkdir dir="docker_prod/archivesspace/plugins/local/backend/model/reports" />
 343      <mkdir dir="docker_prod/archivesspace/plugins/local/backend/controllers" />
 344      <mkdir dir="docker_prod/archivesspace/plugins/local/frontend/views" />
 345      <mkdir dir="docker_prod/archivesspace/plugins/local/frontend/locales" />
 346      <mkdir dir="docker_prod/archivesspace/plugins/local/public/views" />
 347      <mkdir dir="docker_prod/archivesspace/plugins/local/public/locales" />
 348      <mkdir dir="docker_prod/archivesspace/sql" />
 349      <mkdir dir="docker_prod/archivesspace/proxy-config" />
 350  
 351      <tstamp />
 352      <property name="version" value="${DSTAMP}-${TSTAMP}"/>
 353      <property name="docker-tag" value="latest"/>
 354  
 355      <copy todir="docker_prod/archivesspace/stylesheets">
 356        <fileset dir="../stylesheets" />
 357      </copy>
 358      <copy todir="docker_prod/archivesspace/locales">
 359        <fileset dir="../common/locales" />
 360      </copy>
 361      <copy todir="docker_prod/archivesspace/locales/public">
 362        <fileset dir="../public/config/locales">
 363          <include name="**/*.yml" />
 364        </fileset>
 365      </copy>
 366  
 367      <copy todir="docker_prod/archivesspace/plugins/lcnaf">
 368        <fileset dir="../plugins/lcnaf"/>
 369      </copy>
 370      <copy file="../docker-compose-prod.yml" tofile="docker_prod/archivesspace/docker-compose.yml"/>
 371      <copy file="../.env.docker.prod" tofile="docker_prod/archivesspace/.env" />
 372      <replace file="docker_prod/archivesspace/.env" token="@docker-tag@" value="${docker-tag}"/>
 373      <copy file="../proxy/default.conf.docker.release" tofile="docker_prod/archivesspace/proxy-config/default.conf"/>
 374  
 375      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 376        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 377        <env key="GEM_HOME" value="${gem_home}" />
 378        <env key="GEM_PATH" value="" />
 379        <env key="BUNDLE_PATH" value="${gem_home}" />
 380  
 381        <env key="APPCONFIG_DB_URL" value="jdbc:mysql://db:3306/archivesspace?useUnicode=true&amp;characterEncoding=UTF-8&amp;user=as&amp;password=as123&amp;useSSL=false&amp;allowPublicKeyRetrieval=true" />
 382        <env key="APPCONFIG_DB_URL" value="jdbc:mysql://db:3306/archivesspace?useUnicode=true&amp;characterEncoding=UTF-8&amp;user=as&amp;password=as123&amp;useSSL=false&amp;allowPublicKeyRetrieval=true" />
 383        <env key="APPCONFIG_SOLR_URL" value="http://solr:8983/solr/archivesspace" />
 384        <env key="APPCONFIG_FORCE_SSL" value="false" />
 385        <env key="APPCONFIG_FRONTEND_PROXY_URL" value="http://localhost/staff" />
 386        <env key="APPCONFIG_OAI_PROXY_URL" value="http://localhost/oai" />
 387        <env key="APPCONFIG_PUBLIC_PROXY_URL" value="http://localhost" />
 388  
 389        <arg line="-Iapp/lib scripts/export_config.rb docker_prod/archivesspace/config/config.rb true" />
 390      </java>
 391      <zip zipfile="../archivesspace-docker-${version}.zip" level="9">
 392        <zipfileset dir="docker_prod" />
 393      </zip>
 394    </target>
 395  
 396    <target name="build-zip" depends="set-classpath" description="Bundle everything up into a zip file">
 397      <delete failonerror="true" dir="target" />
 398      <mkdir dir="target/archivesspace/config" />
 399      <mkdir dir="target/archivesspace/data" />
 400      <mkdir dir="target/archivesspace/docs" />
 401      <mkdir dir="target/archivesspace/wars" />
 402      <mkdir dir="target/archivesspace/gems" />
 403      <mkdir dir="target/archivesspace/lib" />
 404      <mkdir dir="target/archivesspace/logs" />
 405      <mkdir dir="target/archivesspace/launcher" />
 406      <mkdir dir="target/archivesspace/scripts/rb" />
 407      <mkdir dir="target/archivesspace/stylesheets" />
 408      <mkdir dir="target/archivesspace/templates" />
 409      <mkdir dir="target/archivesspace/plugins/cat_in_a_box" />
 410      <mkdir dir="target/archivesspace/plugins/newrelic" />
 411      <mkdir dir="target/archivesspace/plugins/refid_rules" />
 412      <mkdir dir="target/archivesspace/plugins/lcnaf" />
 413      <mkdir dir="target/archivesspace/plugins/local/indexer" />
 414      <mkdir dir="target/archivesspace/plugins/local/schemas" />
 415      <mkdir dir="target/archivesspace/plugins/local/backend/model/mixins" />
 416      <mkdir dir="target/archivesspace/plugins/local/backend/model/reports" />
 417      <mkdir dir="target/archivesspace/plugins/local/backend/controllers" />
 418      <mkdir dir="target/archivesspace/plugins/local/frontend/views" />
 419      <mkdir dir="target/archivesspace/plugins/local/frontend/locales" />
 420      <mkdir dir="target/archivesspace/plugins/local/public/views" />
 421      <mkdir dir="target/archivesspace/plugins/local/public/locales" />
 422      <mkdir dir="target/archivesspace/locales" />
 423      <mkdir dir="target/archivesspace/locales/public" />
 424      <mkdir dir="target/archivesspace/solr" />
 425      <tstamp />
 426      <property name="version" value="${DSTAMP}-${TSTAMP}"/>
 427      <delete file="../common/ARCHIVESSPACE_VERSION" />
 428      <echo file="../common/ARCHIVESSPACE_VERSION">${version}</echo>
 429      <echo>Building version: ${version}</echo>
 430      <!-- This checks the schema_info -->
 431      <!-- count all the rb files in migrations, minus the utils.rb -->
 432      <resourcecount property="schema_info">
 433        <fileset dir="../common/db/migrations">
 434          <include name="*_*.rb" />
 435        </fileset>
 436      </resourcecount>
 437      <jar jarfile="target/archivesspace/lib/common.jar">
 438        <fileset dir="../common" excludes="lib/*" />
 439      </jar>
 440      <copy todir="target/archivesspace/lib">
 441        <fileset dir="../common/lib" />
 442      </copy>
 443      <copy file="../backend/backend.war" todir="target/archivesspace/wars" />
 444      <copy file="../frontend/frontend.war" todir="target/archivesspace/wars" />
 445      <copy file="../public/public.war" tofile="target/archivesspace/wars/public.war" />
 446      <copy file="../indexer/indexer.war" todir="target/archivesspace/wars" />
 447      <copy file="../oai/oai.war" todir="target/archivesspace/wars" />
 448      <copy file="scripts/migrate_db.rb" todir="target/archivesspace/scripts/rb" />
 449      <!-- bundler -->
 450      <copy todir="target/archivesspace/gems">
 451        <fileset dir="gems" excludes="jruby/**" />
 452      </copy>
 453      <!-- jruby gems -->
 454      <copy todir="target/archivesspace/gems">
 455        <fileset dir="gems/jruby/${jruby_build_version}">
 456          <exclude name="cache/**" />
 457          <exclude name="doc/**" />
 458          <exclude name="**/jdbc-mysql-*/**" />
 459          <exclude name="**/warbler-*/**" />
 460        </fileset>
 461      </copy>
 462      <!-- jruby rack -->
 463      <!-- The ArchivesSpace build of the JRuby Rack jar replaces the rubygems bundled version -->
 464      <copy file="${jruby_rack_file}"
 465        todir="target/archivesspace/gems/gems/jruby-rack-${jruby_rack_version}/lib/"
 466        overwrite="true"
 467      />
 468      <copy todir="target/archivesspace/launcher">
 469        <fileset dir="../launcher" excludes="backup/*" />
 470      </copy>
 471      <copy todir="target/archivesspace/locales">
 472        <fileset dir="../common/locales" />
 473      </copy>
 474      <copy todir="target/archivesspace/locales/public">
 475        <fileset dir="../public/config/locales">
 476          <include name="**/*.yml" />
 477        </fileset>
 478      </copy>
 479      <copy todir="target/archivesspace/docs">
 480        <fileset dir="../docs" />
 481      </copy>
 482      <copy todir="target/archivesspace/plugins/newrelic">
 483        <fileset dir="../plugins/newrelic"/>
 484      </copy>
 485      <copy todir="target/archivesspace/plugins/cat_in_a_box">
 486        <fileset dir="../plugins/cat_in_a_box"/>
 487      </copy>
 488      <copy todir="target/archivesspace/plugins/refid_rules">
 489        <fileset dir="../plugins/refid_rules"/>
 490      </copy>
 491      <copy todir="target/archivesspace/plugins/lcnaf">
 492        <fileset dir="../plugins/lcnaf"/>
 493      </copy>
 494      <copy todir="target/archivesspace/solr">
 495        <fileset dir="../solr" excludes=".dockerignore,Dockerfile,delete*" />
 496      </copy>
 497      <copy todir="target/archivesspace/stylesheets">
 498        <fileset dir="../stylesheets"/>
 499      </copy>
 500      <copy todir="target/archivesspace/templates">
 501        <fileset dir="../templates"/>
 502      </copy>
 503      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 504        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 505        <env key="GEM_HOME" value="${gem_home}" />
 506        <env key="GEM_PATH" value="" />
 507        <env key="BUNDLE_PATH" value="${gem_home}" />
 508        <arg line="-Iapp/lib scripts/export_config.rb target/archivesspace/config/config.rb" />
 509      </java>
 510      <zip zipfile="../archivesspace-${version}.zip" level="9">
 511        <zipfileset dir="target" excludes="**/mysql-connector-j*.jar" />
 512        <zipfileset dir=".." includes="README.md" prefix="archivesspace" filemode="644" />
 513        <zipfileset dir=".." includes="COPYING" prefix="archivesspace" filemode="644" />
 514        <zipfileset dir=".." includes="launcher_rc.rb" prefix="archivesspace" filemode="644" />
 515        <zipfileset dir="../common" includes="ARCHIVESSPACE_VERSION" prefix="archivesspace" filemode="644" />
 516        <zipfileset dir="../clustering" prefix="archivesspace/clustering" filemode="755" />
 517        <zipfileset dir="../reports" prefix="archivesspace/reports" filemode="755" />
 518        <zipfileset dir="../launcher" includes="archivesspace.sh" prefix="archivesspace" filemode="755" />
 519        <zipfileset dir="../launcher" includes="archivesspace.bat" prefix="archivesspace" filemode="644" />
 520        <zipfileset dir="../launcher/scripts" includes="find-base.sh" prefix="archivesspace/scripts" filemode="755" />
 521        <zipfileset dir="../launcher/scripts" includes="setup-database.sh" prefix="archivesspace/scripts" filemode="755" />
 522        <zipfileset dir="../launcher/scripts" includes="setup-database.bat" prefix="archivesspace/scripts" filemode="755" />
 523        <zipfileset dir="../launcher/plugin_gems" includes="initialize-plugin.sh" prefix="archivesspace/scripts" filemode="755" />
 524        <zipfileset dir="../launcher/plugin_gems" includes="initialize-plugin.bat" prefix="archivesspace/scripts" filemode="644" />
 525        <zipfileset dir="../launcher/password_reset" includes="password-reset.sh" prefix="archivesspace/scripts" filemode="755" />
 526        <zipfileset dir="../launcher/password_reset" includes="password-reset.bat" prefix="archivesspace/scripts" filemode="644" />
 527        <zipfileset dir="../launcher/backup" includes="backup.sh" prefix="archivesspace/scripts" filemode="755" />
 528        <zipfileset dir="../launcher/backup" includes="backup.bat" prefix="archivesspace/scripts" filemode="644" />
 529        <zipfileset dir="../launcher/ead_export" includes="ead_export.sh" prefix="archivesspace/scripts" filemode="755" />
 530        <zipfileset dir="../launcher/ead_export" includes="ead_export.bat" prefix="archivesspace/scripts" filemode="644" />
 531      </zip>
 532    </target>
 533  
 534    <!-- BUNDLER -->
 535    <target name="bundler" depends="set-classpath" description="Run bundler against a gemfile">
 536      <!-- Make sure .bundle tracks the $gemfile location -->
 537      <!-- This will break if Gemfiles are not named "Gemfile" -->
 538      <exec executable="sed" inputstring="${gemfile}" outputproperty="bundle-config-path">
 539        <arg value="s/Gemfile/\.bundle/g"/>
 540      </exec>
 541      <property name="bundle-config" value="${basedir}/${bundle-config-path}" />
 542      <property name="excluded-gem-groups" value="" />
 543      <property name="included-gem-groups" value="" />
 544      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 545        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 546        <env key="GEM_HOME" value="${gem_home}" />
 547        <env key="GEM_PATH" value="" />
 548        <env key="BUNDLE_PATH" value="${gem_home}" />
 549        <env key="BUNDLE_APP_CONFIG" value="${bundle-config}" />
 550        <arg line="gems/bin/bundle config unset without" />
 551      </java>
 552      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 553        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 554        <env key="GEM_HOME" value="${gem_home}" />
 555        <env key="GEM_PATH" value="" />
 556        <env key="BUNDLE_PATH" value="${gem_home}" />
 557        <env key="BUNDLE_APP_CONFIG" value="${bundle-config}" />
 558        <arg line="gems/bin/bundle config unset with" />
 559      </java>
 560      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 561        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 562        <env key="GEM_HOME" value="${gem_home}" />
 563        <env key="GEM_PATH" value="" />
 564        <env key="BUNDLE_PATH" value="${gem_home}" />
 565        <env key="BUNDLE_APP_CONFIG" value="${bundle-config}" />
 566        <arg line="gems/bin/bundle config without ${excluded-gem-groups}" />
 567      </java>
 568      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 569        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 570        <env key="GEM_HOME" value="${gem_home}" />
 571        <env key="GEM_PATH" value="" />
 572        <env key="BUNDLE_PATH" value="${gem_home}" />
 573        <env key="BUNDLE_APP_CONFIG" value="${bundle-config}" />
 574        <arg line="gems/bin/bundle config with ${included-gem-groups}" />
 575      </java>
 576      <echo message="Bundler running with config:" />
 577      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 578        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 579        <env key="BUNDLE_APP_CONFIG" value="${bundle-config}" />
 580        <arg line="gems/bin/bundle config list" />
 581      </java>
 582      <echo message="Fetching gems for ${gemfile}" />
 583      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 584        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 585        <env key="GEM_HOME" value="${gem_home}" />
 586        <env key="GEM_PATH" value="" />
 587        <env key="BUNDLE_PATH" value="${gem_home}" />
 588        <arg line="gems/bin/bundle install --jobs=8 --gemfile='${gemfile}'" />
 589      </java>
 590    </target>
 591  
 592    <target name="bundler:update" depends="set-classpath" description="Run bundler update against a gemfile for all or just one specific gem, example: ./build/run bundler:update -Donly-gem='selenium-webdriver' -Dgemfile=../frontend/Gemfile">
 593      <property name="build.home" location="."/>
 594      <property name="only-gem" value="" />
 595      <echo message="Fetching gems for ${gemfile}" />
 596      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 597        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 598        <env key="GEM_HOME" value="${gem_home}" />
 599        <env key="GEM_PATH" value="" />
 600        <env key="BUNDLE_PATH" value="${gem_home}" />
 601        <env key="HOME" value="${build.home}" />
 602        <arg line="gems/bin/bundle update --ruby --jobs=8 --gemfile='${gemfile}' ${only-gem}" />
 603      </java>
 604    </target>
 605  
 606    <target name="bundle:frontend" depends="set-classpath"  description="Bundle just the frontend (staff interface)">
 607      <antcall target="bundler">
 608        <param name="gemfile" value="../frontend/Gemfile" />
 609      </antcall>
 610    </target>
 611  
 612    <target name="bundle:public" depends="set-classpath"  description="Bundle just the public interface">
 613      <antcall target="bundler">
 614        <param name="gemfile" value="../public/Gemfile" />
 615      </antcall>
 616    </target>
 617  
 618    <target name="bundle:public:update" depends="set-classpath"  description="Bundle just the public interface">
 619      <antcall target="bundler:update">
 620        <param name="gemfile" value="../public/Gemfile" />
 621      </antcall>
 622    </target>
 623  
 624    <!-- RSPEC -->
 625    <target name="rspec" depends="set-classpath" description="Run rspec">
 626      <property name="dir" value="../build/null"/><!--must be set by caller -->
 627      <property name="extra-spec-paths" value="" />
 628      <condition property="spec-arg" value="spec/${spec}" else="spec">
 629          <isset property="spec"/>
 630      </condition>
 631      <condition property="example-arg" value="-e &quot;${example}&quot;" else="">
 632        <isset property="example"/>
 633      </condition>
 634      <condition property="tag-arg" value="--tag &quot;${tag}&quot;" else="">
 635        <isset property="tag"/>
 636      </condition>
 637      <condition property="order-arg" value="--order &quot;${order}&quot;" else="--order rand:1">
 638        <isset property="order"/>
 639      </condition>
 640      <condition property="pattern-arg" value="-P &quot;${pattern}&quot;" else="">
 641        <isset property="pattern"/>
 642      </condition>
 643      <condition property="test-server-url-arg" value="${test-server-url}" else="">
 644        <isset property="test-server-url"/>
 645      </condition>
 646  
 647      <echo message="Running rspec" />
 648      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="${dir}">
 649        <jvmarg line="${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
 650        <env key="COVERAGE_REPORTS" value="${coverage_reports}" />
 651        <env key="COVERAGE_REPORT_DIR" value="${coverage_report_dir}" />
 652        <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
 653        <env key="GEM_HOME" value="${gem_home}" />
 654        <env key="GEM_PATH" value="" />
 655        <env key="BUNDLE_PATH" value="${gem_home}" />
 656        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.ASPACE_TEST_DATA_DIRECTORY}" />
 657        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 658        <env key="APPCONFIG_SOLR_URL" value="${env.ASPACE_TEST_SOLR_URL}" />
 659        <env key="TEST_MODE" value="1" />
 660        <env key="ASPACE_TEST_APP_SERVER_URL" value="${test-server-url-arg}" />
 661        <arg line="../build/gems/bin/bundle exec rspec -b --format d ${pattern-arg} ${tag-arg} ${order-arg} ${example-arg} ${spec-arg} ${extra-spec-paths} --profile" />
 662      </java>
 663    </target>
 664  
 665    <!-- COMMON -->
 666    <target name="common:test" depends="set-classpath" description="Run the unit test suite for common">
 667      <condition property="spec-arg" value="spec/${spec}" else="spec">
 668          <isset property="spec"/>
 669      </condition>
 670      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../common">
 671        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 672        <env key="GEM_HOME" value="${gem_home}" />
 673        <env key="GEM_PATH" value="" />
 674        <env key="BUNDLE_PATH" value="${gem_home}" />
 675        <env key="COVERAGE_REPORTS" value="true" />
 676        <env key="COVERAGE_REPORT_DIR" value="common" />
 677  
 678        <!-- NOTE: We explicitly add '.' to the load path here because
 679             we're running from common/ and JRuby 9k refuses to load
 680             `config/config-distribution` because it won't load anything
 681             from the current directory on principle (even when that current
 682             directory is on the classpath!).  Explicitly setting the load
 683             path fixes this test. -->
 684        <arg line="-I. ../build/${jruby_build_bin_path}/rspec -P '**/*_spec.rb' --order rand:1 ${spec-arg}" />
 685      </java>
 686    </target>
 687  
 688    <target name="clean-coverage">
 689      <delete dir="../coverage" />
 690    </target>
 691  
 692    <!-- DATABASE -->
 693    <target name="db:migrate" depends="set-classpath" description="Run migrations against the database configured in config/config.rb">
 694      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 695        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 696        <env key="GEM_HOME" value="${gem_home}" />
 697        <env key="GEM_PATH" value="" />
 698        <env key="BUNDLE_PATH" value="${gem_home}" />
 699        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 700        <arg line="-Iapp/lib ../build/scripts/migrate_db.rb" />
 701      </java>
 702    </target>
 703  
 704    <target name="db:user_password_reset" depends="set-classpath" description="Reset the password of a user, e.g. ./build/run db:user_password_reset -Dusername='admin' -Dpassword='test'">
 705      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 706        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 707        <env key="GEM_HOME" value="${gem_home}" />
 708        <env key="GEM_PATH" value="" />
 709        <env key="BUNDLE_PATH" value="${gem_home}" />
 710        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 711        <arg line="-Iapp/lib ../launcher/password_reset/lib/password-reset.rb ${username} ${password}" />
 712      </java>
 713    </target>
 714  
 715    <target name="db:migrate:test" depends="set-classpath" description="Run migrations against the test database">
 716      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 717        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 718        <env key="GEM_HOME" value="${gem_home}" />
 719        <env key="GEM_PATH" value="" />
 720        <env key="BUNDLE_PATH" value="${gem_home}" />
 721        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 722        <arg line="-Iapp/lib ../build/scripts/migrate_db.rb" />
 723      </java>
 724    </target>
 725  
 726    <target name="db:nuke" depends="set-classpath" description="Delete database and shared storage directory">
 727      <delete dir="${env.APPCONFIG_DATA_DIRECTORY}/shared" />
 728      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 729        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 730        <env key="GEM_HOME" value="${gem_home}" />
 731        <env key="GEM_PATH" value="" />
 732        <env key="BUNDLE_PATH" value="${gem_home}" />
 733        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 734        <arg line="-Iapp/lib ../build/scripts/migrate_db.rb nuke" />
 735      </java>
 736    </target>
 737  
 738    <target name="db:nuke:test" depends="set-classpath" description="Delete the test database and shared storage directory">
 739      <delete dir="${env.ASPACE_TEST_DATA_DIRECTORY}/shared" />
 740      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true">
 741        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 742        <env key="GEM_HOME" value="${gem_home}" />
 743        <env key="GEM_PATH" value="" />
 744        <env key="BUNDLE_PATH" value="${gem_home}" />
 745        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 746        <arg line="-Iapp/lib ../build/scripts/migrate_db.rb nuke" />
 747      </java>
 748    </target>
 749  
 750    <target name="db:dump:test" description="Create a new dump of the test database">
 751      <exec dir="${basedir}" executable="mysqldump"  newenvironment="false" failonerror="true" logError="true" output="../frontend/spec/fixtures/archivesspace-test.sql">
 752        <arg line="--host='${aspace.db_host.test}' --port='${aspace.db_port.test}' -u root -p${aspace.db_root_password.test} ${aspace.db_name.test}"/>
 753      </exec>
 754    </target>
 755  
 756    <target name="db:load:test" description="Create a new dump of the test database">
 757      <exec dir="${basedir}" executable="mysql"  newenvironment="false" failonerror="true" input="../frontend/spec/fixtures/archivesspace-test.sql">
 758        <arg line="--host='${aspace.db_host.test}' --port='${aspace.db_port.test}' -u ${aspace.db_user.test} -p${aspace.db_password.test} ${aspace.db_name.test}"/>
 759      </exec>
 760    </target>
 761  
 762    <!-- DOCS -->
 763    <target name="doc:api" depends="set-classpath, bootstrap-jruby" description="Generate markdown for API documentation">
 764      <antcall target="bundler">
 765        <param name="gemfile" value="../Gemfile" />
 766      </antcall>
 767      <antcall target="thor">
 768        <param name="task" value="doc:api" />
 769      </antcall>
 770    </target>
 771  
 772    <target name="doc:build" depends="set-classpath" description="Generate YARD documentation">
 773      <antcall target="doc:yardoc" />
 774    </target>
 775  
 776    <target name="doc:yardoc" depends="set-classpath" description="Run the yardoc command">
 777      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="..">
 778        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 779        <env key="GEM_HOME" value="${gem_home}" />
 780        <env key="GEM_PATH" value="" />
 781        <env key="BUNDLE_PATH" value="${gem_home}" />
 782        <arg line="build/${jruby_build_bin_path}/yardoc" />
 783      </java>
 784      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="..">
 785        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 786        <env key="GEM_HOME" value="${gem_home}" />
 787        <env key="GEM_PATH" value="" />
 788        <env key="BUNDLE_PATH" value="${gem_home}" />
 789        <arg line="build/${jruby_build_bin_path}/yardoc -f txt" />
 790      </java>
 791    </target>
 792  
 793    <target name="doc:release_notes" depends="set-classpath, bootstrap-jruby" description="Generate markdown for API documentation">
 794      <property name="current_tag" value=""/>
 795      <property name="outfile" value="RELEASE_NOTES_${current_tag}.md" />
 796      <property name="token" value=""/>
 797      <property name="gh_user" value="archivesspace" />
 798      <antcall target="bundler">
 799        <param name="gemfile" value="../Gemfile" />
 800        <param name="included-gem-groups" value="thor release_notes" />
 801        <param name="excluded-gem-groups" value="default test development docs build rubocop" />
 802      </antcall>
 803      <antcall target="thor">
 804        <param name="task" value="doc:release_notes" />
 805        <param name="task_args" value="--current_tag=${current_tag} --out=${outfile} --token=${token} --gh_user=${gh_user}" />
 806      </antcall>
 807    </target>
 808  
 809    <!-- HELP -->
 810    <target name="help" description="This help">
 811      <java classname="org.apache.tools.ant.Main">
 812        <arg value="-projecthelp" />
 813        <arg value="-buildfile" />
 814        <arg value="${ant.file}" />
 815      </java>
 816    </target>
 817  
 818    <!-- INDEXER -->
 819    <target name="indexer" depends="set-classpath" description="Run the search indexer">
 820      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../indexer">
 821        <jvmarg line="-Daspace.service=indexer -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ ${default_java_options} ${env.JAVA_OPTS}  -Djruby.debug.fullTrace=true"/>
 822        <env key="GEM_HOME" value="${gem_home}" />
 823        <env key="GEM_PATH" value="" />
 824        <env key="BUNDLE_PATH" value="${gem_home}" />
 825        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
 826        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 827        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
 828        <env key="ASPACE_ENV" value="development" />
 829        <arg line="app/main.rb" />
 830      </java>
 831    </target>
 832  
 833    <target name="indexer:coverage" depends="set-classpath, indexer:test" description="Generate coverage reports for the indexer">
 834    </target>
 835  
 836    <target name="indexer:test" depends="set-classpath" description="Run the unit test suite for the indexer">
 837      <property name="spec" value=""/>
 838      <condition property="example-arg" value="-e &quot;${example}&quot;" else="">
 839        <isset property="example"/>
 840      </condition>
 841      <antcall target="rspec">
 842        <param name="coverage_reports" value="true" />
 843        <param name="coverage_report_dir" value="indexer" />
 844        <param name="dir" value="../indexer" />
 845      </antcall>
 846    </target>
 847  
 848    <target name="indexer:war" depends="set-classpath" description="Deploy the indexer application as a .war file">
 849      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../indexer">
 850        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 851        <env key="GEM_HOME" value="${gem_home}" />
 852        <env key="GEM_PATH" value="" />
 853        <env key="BUNDLE_PATH" value="${gem_home}" />
 854        <arg line="../build/${jruby_build_bin_path}/warble war" />
 855      </java>
 856      <delete file="../indexer/.bundle/config" />
 857    </target>
 858  
 859    <!-- OAI -->
 860    <target name="oai:war" depends="set-classpath" description="Deploy the OAI application as a .war file">
 861      <antcall target="bundler">
 862        <param name="gemfile" value="../oai/Gemfile" />
 863        <param name="excluded-gem-groups" value="test development doc build" />
 864        <param name="included-gem-groups" value="" />
 865      </antcall>
 866      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../oai">
 867        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 868        <env key="GEM_HOME" value="${gem_home}" />
 869        <env key="GEM_PATH" value="" />
 870        <env key="BUNDLE_PATH" value="${gem_home}" />
 871        <arg line="../build/${jruby_build_bin_path}/warble war" />
 872      </java>
 873      <delete file="../oai/.bundle/config" />
 874    </target>
 875  
 876    <!-- FRONTEND -->
 877    <target name="frontend:clean" description="Delete the Rails tmp directory">
 878      <delete failonerror="false" dir="../frontend/tmp" />
 879      <delete failonerror="false" dir="../frontend/public/assets" />
 880      <mkdir dir="../frontend/public/assets" />
 881      <mkdir dir="../frontend/public/assets/00-do-not-put-things-here" />
 882    </target>
 883  
 884    <target name="frontend:copy:templates">
 885      <copy todir="../frontend/docs" overwrite="true">
 886        <fileset dir="../templates" includes="*.csv *.xlsx" />
 887      </copy>
 888    </target>
 889  
 890    <target name="frontend:console" depends="set-classpath" description="Run the rails console">
 891      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
 892        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 893        <env key="GEM_HOME" value="${gem_home}" />
 894        <env key="GEM_PATH" value="" />
 895        <env key="BUNDLE_PATH" value="${gem_home}" />
 896        <arg line="script/rails console" />
 897      </java>
 898    </target>
 899  
 900    <target name="frontend:coverage" depends="set-classpath, frontend:clean, frontend:test" description="Generate coverage reports for the frontend">
 901    </target>
 902  
 903    <target name="frontend:devserver" depends="set-classpath, frontend:clean, frontend:copy:templates" description="Start an instance of the ArchivesSpace frontend development server">
 904      <condition property="rails.env" value="test" else="development">
 905        <matches pattern="true" string="${aspace.integration}" />
 906      </condition>
 907      <record name="frontend_test_log.out" action="start" />
 908      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
 909        <jvmarg line="-Daspace.service=frontend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
 910        <env key="GEM_HOME" value="${gem_home}" />
 911        <env key="GEM_PATH" value="" />
 912        <env key="RAILS_ENV" value="${rails.env}" />
 913        <env key="BUNDLE_PATH" value="${gem_home}" />
 914        <env key="ASPACE_ENV" value="development" />
 915        <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
 916        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
 917        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 918        <env key="APPCONFIG_FRONTEND_PROXY_URL" value="http://localhost:3000" />
 919        <env key="APPCONFIG_PUBLIC_PROXY_URL" value="http://localhost:3001" />
 920        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
 921        <arg line="script/rails s -b 0.0.0.0 --port=${aspace.frontend.port}" />
 922      </java>
 923      <record name="frontend_test_log.out" action="stop" />
 924    </target>
 925  
 926    <target name="frontend:devserver:prefix" depends="set-classpath, frontend:clean, frontend:copy:templates" description="Start an instance of the ArchivesSpace frontend development server">
 927      <condition property="rails.env" value="test" else="development">
 928        <matches pattern="true" string="${aspace.integration}" />
 929      </condition>
 930      <record name="frontend_test_log.out" action="start" />
 931      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
 932        <jvmarg line="-Daspace.service=frontend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
 933        <env key="GEM_HOME" value="${gem_home}" />
 934        <env key="GEM_PATH" value="" />
 935        <env key="RAILS_ENV" value="${rails.env}" />
 936        <env key="BUNDLE_PATH" value="${gem_home}" />
 937        <env key="ASPACE_ENV" value="development" />
 938        <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
 939        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
 940        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
 941        <env key="APPCONFIG_FRONTEND_PROXY_URL" value="http://localhost/staff" />
 942        <env key="APPCONFIG_PUBLIC_PROXY_URL" value="http://localhost/public" />
 943        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
 944        <arg line="script/rails s -b 0.0.0.0 --port=${aspace.frontend.port}" />
 945      </java>
 946      <record name="frontend_test_log.out" action="stop" />
 947    </target>
 948  
 949    <target name="frontend:test" depends="set-classpath, frontend:clean, setup-integration" description="Run the frontend capybara tests">
 950      <property name="tag" value="~db"/>
 951      <antcall target="rspec">
 952        <param name="coverage_reports" value="true" />
 953        <param name="coverage_report_dir" value="frontend" />
 954        <param name="aspace.integration" value="true" />
 955        <param name="dir" value="../frontend" />
 956        <!-- feature tests copied from old selenium tests may be order-dependent -->
 957        <param name="order" value="defined" />
 958        <param name="tag" value="${tag}" />
 959      </antcall>
 960    </target>
 961  
 962    <target name="frontend:test:no-setup" depends="set-classpath, frontend:clean" description="Run the frontend capybara tests">
 963      <property name="tag" value="~db"/>
 964      <antcall target="rspec">
 965        <param name="coverage_reports" value="true" />
 966        <param name="coverage_report_dir" value="frontend" />
 967        <param name="aspace.integration" value="true" />
 968        <param name="dir" value="../frontend" />
 969        <!-- feature tests copied from old selenium tests may be order-dependent -->
 970        <param name="order" value="defined" />
 971        <param name="tag" value="${tag}" />
 972      </antcall>
 973    </target>
 974  
 975    <target name="frontend:test:plugin" depends="set-classpath, setup-integration" description="Run the unit test suite">
 976      <property name="spec" value=""/>
 977      <condition property="example-arg" value="-e &quot;${example}&quot;" else="">
 978        <isset property="example"/>
 979      </condition>
 980      <dirset id="plugins" dir="../..">
 981        <include name="frontend/spec"/>
 982        <include name="archivesspace/plugins/**/frontend/spec"/>
 983      </dirset>
 984      <pathconvert pathsep=" " property="plugin-spec-dirs" refid="plugins"/>
 985      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
 986        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
 987        <env key="GEM_HOME" value="${gem_home}" />
 988        <env key="GEM_PATH" value="" />
 989        <env key="BUNDLE_PATH" value="${gem_home}" />
 990        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.ASPACE_TEST_DATA_DIRECTORY}" />
 991        <env key="APPCONFIG_DB_URL" value="${env.ASPACE_TEST_DB_URL}" />
 992        <env key="APPCONFIG_SOLR_URL" value="${env.ASPACE_TEST_SOLR_URL}" />
 993        <arg line="../build/${jruby_build_bin_path}/rspec -b --format d -P '*_spec.rb' --order rand:1 ${example-arg} ${plugin-spec-dirs}" />
 994      </java>
 995    </target>
 996  
 997    <target name="frontend:assets:precompile" depends="set-classpath, frontend:clean, frontend:copy:templates" description="Precompile the frontend application javascript and stylesheet assets">
 998      <antcall target="bundler">
 999        <param name="gemfile" value="../frontend/Gemfile" />
1000        <param name="included-gem-groups" value="assets" />
1001        <param name="excluded-gem-groups" value="test development doc build" />
1002      </antcall>
1003      <echo message="Precompiling Rails assets (this can take a little while...)" />
1004      <delete failonerror="false" dir="../frontend/tmp" />
1005      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
1006        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}" />
1007        <env key="RAILS_ENV" value="production" />
1008        <env key="GEM_HOME" value="${gem_home}" />
1009        <env key="GEM_PATH" value="" />
1010        <env key="BUNDLE_PATH" value="${gem_home}" />
1011        <arg line="-S rake assets:precompile --trace" />
1012      </java>
1013    </target>
1014  
1015    <target name="frontend:war" depends="set-classpath, frontend:assets:precompile" description="Deploy the frontend application as a .war file">
1016      <antcall target="bundler">
1017        <param name="gemfile" value="../frontend/Gemfile" />
1018        <param name="excluded-gem-groups" value="test development doc build assets" />
1019        <param name="included-gem-groups" value="" />
1020      </antcall>
1021      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
1022        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
1023        <env key="GEM_HOME" value="${gem_home}" />
1024        <env key="GEM_PATH" value="" />
1025        <env key="BUNDLE_PATH" value="${gem_home}" />
1026        <arg line="../build/${jruby_build_bin_path}/warble war" />
1027      </java>
1028      <delete file="../frontend/.bundle/config" />
1029    </target>
1030  
1031    <!-- PUBLIC -->
1032    <target name="public:clean" description="Delete the Rails tmp directory">
1033      <delete dir="../public/tmp" />
1034      <delete dir="../public/public/assets" />
1035      <mkdir dir="../public/public/assets" />
1036      <mkdir dir="../public/public/assets/00-do-not-put-things-here" />
1037    </target>
1038  
1039    <target name="public:console" depends="set-classpath" description="Run the rails console">
1040      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
1041        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
1042        <env key="GEM_HOME" value="${gem_home}" />
1043        <env key="GEM_PATH" value="" />
1044        <env key="BUNDLE_PATH" value="${gem_home}" />
1045        <arg line="bin/rails console" />
1046      </java>
1047    </target>
1048  
1049    <target name="public:copy-shared-resources" description="Copy shared JS/CSS into the public application">
1050      <antcall target="-public:copy-shared-resources">
1051        <param name="publicdir" value="public" />
1052      </antcall>
1053    </target>
1054  
1055    <target name="-public:copy-shared-resources" description="Copy shared JS/CSS into the public application">
1056      <property name="publicdir" value="" />
1057      <mkdir dir="../${publicdir}/vendor/assets/stylesheets/archivesspace" />
1058      <concat destfile="../${publicdir}/vendor/assets/javascripts/largetree.js.erb">
1059        <header trimleading="yes"><![CDATA[<%# DON'T EDIT THIS FILE -- the canonical version is under the frontend project %>
1060        ]]>
1061        </header>
1062        <fileset file="../frontend/app/assets/javascripts/largetree.js.erb" />
1063      </concat>
1064      <concat destfile="../${publicdir}/vendor/assets/stylesheets/archivesspace/largetree.scss">
1065        <header trimleading="yes">
1066          <!-- DON'T EDIT THIS FILE: the canonical version is under the frontend project -->
1067        </header>
1068        <fileset file="../frontend/app/assets/stylesheets/archivesspace/largetree.scss" />
1069      </concat>
1070    </target>
1071  
1072    <target name="public:coverage" depends="set-classpath, public:clean, public:test" description="Generate coverage reports for the public interface">
1073    </target>
1074  
1075    <target name="public:devserver" depends="set-classpath, public:clean, public:copy-shared-resources" description="Start an instance of the ArchivesSpacePublic development server">
1076      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
1077        <jvmarg line="-Daspace.service=public -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ -Daspace.config.public_url=http://localhost:${aspace.public.port}/ ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
1078        <env key="GEM_HOME" value="${gem_home}" />
1079        <env key="GEM_PATH" value="" />
1080        <env key="BUNDLE_PATH" value="${gem_home}" />
1081        <env key="ASPACE_ENV" value="development" />
1082        <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
1083        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
1084        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
1085        <env key="APPCONFIG_FRONTEND_PROXY_URL" value="http://localhost:3000" />
1086        <env key="APPCONFIG_PUBLIC_PROXY_URL" value="http://localhost:3001" />
1087        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
1088        <arg line="bin/rails s -b 0.0.0.0 --port=${aspace.public.port}" />
1089      </java>
1090    </target>
1091  
1092    <target name="public:devserver:prefix" depends="set-classpath, public:clean, public:copy-shared-resources" description="Start an instance of the ArchivesSpacePublic development server">
1093      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
1094        <jvmarg line="-Daspace.service=public -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ -Daspace.config.public_url=http://localhost:${aspace.public.port}/ ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
1095        <env key="GEM_HOME" value="${gem_home}" />
1096        <env key="GEM_PATH" value="" />
1097        <env key="BUNDLE_PATH" value="${gem_home}" />
1098        <env key="ASPACE_ENV" value="development" />
1099        <env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
1100        <env key="APPCONFIG_DATA_DIRECTORY" value="${env.APPCONFIG_DATA_DIRECTORY}" />
1101        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
1102        <env key="APPCONFIG_FRONTEND_PROXY_URL" value="http://localhost/staff" />
1103        <env key="APPCONFIG_PUBLIC_PROXY_URL" value="http://localhost/public" />
1104        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
1105        <arg line="bin/rails s -b 0.0.0.0 --port=${aspace.public.port}" />
1106      </java>
1107    </target>
1108  
1109    <target name="public:test" depends="set-classpath, setup-integration, public:copy-shared-resources" description="Run the unit test suite">
1110      <property name="tag" value="~db"/>
1111      <antcall target="rspec">
1112        <param name="coverage_reports" value="true" />
1113        <param name="coverage_report_dir" value="public" />
1114        <param name="aspace.integration" value="true" />
1115        <param name="dir" value="../public" />
1116        <param name="tag" value="${tag}" />
1117        <param name="test-server-url" value="${aspace.public_url.test}" />
1118      </antcall>
1119    </target>
1120  
1121    <target name="public:assets:precompile" depends="set-classpath, public:clean, public:copy-shared-resources" description="Precompile the public application javascript and stylesheet assets">
1122      <antcall target="bundler">
1123        <param name="gemfile" value="../public/Gemfile" />
1124        <param name="included-gem-groups" value="assets" />
1125        <param name="excluded-gem-groups" value="test development doc build" />
1126      </antcall>
1127      <echo message="Precompiling Rails assets for Public (this can take a little while...)" />
1128      <delete dir="../public/tmp" />
1129      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
1130        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}" />
1131        <env key="RAILS_ENV" value="production" />
1132        <env key="GEM_HOME" value="${gem_home}" />
1133        <env key="GEM_PATH" value="" />
1134        <env key="BUNDLE_PATH" value="${gem_home}" />
1135        <arg line="-S rake assets:precompile --trace" />
1136      </java>
1137    </target>
1138  
1139    <target name="public:war" depends="set-classpath, public:assets:precompile" description="Deploy the public application as a .war file">
1140      <antcall target="bundler">
1141        <param name="gemfile" value="../public/Gemfile" />
1142        <param name="excluded-gem-groups" value="test development doc build assets" />
1143        <param name="included-gem-groups" value="" />
1144      </antcall>
1145      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
1146        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
1147        <env key="RAILS_ENV" value="production" />
1148        <env key="GEM_HOME" value="${gem_home}" />
1149        <env key="GEM_PATH" value="" />
1150        <env key="BUNDLE_PATH" value="${gem_home}" />
1151        <arg line="../build/${jruby_build_bin_path}/warble war" />
1152      </java>
1153      <delete file="../public/.bundle/config" />
1154    </target>
1155  
1156    <!-- SETUP / SUPPORT TASKS -->
1157    <target name="set-classpath" description="Set JRuby classpath">
1158      <property name="jruby_classpath" value="${jruby_file}:gems/jruby/${jruby_build_version}:../lib/*:../common:../common/lib/*" />
1159    </target>
1160  
1161    <!-- Prepares all tests to be run -->
1162    <target name="setup-integration" depends="db:nuke:test, db:load:test, db:migrate:test, solr:reset:test" description="Prepare to run integration tests">
1163    </target>
1164  
1165    <target name="solr:reset" description="Delete all documents from Solr">
1166      <exec dir="${basedir}" executable="bash" newenvironment="false" failonerror="true">
1167        <arg line="../solr/delete.sh ${env.APPCONFIG_SOLR_URL}"/>
1168      </exec>
1169      <delete dir="${env.APPCONFIG_DATA_DIRECTORY}/indexer_state" />
1170      <delete dir="${env.APPCONFIG_DATA_DIRECTORY}/indexer_pui_state" />
1171    </target>
1172  
1173    <target name="solr:reset:test" description="Delete all documents from Solr">
1174      <exec dir="${basedir}" executable="bash" newenvironment="false" failonerror="true">
1175        <arg line="../solr/delete.sh ${env.ASPACE_TEST_SOLR_URL}"/>
1176      </exec>
1177      <delete dir="${env.ASPACE_TEST_DATA_DIRECTORY}/indexer_state" />
1178      <delete dir="${env.ASPACE_TEST_DATA_DIRECTORY}/indexer_pui_state" />
1179    </target>
1180  
1181      <!-- THOR -->
1182    <target name="thor" depends="set-classpath, bootstrap-jruby" description="Run project-level thor tasks">
1183      <property name="build.home" location="."/>
1184      <property name="task" value="list" />
1185      <property name="task_args" value="" />
1186      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../">
1187        <jvmarg line="${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
1188        <env key="GEM_HOME" value="${gem_home}" />
1189        <env key="GEM_PATH" value="" />
1190        <env key="BUNDLE_PATH" value="${gem_home}" />
1191        <env key="HOME" value="${build.home}" />
1192        <env key="ASPACE_INTEGRATION" value="true" />
1193        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
1194        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
1195        <arg line="./build/gems/bin/bundle exec thor ${task} ${task_args}" />
1196      </java>
1197    </target>
1198  
1199        <!-- RAKE -->
1200    <target name="rake" depends="set-classpath, bootstrap-jruby" description="Run project-level rake tasks">
1201      <property name="build.home" location="."/>
1202      <property name="task" value="--tasks" />
1203      <property name="task_args" value="" />
1204  
1205      <java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../">
1206        <jvmarg line="${default_java_options} ${env.JAVA_OPTS}"/>
1207        <env key="GEM_HOME" value="${gem_home}" />
1208        <env key="GEM_PATH" value="" />
1209        <env key="BUNDLE_PATH" value="${gem_home}" />
1210        <env key="HOME" value="${build.home}" />
1211        <env key="ASPACE_INTEGRATION" value="true" />
1212        <env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
1213        <env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
1214        <arg line="./build/${jruby_build_bin_path}/rake ${task} ${task_args}" />
1215      </java>
1216    </target>
1217  
1218  </project>