@@ -21,7 +21,8 @@ CDDL HEADER END
21
21
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
22
22
23
23
-->
24
- <project name =" OpenGrok" default =" jar" basedir =" ." xmlns : jacoco =" antlib:org.jacoco.ant" >
24
+ <project name =" OpenGrok" default =" jar" basedir =" ." xmlns : jacoco =" antlib:org.jacoco.ant"
25
+ xmlns : if =" ant:if" xmlns : unless =" ant:unless" >
25
26
<description >Builds, tests, and runs the project opengrok.</description >
26
27
<property name =" build.sysclasspath" value =" ignore" />
27
28
<property file =" ${ user.home } /config/ant/${ ant.project.name } .properties" />
@@ -186,6 +187,17 @@ Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
186
187
<attribute name =" name" />
187
188
<attribute name =" dir" />
188
189
<sequential > <!-- Name of input has to be .lex -->
190
+ <!-- newer *.lexh files cause .lex file to be touched -->
191
+ <local name =" lexh" />
192
+ <fileset dir =" ${ src.dir } /@{ dir } " includes =" *.lexh" id =" id.lexh" >
193
+ <depend targetdir =" ${ src.dir } /@{ dir } " >
194
+ <mapper type =" merge" to =" @{ name } .lex" />
195
+ </depend >
196
+ </fileset >
197
+ <pathconvert pathsep =" ," property =" lexh" refid =" id.lexh" />
198
+ <touch file =" ${ src.dir } /@{ dir } /@{ name } .lex"
199
+ unless : blank =" ${ lexh } " />
200
+ <!-- now run the jflex task -->
189
201
<jflex file =" ${ src.dir } /@{ dir } /@{ name } .lex" destdir =" ${ src.generatedsrc.dir } " nobak =" on" inputstreamctor =" false" />
190
202
</sequential >
191
203
</macrodef >
@@ -198,6 +210,17 @@ Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
198
210
<attribute name =" name" />
199
211
<attribute name =" dir" />
200
212
<sequential >
213
+ <!-- newer *.lexh files cause .lex file to be touched -->
214
+ <local name =" lexh" />
215
+ <fileset dir =" ${ src.dir } /@{ dir } " includes =" *.lexh" id =" id.lexh" >
216
+ <depend targetdir =" ${ src.dir } /@{ dir } " >
217
+ <mapper type =" merge" to =" @{ name } .lex" />
218
+ </depend >
219
+ </fileset >
220
+ <pathconvert pathsep =" ," property =" lexh" refid =" id.lexh" />
221
+ <touch file =" ${ src.dir } /@{ dir } /@{ name } .lex"
222
+ unless : blank =" ${ lexh } " />
223
+ <!-- now run the jflex task -->
201
224
<jflex file =" ${ src.dir } /@{ dir } /@{ name } .lex" destdir =" ${ src.generatedsrc.dir } " nobak =" on" inputstreamctor =" false" />
202
225
<!-- LUCENE-5897: Disallow scanner buffer expansion -->
203
226
<replaceregexp file =" ${ src.generatedsrc.dir } /@{ dir } /@{ name } .java"
0 commit comments