lkishalmi commented on code in PR #4549: URL: https://github.com/apache/netbeans/pull/4549#discussion_r957784341
########## java/languages.antlr/build.xml: ########## @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<!-- You may freely edit this file. See harness/README in the NetBeans platform --> +<!-- for some information on what you could do (e.g. targets to override). --> +<!-- If you delete this file and reopen the project it will be recreated. --> +<project name="java/languages.antlr" default="build" basedir="."> + <description>Builds, tests, and runs the project org.netbeans.modules.languages.antlr</description> + <import file="../../nbbuild/templates/projectized.xml"/> + + <target name="antlr-generate" depends="init"> + <path id="antlr4.tool"> + <fileset dir="../../ide/libs.antlr4.runtime/external" includes="*.jar"/> + </path> + <property name="antlr.outdir" location="${build.dir}/parser-src/org/antlr/parser/antlr4"/> + <mkdir dir="${antlr.outdir}"/> + <copy todir="${antlr.outdir}"> + <fileset dir="external" includes="*.g4"/> + <fileset dir="external" includes="*.java"/> + </copy> + <replace file="${antlr.outdir}/LexerAdaptor.java" token="//package" value="package"/> + <java classname="org.antlr.v4.Tool" classpathref="antlr4.tool"> + <arg value="-o"/><arg value="${antlr.outdir}"/> + <arg value="-package"/><arg value="org.antlr.parser.antlr4"/> + <arg value="${antlr.outdir}/ANTLRv4Lexer.g4"/> + <!--arg value="${antlr.outdir}/ANTLRv4Parser.g4"/--> + </java> + </target> + + <target name="antlr-compile" depends="antlr-generate" extensionOf="-pre-compile"> + <property name="javac.fork" value="false"/> + <mkdir dir="${build.dir}/parser-classes"/> + <nb-javac srcdir="${build.dir}/parser-src" destdir="${build.dir}/parser-classes" debug="${build.compiler.debug}" debuglevel="${build.compiler.debuglevel}" encoding="UTF-8" + deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="${javac.source}" target="${javac.target}" includeantruntime="false" + fork="${javac.fork}" + > + <classpath refid="cp"/> + <compilerarg line="${javac.compilerargs}"/> + <processorpath refid="processor.cp"/> + </nb-javac> + <mkdir dir="${build.dir}/parser"/> + <jar jarfile="${build.dir}/parser/antlr4-parser.jar"> + <fileset dir="${build.dir}/parser-classes"/> + </jar> + </target> Review Comment: Well, that was the "easiest" way (I knew) to integrate with externals. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
