Skip to content

Commit

Permalink
see #16860 - Resolve JavaCC using Apache Ivy
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@16168 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
simon04 committed Mar 17, 2020
1 parent f22edcc commit 5b7e0cb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .settings/sf.eclipse.javacc.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JJ_NATURE=true
JTB_OPTIONS=-ia -jd -tk
KEEP_DEL_FILES_IN_HISTORY=false
MARK_GEN_FILES_AS_DERIVED=true
RUNTIME_JJJAR=${project_loc}/tools/javacc.jar
RUNTIME_JJJAR=${project_loc}/lib/tools/javacc-jar.jar
RUNTIME_JTBJAR=${eclipse_home}/plugins/sf.eclipse.javacc_1.5.27/jtb-1.4.7.jar
RUNTIME_JVMOPTIONS=
SUPPRESS_WARNINGS=false
Expand Down
2 changes: 0 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ This is an overview of the files and directories in the JOSM code repository:
- ivy/ Apache Ivy binary, configuration file, and downloaded dependencies
- jacocoant.jar used to include coverage data into JUnit test reports
- japicc/ used to generate a compatibility report between optimized jar and normal one
- javacc.jar used in the build process to generate some .java files from a javacc source file
(src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj)
- proguard.jar optimize final binary jar - see build.xml (not used in production so far)
- spotbugs/ libs and config files for spotbugs (automatically detects common bugs and potential
problems in source code); can be launched as an ant target in build.xml
Expand Down
11 changes: 7 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<dirname property="base.dir" file="${ant.file.josm}"/>
<property name="lib.dir" location="${base.dir}/lib"/>
<property name="tools.dir" location="${base.dir}/tools"/>
<property name="tools.ivy" location="${tools.dir}/ivy.xml"/>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${tools.dir}/ivy/ivy.jar"/>
</target>
<target name="init-properties" depends="resolve">
Expand Down Expand Up @@ -275,9 +276,10 @@ Build-Date: ${build.tstamp}
</exec>
</target>
<target name="javacc" depends="init" unless="javacc.notRequired">
<ivy:cachepath file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
<mkdir dir="${mapcss.dir}/parsergen"/>
<java classname="javacc" fork="true" failonerror="true">
<classpath path="${javacc.home}/javacc.jar"/>
<classpath refid="javacc.classpath"/>
<arg value="-DEBUG_PARSER=false"/>
<arg value="-DEBUG_TOKEN_MANAGER=false"/>
<arg value="-JDK_VERSION=${java.lang.version}"/>
Expand Down Expand Up @@ -365,7 +367,7 @@ Build-Date: ${build.tstamp}
<compilerarg value="-Xlint:unchecked"/>
<!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
<compilerarg value="-XDignore.symbol.file"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:ReferenceEquality:OFF -Xep:ImmutableEnumChecker:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:FloatingPointLiteralPrecision:OFF -Xep:ShortCircuitBoolean:OFF -Xep:StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:UnnecessaryParentheses:OFF -Xep:EqualsGetClass:OFF -Xep:ThreadPriorityCheck:OFF -Xep:UndefinedEquals:OFF -Xep:MixedMutabilityReturnType:OFF -Xep:OverrideThrowableToString:OFF -Xep:JavaTimeDefaultTimeZone:OFF -Xep:UnusedVariable:OFF -Xep:EqualsUsingHashCode:OFF -Xep:BadImport:OFF -Xep:UnnecessaryLambda:OFF -Xep:AnnotateFormatMethod:OFF -Xep:MutablePublicArray:OFF"/>
<compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:ImmutableEnumChecker:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:FloatingPointLiteralPrecision:OFF -Xep:ShortCircuitBoolean:OFF -Xep:StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:UnnecessaryParentheses:OFF -Xep:EqualsGetClass:OFF -Xep:ThreadPriorityCheck:OFF -Xep:UndefinedEquals:OFF -Xep:MixedMutabilityReturnType:OFF -Xep:OverrideThrowableToString:OFF -Xep:JavaTimeDefaultTimeZone:OFF -Xep:UnusedVariable:OFF -Xep:EqualsUsingHashCode:OFF -Xep:BadImport:OFF -Xep:UnnecessaryLambda:OFF -Xep:AnnotateFormatMethod:OFF -Xep:MutablePublicArray:OFF"/>
<compilerarg line="-Xmaxwarns 1000"/>
<classpath>
<path refid="runtime.path"/>
Expand Down Expand Up @@ -947,7 +949,7 @@ Build-Date: ${build.tstamp}
</target>

<target name="spotbugs" depends="dist">
<ivy:cachepath file="${tools.dir}/ivy.xml" pathid="spotbugs.classpath" conf="spotbugs"/>
<ivy:cachepath file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
<taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${toString:spotbugs.classpath}"/>
<spotbugs output="xml"
outputFile="spotbugs-josm.xml"
Expand All @@ -963,7 +965,7 @@ Build-Date: ${build.tstamp}
</target>

<target name="pmd" depends="init-properties">
<ivy:cachepath file="${tools.dir}/ivy.xml" pathid="pmd.classpath" conf="pmd"/>
<ivy:cachepath file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
<pmd shortFilenames="true" cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
<sourceLanguage name="java" version="${java.lang.version}" />
Expand Down Expand Up @@ -1174,5 +1176,6 @@ Build-Date: ${build.tstamp}
<ivy:retrieve pattern="${lib.dir}/compile/[artifact]-[type].[ext]" conf="compile"/>
<ivy:retrieve pattern="${lib.dir}/runtime/[artifact]-[type].[ext]" conf="runtime"/>
<ivy:retrieve pattern="${lib.dir}/sources/[artifact]-[type].[ext]" conf="sources"/>
<ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc" file="${tools.ivy}"/>
</target>
</project>
3 changes: 3 additions & 0 deletions tools/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<ivy-module version="2.0" xmlns:maven="http://ant.apache.org/ivy/maven">
<info organisation="org.openstreetmap" module="josm"/>
<configurations>
<conf name="javacc" description="Everything needed for running JavaCC"/>
<conf name="pmd" description="Everything needed for running PMD"/>
<conf name="spotbugs" description="Everything needed for running SpotBugs"/>
</configurations>
<dependencies>
<!-- javacc->default -->
<dependency org="net.java.dev.javacc" name="javacc" rev="7.0.3" conf="javacc->default"/>
<!-- pmd->default -->
<dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.20.0" conf="pmd->default"/>
<dependency org="net.sourceforge.pmd" name="pmd-java" rev="6.20.0" conf="pmd->default"/>
Expand Down
Binary file removed tools/javacc.jar
Binary file not shown.

0 comments on commit 5b7e0cb

Please sign in to comment.