Skip to content

Commit

Permalink
Merge pull request #8 from mwillema/issue-8
Browse files Browse the repository at this point in the history
Generate a single signed NBM
  • Loading branch information
Marco Willemart authored Jan 5, 2017
2 parents d851bea + 40578ce commit 5421213
Show file tree
Hide file tree
Showing 48 changed files with 209 additions and 414 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*~
**/nbproject/private/
**/build/
**/src/**/protobuf/parser

# virtual machine crash logs
# see http://www.java.com/en/download/help/error_hotspot.xml
Expand Down
26 changes: 0 additions & 26 deletions antlr-runtime/LICENSE.txt

This file was deleted.

8 changes: 0 additions & 8 deletions antlr-runtime/build.xml

This file was deleted.

6 changes: 0 additions & 6 deletions antlr-runtime/manifest.mf

This file was deleted.

45 changes: 0 additions & 45 deletions antlr-runtime/nbproject/build-impl.xml

This file was deleted.

8 changes: 0 additions & 8 deletions antlr-runtime/nbproject/genfiles.properties

This file was deleted.

4 changes: 0 additions & 4 deletions antlr-runtime/nbproject/project.properties

This file was deleted.

24 changes: 0 additions & 24 deletions antlr-runtime/nbproject/project.xml

This file was deleted.

1 change: 0 additions & 1 deletion antlr-runtime/nbproject/suite.properties

This file was deleted.

2 changes: 0 additions & 2 deletions antlr-runtime/src/org/antlr/Bundle.properties

This file was deleted.

12 changes: 2 additions & 10 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
auxiliary.org-netbeans-modules-apisupport-installer.license-file=GPL-3.0
auxiliary.org-netbeans-modules-apisupport-installer.license-type=no
auxiliary.org-netbeans-modules-apisupport-installer.os-linux=false
auxiliary.org-netbeans-modules-apisupport-installer.os-macosx=false
auxiliary.org-netbeans-modules-apisupport-installer.os-solaris=false
auxiliary.org-netbeans-modules-apisupport-installer.os-windows=false
auxiliary.org-netbeans-modules-apisupport-installer.pack200-enabled=false
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
modules=\
${project.com.marcowillemart.netbeans.protobuf}:\
${project.org.antlr}:\
${project.com.marcowillemart.protobuf}:\
${project.org.slf4j}
${project.com.marcowillemart.netbeans.protobuf}
project.com.marcowillemart.netbeans.protobuf=protobuf-editor
keystore=nbproject/private/keystore
nbm_alias=myself
project.com.marcowillemart.protobuf=protobuf-parser
project.org.antlr=antlr-runtime
project.org.slf4j=slf4j
File renamed without changes.
11 changes: 11 additions & 0 deletions protobuf-editor/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@
<project name="com.marcowillemart.protobuf.editor" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project com.marcowillemart.protobuf.editor</description>
<import file="nbproject/build-impl.xml"/>
<import file="nbproject/build-antlr-impl.xml"/>

<target name="clean" depends="projectized-common.clean">
<delete dir="src/com/marcowillemart/protobuf/parser" failonerror="false"/>
</target>

<target name="build-init" depends="harness.build-init">
<antcall target="-antlr-init"/>
</target>

<target name="compile" depends="antlr,projectized-common.compile"/>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,16 @@ StrLit
| '"' CharValue* '"'
;

UnterminatedStrLit
: ('\'' | '"') CharValue*
;

fragment
CharValue
: HexEscape
| OctEscape
| CharEscape
| ~[\0\n\\]
| ~['"\0\n\\]
;
fragment
Expand Down Expand Up @@ -456,15 +460,27 @@ PLUS : '+';
ASSIGN : '=';
// Whitespace and comments
// Whitespaces
WS : [ \t]+ -> channel(HIDDEN)
;
WS : [ \t\r\n\f]+ -> skip
NEWLINE
: '\r'? '\n' -> channel(HIDDEN)
;
// Comments
BLOCK_COMMENT
: '/*' .*? '*/' -> channel(HIDDEN)
: '/*' .*? ('*/' | EOF) -> channel(HIDDEN)
;
LINE_COMMENT
: '//' ~[\r\n]* -> channel(HIDDEN)
;

// Illegal Characters

ANYCHAR
: . -> channel(HIDDEN)
;
Binary file added protobuf-editor/lib/antlr-4.5.3-complete.jar
Binary file not shown.
Binary file added protobuf-editor/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion protobuf-editor/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AutoUpdate-Show-In-Client: true
OpenIDE-Module: com.marcowillemart.protobuf.editor
OpenIDE-Module-Layer: com/marcowillemart/protobuf/editor/layer.xml
OpenIDE-Module-Localizing-Bundle: com/marcowillemart/protobuf/editor/Bundle.properties
OpenIDE-Module-Specification-Version: 1.0
OpenIDE-Module-Specification-Version: 1.0.0
94 changes: 94 additions & 0 deletions protobuf-editor/nbproject/build-antlr-impl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================
Extension of the NetBeans Java SE Ant build to ANTLR
====================================================
-->
<project name="build-antlr-impl">
<!--Target to call when just the ANTLR output is needed.-->
<target name="antlr"
depends="init,-do-antlr"
description="Translate the ANTLR grammar files into Java parser, lexer."/>

<!--Property definitions here will precede reading various properties
files, and therefore take precedence.
-->
<target name="-antlr-init">
<!--Cause tools (javac, javadoc) to include generated sources.
do.depend comes from file nbproject/private/private.properties .
Maybe it is owned by a property sheet somewhere in the IDE,
and we ought not to override it, but where?
-->
<property name="do.depend" value="true"/>
</target>

<!--Execute the ANTLR processing of the grammar directories. This results
in generated code in "${build.generated.sources.dir}/antlr-output".
Token files are written to that exact directory. Java files are
written to package folders below that root, according to the
location of the .g file below "${src.grammar.dir}". This location
comes from a properties set by the IDE. The arrangement of .g files
must correspond to the Java package statements they contain.
-->
<target name="-do-antlr">
<!-- We transform the relative grammar directory name to an absolute one -->
<property name="antlr.generator.src.dir.absolutepath"
location="${antlr.generator.src.dir}"/>

<!--Compose file list to pass to ANTLR.-->
<!--Method here to deal with paths that contain spaces. Credit to
stackoverflow.com question 2148390-->
<pathconvert property="antlr.temp.src.list.raw" pathsep="' '" >
<!-- Make a list of all the .g4 grammar files in the tree.-->
<fileset dir="${antlr.generator.src.dir.absolutepath}"
excludes="${antlr.excluded.grammars}">
<include name="**/*.g4" />
</fileset>
<!--Trim the names to specifications relative to the grammar base
directory.-->
<mapper type="glob"
from="${antlr.generator.src.dir.absolutepath}${file.separator}*.g4"
to= "*.g4" />
</pathconvert>
<!--Last bit of dealing with paths that contain spaces-->
<property name="antlr.temp.src.list" value="'${antlr.temp.src.list.raw}'"/>

<!-- -->
<echo>ANTLR will generate analyzer(s) for ${antlr.temp.src.list}</echo>
<echo>working relative to ${antlr.generator.src.dir}</echo>
<echo>and generate files in ${antlr.generator.dest.dir}</echo>
<!--
<echoproperties prefix="build" />
<echoproperties prefix="javac" />
-->
<echoproperties prefix="antlr" />

<!--Destination for generated Java files.-->
<mkdir dir="${antlr.generator.dest.dir}"/>
<!--Implementation using the ANTLR4 task does not accept multiple
source files. So use the java task. When grammar files are
identified by relative paths, the ANTLR Tool produces corresponding
package-structured output. In this call, ANTLR runs with the
grammar base directory as the current directory.
-->
<java classname="${antlr.generator.classname}"
fork="true"
dir="${antlr.generator.src.dir}"
failonerror="true">
<arg value="-package"/>
<arg value="${antlr.generated.package}"/>
<arg value="-o"/>
<arg path="${antlr.generator.dest.dir}"/>
<arg value="-lib"/>
<arg path="${antlr.generator.dest.dir}"/>
<arg line="${antlr.temp.src.list}"/>
<classpath>
<!--Here we need the complete ANTLR release that is the release
including the ANTLR code generation tool-->
<pathelement path="${antlr.generator.classpath}"/>
<pathelement path="${javac.classpath}"/>
</classpath>
<jvmarg value="-Xmx512M"/>
</java>
</target>
</project>
26 changes: 25 additions & 1 deletion protobuf-editor/nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml

file.reference.antlr-runtime-4.5.3.jar=release/modules/ext/antlr-runtime-4.5.3.jar
file.reference.slf4j-api-1.7.21.jar=release/modules/ext/slf4j-api-1.7.21.jar
file.reference.slf4j-jdk14-1.7.21.jar=release/modules/ext/slf4j-jdk14-1.7.21.jar

javac.source=1.7
javac.compilerargs=-Xlint -Xlint:-serial
license.file=../GPL-3.0

license.file=GPL-3.0

nbm.homepage=https://github.com/mwillema/protobuf-netbeans-plugin
nbm.module.author=Marco Willemart

# ANTLR 4 parameters
# src.grammar.dir is set in the IDE's project properties file as a result
# of naming the grammar sub-directory as a source.
antlr.generator.src.dir=grammar
# NetBeans module does not allow the compilation of sources outside src directory
antlr.generator.dest.dir=src/com/marcowillemart/protobuf/parser
antlr.generator.classname=org.antlr.v4.Tool
antlr.generator.options=
antlr.generator.classpath=lib/antlr-4.5.3-complete.jar
antlr.runtime.classpath=${file.reference.antlr-runtime-4.5.3.jar}
antlr.generated.package=com.marcowillemart.protobuf.parser

# Keystore parameters
keystore=nbproject/private/keystore
nbm_alias=mwillema
Loading

0 comments on commit 5421213

Please sign in to comment.