Skip to content

Commit 9801824

Browse files
authored
Merge pull request #1850 from idodeclare/fix/lexh_mtimes
Re-jflex if *.lexh is newer than the .lex
2 parents 4083423 + 486d2ff commit 9801824

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

build.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ CDDL HEADER END
2121
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
2222
2323
-->
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">
2526
<description>Builds, tests, and runs the project opengrok.</description>
2627
<property name="build.sysclasspath" value="ignore"/>
2728
<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.
186187
<attribute name="name"/>
187188
<attribute name="dir"/>
188189
<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 -->
189201
<jflex file="${src.dir}/@{dir}/@{name}.lex" destdir="${src.generatedsrc.dir}" nobak="on" inputstreamctor="false"/>
190202
</sequential>
191203
</macrodef>
@@ -198,6 +210,17 @@ Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
198210
<attribute name="name"/>
199211
<attribute name="dir"/>
200212
<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 -->
201224
<jflex file="${src.dir}/@{dir}/@{name}.lex" destdir="${src.generatedsrc.dir}" nobak="on" inputstreamctor="false"/>
202225
<!-- LUCENE-5897: Disallow scanner buffer expansion -->
203226
<replaceregexp file="${src.generatedsrc.dir}/@{dir}/@{name}.java"

src/org/opensolaris/opengrok/analysis/perl/PerlSymbolTokenizer.lex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ this.finalOffset = zzEndRead;
134134
return false;
135135
%eofval}
136136

137-
%include PerlProductions.txt
137+
%include PerlProductions.lexh

src/org/opensolaris/opengrok/analysis/perl/PerlXref.lex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ import org.opensolaris.opengrok.web.Util;
130130
protected String getUrlPrefix() { return urlPrefix; }
131131
%}
132132

133-
%include PerlProductions.txt
133+
%include PerlProductions.lexh

0 commit comments

Comments
 (0)