Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preset": "conventionalcommits"
},
["@semantic-release/exec", {
"prepareCmd": "ant -Dapp.version=${nextRelease.version}"
"prepareCmd": "ant -Dapp.version=${nextRelease.version} -Drelease=true"
}],
["@semantic-release/git", {
"assets": ["expath-pkg.xml", "repo.xml"],
Expand Down
121 changes: 70 additions & 51 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="xar" name="pocom">
<xmlproperty file="build.properties.xml" keepRoot="false" semanticAttributes="true"/>
<property name="build.dir" value="build"/>
<property name="git.repo.path" value="${basedir}/.git"/>
<available file="${git.repo.path}" property="git.present" type="dir"/>
<project default="xar" name="pocom" basedir=".">
<xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false" />
<property name="build.dir" value="build" />
<property name="git.repo.path" value="${basedir}/.git" />
<available file="${git.repo.path}" type="dir" property="git.present" />

<target name="clean">
<echo message="Deleting xar files..."/>
<delete dir="${build.dir}" failonerror="false"/>
<delete failonerror="false" file="${basedir}/expath-pkg.xml"/>
<delete failonerror="false" file="${basedir}/repo.xml"/>
<condition property="is-release">
<equals arg1="${release}" arg2="true" />
</condition>

<target name="release.true" if="is-release">
<echo>Calculating git revision info for release</echo>
</target>

<target name="release.false" unless="is-release">
<echo>Not a release, moving on ...</echo>
</target>

<target depends="clean,git.revision" description="create xar file" name="xar">
<echo message="Creating build folder..."/>
<mkdir dir="${build.dir}"/>
<target name="check-release" depends="release.true, release.false">
</target>

<echo message="Apply values to expath-pkg.xml..."/>
<copy overwrite="true" todir="${basedir}" verbose="true">
<fileset file="*.xml.tmpl"/>
<target name="clean">
<echo message="Deleting xar files..." />
<delete dir="${build.dir}" failonerror="false" />
</target>

<target name="templates" description="process template files" if="is-release"
depends="git.revision">
<echo message="Apply values to .tmpl ..." />
<copy todir="${basedir}" overwrite="true" verbose="true">
<fileset file="*.xml.tmpl" />
<filterchain>
<replacetokens>
<token key="name" value="${app.name}"/>
<token key="version" value="${app.version}"/>
<token key="url" value="${app.url}"/>
<token key="title" value="${app.title}"/>
<token key="commit-id" value="${git.revision}"/>
<token key="commit-time" value="${git.time}"/>
<token key="name" value="${app.name}" />
<token key="version" value="${app.version}" />
<token key="url" value="${app.url}" />
<token key="title" value="${app.title}" />
<token key="commit-id" value="${git.revision}" />
<token key="commit-time" value="${git.time}" />
</replacetokens>
<tokenfilter>
<!-- until we move template processing to XSLT, take care with reserved characters -->
<replacestring from="&amp;" to="&amp;amp;"/>
<!-- until we move template processing to XSLT, take care with reserved
characters -->
<replacestring from="&amp;" to="&amp;amp;" />
</tokenfilter>
</filterchain>
<globmapper from="*.tmpl" to="*"/>
<globmapper from="*.tmpl" to="*" />
</copy>
</target>

<echo message="------------------------------------------------------------"/>
<echo message="Creating xar file..."/>
<echo message="------------------------------------------------------------"/>
<target name="xar" depends="clean,check-release,git.revision,templates"
description="create xar file">
<echo message="Creating build folder..." />
<mkdir dir="${build.dir}" />

<echo message="------------------------------------------------------------" />
<echo message="Creating xar file..." />
<echo message="------------------------------------------------------------" />

<zip basedir="${basedir}" destfile="${build.dir}/${app.name}.xar">
<exclude name="${build.dir}/**"/>
<exclude name="*.tmpl"/>
<exclude name=".github/**"/>
<exclude name="test/**"/>
<exclude name="node_modules/**"/>
<exclude name="${build.dir}/**" />
<exclude name="*.tmpl" />
<exclude name=".github/**" />
<exclude name="test/**" />
<exclude name="node_modules/**" />
</zip>
<echo>Version: ${app.version}</echo>
</target>

<target description="Store git revision in ${repository.version}" if="git.present"
name="git.revision">
<exec errorproperty="" executable="git" failifexecutionfails="false"
outputproperty="git.revision">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="rev-parse"/>
<arg value="HEAD"/>
<target name="git.revision" description="Store git revision in ${repository.version}"
if="is-release" depends="check-release">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false"
errorproperty="">
<arg value="--git-dir=${git.repo.path}" />
<arg value="rev-parse" />
<arg value="HEAD" />
</exec>
<condition else="unknown" property="repository.version" value="${git.revision}">
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length length="0" string="${git.revision}" trim="yes" when="greater"/>
<isset property="git.revision" />
<length string="${git.revision}" trim="yes" length="0" when="greater" />
</and>
</condition>
<echo>Git repo: ${repository.version}</echo>

<exec errorproperty="" executable="git" failifexecutionfails="false"
outputproperty="git.time">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%ct"/>
<arg value="${git.revision}"/>
<exec executable="git" outputproperty="git.time" failifexecutionfails="false"
errorproperty="">
<arg value="--git-dir=${git.repo.path}" />
<arg value="show" />
<arg value="-s" />
<arg value="--format=%ct" />
<arg value="${git.revision}" />
</exec>
<echo>Git time: ${git.time}</echo>

</target>
</project>
</project>
5 changes: 4 additions & 1 deletion collection.xconf
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Lucene index configuration -->
<lucene>
<lucene vector-store="db">
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
<text index="no" qname="persName">
<!-- start required facets and fields -->
<facet dimension="hsg-category" expression="'department'"/>
<facet dimension="hsg-publication" expression="'pocom'"/>
<field name="hsg-fulltext"/>
<vector-field name="hsg-embedding"
dimension="384" similarity="cosine"
embedding="local" model="all-MiniLM-L6-v2"/>
<field expression="'/departmenthistory/people/' || parent::person/id" name="hsg-url"/>
<!-- end required facets and fields -->
</text>
Expand Down
Loading