Skip to content

Commit

Permalink
Update Maven things
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Aug 21, 2020
1 parent 363195d commit 0d17f2d
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 32 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root=true

[*]
tab_width = 4

[*.g4]
end_of_line = lf
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
93 changes: 93 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Recipe from: https://help.github.com/articles/dealing-with-line-endings/#platform-all

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.abnf text
*.agc text
*.asn text
*.b text
*.bas text
*.bnf text
*.c text
*.cl text
*.cpp text
*.cs text
*.css text
*.csv text
*.dgs text
*.dot text
*.erl text
*.errors text
*.faa text
*.ffn text
*.fna text
*.g text
*.g4 text
*.g42 text
*.gff text
*.gml text
*.go text
*.gradle text
*.h text
*.html text
*.ics text
*.idl text
*.iri text
*.java text
*.js text
*.json text
*.kt text
*.lua text
*.m text
*.map text
*.md text
*.mo text
*.mps text
*.ora text
*.pas text
*.pc text
*.pgn text
*.php text
*.pkb text
*.pks text
*.properties text
*.proto text
*.py text
*.rb text
*.s text
*.sh text
*.smt2 text
*.sno text
*.sql text
*.st text
*.style text
*.swift text
*.tree text
*.ttl text
*.txt text
*.upnp text
*.vb text
*.vhd text
*.x text
*.xml text
*.yml text
access_log text

# Declare files that will always have LF line endings on checkout.
# Unicode input files end with *.txt, but should not be converted on Windows
/unicode/graphemes/examples/*.txt eol=lf

# Declare files that will always have CRLF line endings on checkout.
# Currently the /vb6/**/*.cls and *.frm file need this, otherwise the grammar fails.
*.cls text eol=crlf
*.frm text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.pdf binary
*.png binary


**/examples/* linguist-vendored
14 changes: 14 additions & 0 deletions assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>grammars</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<includes>
<include>**/*.g4</include>
</includes>
</fileSet>
</fileSets>
</assembly>
157 changes: 127 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.antlr.grammarsv4</groupId>
<groupId>org.antlr.grammars</groupId>
<artifactId>grammarsv4</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>ANTLR4 grammars</name>
<profiles>
<profile>
<id>test</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>_grammar-test</module>
</modules>
</profile>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>grammarv4</id>
<modules>
<module>yarspg</module>
<!-- testing repository -->
<!--<module>grammar-test</module>-->
</modules>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<target.jvm>1.6</target.jvm>
<antlr.version>4.7.1</antlr.version>
<antlr4test-maven-plugin.version>1.10</antlr4test-maven-plugin.version>
<target.jvm>1.7</target.jvm>
<antlr.version>4.8-1</antlr.version>
<antlr4test-maven-plugin.version>1.14</antlr4test-maven-plugin.version>
<junit.version>4.12</junit.version>
</properties>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<scm>
<connection>https://github.com/lszeremeta/yarspg.git</connection>
<tag>HEAD</tag>
</scm>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
Expand All @@ -45,20 +31,131 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>${junit.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<version>3.8.0</version>
<configuration>
<source>${target.jvm}</source>
<target>${target.jvm}</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>grammarv4</id>
<modules>
<module>yarspg</module>
<!-- testing repository -->
<!--<module>grammar-test</module> -->
</modules>
</profile>
<profile>
<id>deploy</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>${maven.multiModuleProjectDirectory}/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1 </version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>test</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>_grammar-test</module>
</modules>
</profile>
</profiles>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
2 changes: 2 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
command -v mvn >/dev/null 2>&1 || { echo >&2 "I require maven to test the grammars but it's not installed. Aborting."; exit 1; }
mvn test $@
4 changes: 2 additions & 2 deletions yarspg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<packaging>jar</packaging>
<name>ANTLR YARSpg grammar</name>
<parent>
<groupId>com.antlr.grammarsv4</groupId>
<groupId>org.antlr.grammars</groupId>
<artifactId>grammarsv4</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
Expand All @@ -17,10 +17,10 @@
<artifactId>antlr4-maven-plugin</artifactId>
<version>${antlr.version}</version>
<configuration>
<sourceDirectory>${basedir}</sourceDirectory>
<grammars>YARSpg.g4</grammars>
<visitor>true</visitor>
<listener>true</listener>
<sourceDirectory>${basedir}</sourceDirectory>
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit 0d17f2d

Please sign in to comment.