forked from eldersantos/community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
100 lines (92 loc) · 4.72 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<project name="NeoCommunity" basedir="." default="build">
<property name="buildNumber" value="1.5.DEVELOPER"/>
<property environment="env" />
<target name="build" description="Build the Neo4j community edition" depends="clean,compile,createPackage"/>
<target name="clean" description="Cleans all of the community components">
<exec executable="mvn" dir="." failonerror="true">
<arg value="clean"/>
</exec>
<delete>
<fileset dir="." includes="**/pom-with-build-number.xml"/>
</delete>
<delete dir="artifacts"/>
<mkdir dir="artifacts"/>
<!-- Controversial! This is to ensure that there aren't any cached nasties -->
<!-- Currently commented-out so that we play nicely with other builds in TeamCity -->
<!-- <delete>
<fileset dir="${user.home}/.m2/repository/org/neo4j" includes="**/*"/>
</delete> -->
</target>
<target name="compile" description="Compiles all of the individual community components" depends="generateKernelVersion">
<compileProject projectName="kernel" pom="pom.xml"/>
<compileProject projectName="jmx" pom="pom.xml"/>
<compileProject projectName="udc" pom="pom.xml"/>
<compileProject projectName="lucene-index" pom="pom.xml"/>
<compileProject projectName="graph-algo" pom="pom.xml"/>
<compileProject projectName="graph-matching" pom="pom.xml"/>
<compileProject projectName="cypher" pom="pom.xml"/>
<compileProject projectName="neo4j" pom="pom.xml"/>
<compileProject projectName="neo4j-community" pom="pom.xml"/>
<compileProject projectName="shell" pom="pom.xml"/>
<compileProject projectName="embedded-examples" pom="pom.xml"/>
<compileProject projectName="server-api" pom="pom.xml"/>
<compileProject projectName="server" pom="pom.xml"/>
<compileProject projectName="server-examples" pom="pom.xml"/>
</target>
<target name="generateKernelVersion" description="Generate versioned code">
<mkdir dir="kernel/target/generated-sources/version/org/neo4j/kernel/impl" />
<exec executable="git" failifexecutionfails="false" failonerror="false">
<arg value="fetch" />
<arg value="--tags" />
</exec>
<exec executable="git" outputproperty="git.describe" errorproperty="git.describe.error" failifexecutionfails="false" failonerror="false" dir="kernel">
<arg value="describe" />
<arg value="--dirty" />
</exec>
<property name="git.describe" value="${gitDescribe}" />
<copy file="kernel/ComponentVersion.tmpl" tofile="kernel/target/generated-sources/version/org/neo4j/kernel/impl/ComponentVersion.java"/>
<replace file="kernel/target/generated-sources/version/org/neo4j/kernel/impl/ComponentVersion.java"
token="@BUILDNUMBER@" value="${buildNumber}"/>
<replace file="kernel/target/generated-sources/version/org/neo4j/kernel/impl/ComponentVersion.java"
token="@GITDESCRIBE@" value="${git.describe}"/>
<!-- This is to pass the build number on to downstream builds -->
<echo message="buildNumber=${buildNumber}" file="artifacts/reports/buildNumber.properties"/>
</target>
<target name="createPackage" description="Creates package for linux">
<copy file="packaging/pom.xml" tofile="packaging/pom-with-build-number.xml" overwrite="true"/>
<replace file="packaging/pom-with-build-number.xml" token="1.5-SNAPSHOT" value="${buildNumber}"/>
<replace file="packaging/pom-with-build-number.xml" token="@MANUALVERSION@" value="1.5-SNAPSHOT"/>
<replace file="packaging/pom-with-build-number.xml" token="@3RDPARTYVERSION@" value="1.5-SNAPSHOT"/>
<replace file="packaging/pom-with-build-number.xml" token="@GREMLINVERSION@" value="1.5-SNAPSHOT"/>
<replace file="packaging/pom-with-build-number.xml" token="@CYPHERPLUGINVERSION@" value="1.5-SNAPSHOT"/>
<exec executable="mvn" dir="packaging" failonerror="true">
<arg value="clean"/>
<arg value="package"/>
<arg value="-f"/>
<arg value="pom-with-build-number.xml"/>
</exec>
<copy todir="artifacts/packages">
<fileset dir="packaging/target">
<include name="*.zip"/>
<include name="*.tar.gz"/>
</fileset>
</copy>
</target>
<macrodef name="compileProject" description="Maven installs a single project">
<attribute name="projectName"/>
<attribute name="pom"/>
<sequential>
<echo message="Compiling @{projectName}"/>
<!-- Substitute version number into a new pom -->
<copy file="@{projectName}/@{pom}" tofile="@{projectName}/pom-with-build-number.xml" overwrite="true"/>
<replace file="@{projectName}/pom-with-build-number.xml" token="1.5-SNAPSHOT" value="${buildNumber}"/>
<!-- Maven's ant task doesn't compile. Have to use exec -->
<exec executable="mvn" dir="@{projectName}" failonerror="true">
<arg value="install"/>
<arg value="-f"/>
<arg value="pom-with-build-number.xml"/>
<arg value="-Dtests=functional"/>
</exec>
</sequential>
</macrodef>
</project>