Update antlr dependency from 4.5.3 to 4.7.1 switch to gradle in idl2k

This is a squashed and rebased commit of https://github.com/JetBrains/kotlin/pull/1945

- add idl2k to default gradle build lifecycle
- removemaven build completely
- invert maven's `idl2k.deploy.skip` to `idl2k.deply` in gradle
(false by default)
- antlr upgrade from 4.5.3 to 4.7.1 - I'd have to slightly modify WebIDL.g4 definition though -
and updated copyright accordingly - my updates were based on
https://raw.githubusercontent.com/antlr/grammars-v4/master/webidl/WebIDL.g4
- I've checked all generated output to make sure it is identical to
what we hade before dependency update.
- Package idl2k according to our souce code guidelines
This commit is contained in:
Shagen Ogandzhanian
2018-10-31 16:14:19 +01:00
parent c3237f416f
commit d78115757f
8 changed files with 49 additions and 133 deletions
-2
View File
@@ -79,8 +79,6 @@
<module>tools/maven-archetypes</module>
<module>tools/idl2k</module>
<module>tools/kotlin-annotation-processing-maven</module>
<module>tools/kotlin-maven-allopen</module>
<module>tools/kotlin-maven-noarg</module>
+43
View File
@@ -0,0 +1,43 @@
buildscript {
ext.antlr4_version = '4.7.1'
}
apply plugin: "antlr"
apply plugin: "kotlin"
if (project.findProperty("idl2k.deploy")?.toBoolean()) {
configurePublishing(project)
}
repositories {
mavenCentral()
}
project.sourceSets.main.antlr.srcDirs = ["src/main/antlr4"]
dependencies {
antlr "org.antlr:antlr4:$antlr4_version"
implementation "org.antlr:antlr4-runtime:$antlr4_version"
implementation project(':kotlin-stdlib')
implementation "org.jsoup:jsoup:1.8.2"
}
sourceSets.main.kotlin.srcDirs += file("$buildDir/generated-src/antlr/main/")
generateGrammarSource {
arguments += ["-visitor", "-long-messages", "-package", "org.antlr.webidl"]
}
compileKotlin.dependsOn generateGrammarSource
compileTestKotlin.dependsOn generateTestGrammarSource
task downloadAllIdls(type: JavaExec) {
main = "org.jetbrains.idl2k.dl.DownloadKt"
classpath = sourceSets.main.runtimeClasspath
}
task idl2k(type: JavaExec) {
main = "org.jetbrains.idl2k.MainKt"
classpath = sourceSets.main.runtimeClasspath
}
-127
View File
@@ -1,127 +0,0 @@
<?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>
<parent>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-project</artifactId>
<version>1.3-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>idl2k</artifactId>
<version>1.3-SNAPSHOT</version>
<properties>
<kotlin.version>${project.version}</kotlin.version>
<antlr.version>4.5.3</antlr.version>
<idl2k.deploy.skip>true</idl2k.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!--<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>${antlr.version}</version>
<executions>
<execution>
<id>antlr</id>
<goals>
<goal>antlr4</goal>
</goals>
<configuration>
<visitor>true</visitor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>download-idl</id>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.jetbrains.idl2k.dl.DlPackage</mainClass>
</configuration>
</execution>
<execution>
<id>idl2k</id>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.jetbrains.idl2k.Idl2kPackage</mainClass>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>${project.basedir}</workingDirectory>
<classpathScope>compile</classpathScope>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>${idl2k.deploy.skip}</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,7 +1,7 @@
/*
BSD License
Copyright (c) 2013, Rainer Schuster
Copyright (c) 2013, 2015 Rainer Schuster
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -571,7 +571,7 @@ INTEGER_WEBIDL
;
FLOAT_WEBIDL
: '-'?(([0-9]+'.'[0-9]*|[0-9]*'.'[0-9]+)([Ee][\+\-]?[0-9]+)?|[0-9]+[Ee][\+\-]?[0-9]+)
: '-'?(([0-9]+'.'[0-9]*|[0-9]*'.'[0-9]+)([Ee][+\-]?[0-9]+)?|[0-9]+[Ee][+\-]?[0-9]+)
;
IDENTIFIER_WEBIDL
@@ -579,7 +579,7 @@ IDENTIFIER_WEBIDL
;
STRING_WEBIDL
: '"'~['"']*'"'
: '"' ~["]* '"'
;
WHITESPACE_WEBIDL
+3 -1
View File
@@ -196,7 +196,8 @@ include ":kotlin-build-common",
":kotlinx-serialization-compiler-plugin",
":kotlinx-serialization-ide-plugin",
":kotlin-serialization",
":kotlin-serialization-unshaded"
":kotlin-serialization-unshaded",
":kotlin-idl2k"
def isTeamcityBuild = hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
def includeUltimate = hasProperty("intellijUltimateEnabled") && intellijUltimateEnabled != 'false'
@@ -317,3 +318,4 @@ project(':kotlinx-serialization-compiler-plugin').projectDir = file("$rootDir/pl
project(':kotlinx-serialization-ide-plugin').projectDir = file("$rootDir/plugins/kotlin-serialization/kotlin-serialization-ide")
project(':kotlin-serialization').projectDir = file("$rootDir/libraries/tools/kotlin-serialization")
project(':kotlin-serialization-unshaded').projectDir = file("$rootDir/libraries/tools/kotlin-serialization-unshaded")
project(':kotlin-idl2k').projectDir = file("$rootDir/libraries/tools/idl2k")