-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
143 lines (118 loc) · 4.96 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0" encoding="UTF-8"?>
<project default="clean" basedir="." name="lucene-extension">
<description>
Build Lucene Extension
</description>
<!-- set global properties for this build -->
<property file="build.properties"/>
<property name="lib" location="source/java/libs"/>
<property name="src" location="source/java/src"/>
<property name="srcImg" location="source/images"/>
<property name="temp" location="temp"/>
<property name="build" location="build"/>
<property name="dist" location="target"/>
<path id="classpath">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<delete dir="${temp}"/>
<delete dir="${dist}"/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${temp}"/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}/"/>
</target>
<target name="maven-build">
<exec dir="source/java" executable="mvn" failonerror="true">
<arg line="clean ${maven.goal} -Drevision=${bundleversion}"/>
</exec>
<!-- Now copy dependencies -->
<exec dir="source/java" executable="mvn" failonerror="true">
<arg value="-DoutputDirectory=${temp}/dependency"/>
<arg value="-Dmdep.copyPom=true"/>
<arg value="-Dmdep.useRepositoryLayout=true"/>
<arg value="-DexcludeScope=provided"/>
<arg value="-Drevision=${bundleversion}"/>
<arg value="dependency:copy-dependencies"/>
</exec>
<!--
mvn clean -Dmdep.copyPom=true -Drevision=3.0.0.0-ALPHA -Dmdep.useRepositoryLayout=true -DexcludeScope=provided -DoutputDirectory=/Users/mic/tmp9/xxx dependency:copy-dependencies
-->
</target>
<target name="copy-dependencies" depends="maven-build">
<!-- Create maven directory in extension folder -->
<mkdir dir="${dist}/extension/maven"/>
<!-- Copy the Maven-built JAR -->
<copy todir="${dist}/extension/maven">
<fileset dir="source/java/target">
<include name="*.jar"/>
<include name="*.pom"/>
<exclude name="*-sources.jar"/>
<exclude name="*-javadoc.jar"/>
</fileset>
</copy>
<!-- Ensure the target directory exists -->
<mkdir dir="${dist}/extension/maven/org/lucee/lucene-search/${bundleversion}/" />
<!-- Move the files -->
<move file="${dist}/extension/maven/lucene-search-${bundleversion}.jar"
tofile="${dist}/extension/maven/org/lucee/lucene-search/${bundleversion}/lucene-search-${bundleversion}.jar" />
<move file="${dist}/extension/maven/lucene-search-${bundleversion}.pom"
tofile="${dist}/extension/maven/org/lucee/lucene-search/${bundleversion}/lucene-search-${bundleversion}.pom" />
<!-- Copy all dependencies -->
<copy todir="${dist}/extension/maven">
<fileset dir="${temp}/dependency">
<include name="**/*.jar"/>
<include name="**/*.pom"/>
</fileset>
</copy>
</target>
<target name="createManifest" depends="copy-dependencies" description="create MANIFEST.MF file" >
<tstamp>
<format property="NOW" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<echo file="${dist}/extension/META-INF/MANIFEST.MF">Manifest-Version: 1.0
Built-Date: ${NOW}
version: "${bundleversion}"
id: "${id}"
name: "${label}"
description: "${description}"
lucee-core-version: "${luceeCoreVersion}"
release-type: ${releaseType}
start-bundles: false
search: "[{'class':'${class}','maven':'${mvnGroupId}:${mvnArtifactId}:${bundleversion}'}]"
</echo>
</target>
<!-- Updated dist target to depend on maven-build -->
<target name="dist" depends="createManifest"
description="generate the distribution" >
<!-- Put everything in ${build} into .jar file
<jar jarfile="${dist}/extension/jars/lucene-search-${bundleversion}.jar"
basedir="${build}"
manifest="${src}/META-INF/MANIFEST.MF">
<manifest>
<attribute name="Bundle-Version" value="${bundleversion}"/>
<attribute name="Built-Date" value="${NOW}"/>
<attribute name="Bundle-SymbolicName" value="${bundlename}"/>
</manifest>
</jar> -->
<!-- copy the logo -->
<copy todir="${dist}/extension/META-INF">
<fileset dir="${srcImg}/">
<include name="logo.png"/>
</fileset>
</copy>
<!-- Zip everything -->
<zip destfile="${dist}/${filename}-${bundleversion}.lex">
<zipfileset dir="${dist}/extension"/>
</zip>
</target>
<target name="clean" depends="dist" description="clean up" >
<!-- Delete the ${build} and ${temp} directory trees
<delete dir="${build}"/>
<delete dir="${temp}"/> -->
</target>
</project>