Skip to content

Commit 40f5984

Browse files
author
Dennis Ried
committed
update package build (get rid of old stuff)
1 parent 12a2269 commit 40f5984

File tree

3 files changed

+16
-48
lines changed

3 files changed

+16
-48
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build/
33

44
*.DS_Store
55
.existdb.json
6+
dist/*

build.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Don't directly modify this file.
3+
# Instead, copy it to local.build.properties and edit that.
4+
#
5+
project.app=EditionExample
6+
build.dir=build
7+
dist.dir=dist

build.xml

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project default="deploy" name="EditionExample" basedir=".">
3-
<xmlproperty file="expath-pkg.xml"/>
2+
<project default="xar" name="EditionExample" basedir=".">
43

5-
<!-- where to find eXist-dist for auto deploy -->
6-
<property name="exist5.libs" value="/Users/opt/exist-distribution-5.3.1/lib"/>
7-
<property name="exist.db" value="xmldb:exist://localhost:8080/exist/xmlrpc/db"/>
8-
<property name="exist.user" value="admin"/>
9-
<property name="exist.pass" value=""/>
4+
<!-- import default properties -->
5+
<property file="build.properties"/>
6+
<xmlproperty file="expath-pkg.xml"/>
107

11-
<property name="project.app" value="EditionExample"/>
128
<property name="project.version" value="${package(version)}"/>
139
<property name="project.name" value="${package(name)}"/>
14-
<property name="build.dir" value="build"/>
1510

1611
<target name="xar">
1712
<mkdir dir="${build.dir}"/>
18-
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="${build.dir}/"/>
13+
<mkdir dir="${dist.dir}"/>
14+
<zip basedir="." destfile="${dist.dir}/${project.app}-${project.version}.xar" excludes="${build.dir}/ ${dist.dir}/"/>
15+
<antcall target="clean"/>
1916
</target>
2017

2118
<target name="clean">
22-
<delete dir="build/"/>
23-
</target>
24-
25-
<target name="deploy" depends="clean, xar">
26-
<path id="classpath.eXist5">
27-
<fileset dir="${exist5.libs}" erroronmissingdir="no">
28-
<include name="*.jar"/>
29-
</fileset>
30-
</path>
31-
<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
32-
<classpath refid="classpath.eXist5"/>
33-
</typedef>
34-
35-
<!-- store xar-file in eXist-db -->
36-
<xdb:store xmlns:xdb="http://exist-db.org/ant"
37-
uri="${exist.db}/tmp"
38-
createcollection="true"
39-
createsubcollections="true"
40-
user="${exist.user}"
41-
password="${exist.pass}"
42-
failonerror="true">
43-
<fileset file="${build.dir}/${project.app}-${project.version}.xar"/>
44-
</xdb:store>
45-
46-
<!-- Deploy the xar -->
47-
<xdb:xquery xmlns:xdb="http://exist-db.org/ant"
48-
uri="${exist.db}"
49-
user="${exist.user}"
50-
password="${exist.pass}">
51-
(
52-
if("${project.name}" = repo:list()) then (
53-
repo:undeploy("${project.name}"),
54-
repo:remove("${project.name}")
55-
)
56-
else (),
57-
repo:install-and-deploy-from-db("/db/tmp/${project.app}-${project.version}.xar")
58-
)
59-
</xdb:xquery>
19+
<delete dir="${build.dir}"/>
6020
</target>
6121
</project>

0 commit comments

Comments
 (0)