Move sql's server stuff into :x-pack-elasticsearch:sql:server

This should make it easier to run stuff for just sql.

Original commit: elastic/x-pack-elasticsearch@d68465edb0
This commit is contained in:
Nik Everett 2017-06-29 14:31:23 -04:00
parent 2f9c0858f7
commit 0e8ef06947
490 changed files with 163 additions and 140 deletions

View File

@ -9,9 +9,8 @@
<suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]sql[/\\]parser[/\\]SqlBase(Base(Listener|Visitor)|Lexer|Listener|Parser|Visitor).java" checks="." /> <suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]sql[/\\]parser[/\\]SqlBase(Base(Listener|Visitor)|Lexer|Listener|Parser|Visitor).java" checks="." />
<!-- NOCOMMIT Temporary--> <!-- NOCOMMIT Temporary-->
<suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]sql[/\\].*.java" checks="LineLength" /> <suppress files="sql[/\\].*.java" checks="LineLength" />
<suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]sql[/\\]expression[/\\].*.java" checks="EqualsHashCode" /> <suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]sql[/\\]expression[/\\].*.java" checks="EqualsHashCode" />
<suppress files="sql-clients[/\\].*.java" checks="LineLength" />
<suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]common[/\\]action[/\\]XPackDeleteByQueryAction.java" checks="LineLength" /> <suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]common[/\\]action[/\\]XPackDeleteByQueryAction.java" checks="LineLength" />
<suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]ml[/\\]action[/\\]StopDatafeedAction.java" checks="LineLength" /> <suppress files="plugin[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]xpack[/\\]ml[/\\]action[/\\]StopDatafeedAction.java" checks="LineLength" />

View File

@ -32,15 +32,9 @@ dependencyLicenses {
mapping from: /http.*/, to: 'httpclient' // pulled in by rest client mapping from: /http.*/, to: 'httpclient' // pulled in by rest client
mapping from: /commons-.*/, to: 'commons' // pulled in by rest client mapping from: /commons-.*/, to: 'commons' // pulled in by rest client
mapping from: /sniffer.*/, to: 'elasticsearch' mapping from: /sniffer.*/, to: 'elasticsearch'
mapping from: /jdbc-proto.*/, to: 'elasticsearch'
mapping from: /cli-proto.*/, to: 'elasticsearch'
mapping from: /net-client.*/, to: 'elasticsearch'
ignoreSha 'rest' ignoreSha 'rest'
ignoreSha 'transport-netty4' ignoreSha 'transport-netty4'
ignoreSha 'sniffer' ignoreSha 'sniffer'
ignoreSha 'jdbc-proto'
ignoreSha 'cli-proto'
ignoreSha 'net-client'
} }
licenseHeaders { licenseHeaders {
@ -89,10 +83,8 @@ dependencies {
nativeBundle "org.elasticsearch.ml:ml-cpp:${project.version}@zip" nativeBundle "org.elasticsearch.ml:ml-cpp:${project.version}@zip"
testCompile 'org.ini4j:ini4j:0.5.2' testCompile 'org.ini4j:ini4j:0.5.2'
// sql deps // sql's server components and its transitive dependencies
compile project(':x-pack-elasticsearch:sql-clients:jdbc-proto') compile project(':x-pack-elasticsearch:sql:server')
compile project(':x-pack-elasticsearch:sql-clients:cli-proto')
compile 'org.antlr:antlr4-runtime:4.5.1-1'
// common test deps // common test deps
testCompile 'org.elasticsearch:securemock:1.2' testCompile 'org.elasticsearch:securemock:1.2'
@ -109,8 +101,8 @@ sourceSets.test.java {
srcDir '../license-tools/src/main/java' srcDir '../license-tools/src/main/java'
} }
compileJava.options.compilerArgs << "-parameters" << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked" compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
compileTestJava.options.compilerArgs << "-parameters" << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
ext.expansions = [ ext.expansions = [
'project.version': version, 'project.version': version,
@ -335,73 +327,3 @@ run {
setting 'xpack.monitoring.enabled', 'true' setting 'xpack.monitoring.enabled', 'true'
setting 'xpack.watcher.enabled', 'true' setting 'xpack.watcher.enabled', 'true'
} }
/**********************************************
* SQL Parser regeneration *
**********************************************/
configurations {
regenerate
}
dependencies {
regenerate 'org.antlr:antlr4:4.5.1-1'
}
String grammarPath = 'src/main/antlr'
String outputPath = 'src/main/java/org/elasticsearch/xpack/sql/parser'
task cleanGenerated(type: Delete) {
delete fileTree(grammarPath) {
include '*.tokens'
}
delete fileTree(outputPath) {
include 'SqlBase*.java'
}
}
task regenParser(type: JavaExec) {
dependsOn cleanGenerated
main = 'org.antlr.v4.Tool'
classpath = configurations.regenerate
systemProperty 'file.encoding', 'UTF-8'
systemProperty 'user.language', 'en'
systemProperty 'user.country', 'US'
systemProperty 'user.variant', ''
args '-Werror',
'-package', 'org.elasticsearch.xpack.sql.parser',
'-listener',
'-visitor',
'-o', outputPath,
"${file(grammarPath)}/SqlBase.g4"
}
task regen {
dependsOn regenParser
doLast {
// moves token files to grammar directory for use with IDE's
ant.move(file: "${outputPath}/SqlBase.tokens", toDir: grammarPath)
ant.move(file: "${outputPath}/SqlBaseLexer.tokens", toDir: grammarPath)
// make the generated classes package private
ant.replaceregexp(match: 'public ((interface|class) \\QSqlBase\\E\\w+)',
replace: '\\1',
encoding: 'UTF-8') {
fileset(dir: outputPath, includes: 'SqlBase*.java')
}
// nuke timestamps/filenames in generated files
ant.replaceregexp(match: '\\Q// Generated from \\E.*',
replace: '\\/\\/ ANTLR GENERATED CODE: DO NOT EDIT',
encoding: 'UTF-8') {
fileset(dir: outputPath, includes: 'SqlBase*.java')
}
// remove tabs in antlr generated files
ant.replaceregexp(match: '\t', flags: 'g', replace: ' ', encoding: 'UTF-8') {
fileset(dir: outputPath, includes: 'SqlBase*.java')
}
// fix line endings
ant.fixcrlf(srcdir: outputPath) {
patternset(includes: 'SqlBase*.java')
}
}
}

View File

@ -1,20 +0,0 @@
description = 'SQL clients for Elasticsearch and code shared between those ' +
'clients and their backends in :x-pack-elasticsearch:plugin'
import org.gradle.plugins.ide.eclipse.model.*;
import org.elasticsearch.gradle.precommit.PrecommitTasks
subprojects {
apply plugin: 'elasticsearch.build'
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
dependencies {
testCompile "org.elasticsearch.test:framework:${version}"
}
forbiddenApisMain {
// does not depend on core, so only jdk and http signatures should be checked
signaturesURLs = [PrecommitTasks.getResource('/forbidden/jdk-signatures.txt')]
}
}

View File

@ -1,7 +0,0 @@
apply plugin: 'elasticsearch.build'
description = 'Request and response objects shared by the cli and ' +
'its backend in :x-pack-elasticsearch:plugin'
dependencyLicenses {
}

View File

@ -1,12 +0,0 @@
apply plugin: 'elasticsearch.build'
description = 'Request and response objects shared by the jdbc driver and ' +
'its backend in :x-pack-elasticsearch:plugin'
dependencies {
testCompile project(':x-pack-elasticsearch:sql-clients:test-utils')
}
dependencyLicenses {
}

View File

@ -1,3 +0,0 @@
apply plugin: 'elasticsearch.build'
description = 'Common base code for protos'

13
sql/build.gradle Normal file
View File

@ -0,0 +1,13 @@
description = 'SQL for Elasticsearch'
import org.gradle.plugins.ide.eclipse.model.*;
subprojects {
apply plugin: 'elasticsearch.build'
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
dependencies {
testCompile "org.elasticsearch.test:framework:${version}"
}
}

View File

@ -0,0 +1,9 @@
apply plugin: 'elasticsearch.build'
description = 'Request and response objects shared by the cli and ' +
'its backend in :x-pack-elasticsearch:plugin'
forbiddenApisMain {
// does not depend on core, so only jdk and http signatures should be checked
signaturesURLs = [this.class.getResource('/forbidden/jdk-signatures.txt')]
}

View File

@ -5,13 +5,14 @@ description = 'Command line interface to Elasticsearch that speaks SQL'
dependencies { dependencies {
compile "org.jline:jline:3.3.1" compile "org.jline:jline:3.3.1"
compile project(':x-pack-elasticsearch:sql-clients:net-client') compile project(':x-pack-elasticsearch:sql:net-client')
compile project(':x-pack-elasticsearch:sql-clients:cli-proto') compile project(':x-pack-elasticsearch:sql:cli-proto')
testCompile project(":x-pack-elasticsearch:transport-client") testCompile project(":x-pack-elasticsearch:transport-client")
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts') testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
testCompile project(':x-pack-elasticsearch:sql-clients:test-utils') testCompile project(':x-pack-elasticsearch:sql:test-utils')
testCompile project(':x-pack-elasticsearch:sql:server')
runtime "org.fusesource.jansi:jansi:1.16" runtime "org.fusesource.jansi:jansi:1.16"
runtime "org.elasticsearch:jna:4.4.0" runtime "org.elasticsearch:jna:4.4.0"
} }
@ -23,10 +24,15 @@ dependencyLicenses {
ignoreSha 'net-client' ignoreSha 'net-client'
} }
forbiddenApisMain {
// does not depend on core, so only jdk and http signatures should be checked
signaturesURLs = [this.class.getResource('/forbidden/jdk-signatures.txt')]
}
// TODO seems like we should use the jars.... // TODO seems like we should use the jars....
jar { jar {
from(zipTree(project(':x-pack-elasticsearch:sql-clients:net-client').jar.archivePath)) from(zipTree(project(':x-pack-elasticsearch:sql:net-client').jar.archivePath))
from(zipTree(project(':x-pack-elasticsearch:sql-clients:cli-proto').jar.archivePath)) from(zipTree(project(':x-pack-elasticsearch:sql:cli-proto').jar.archivePath))
} }
mainClassName = "org.elasticsearch.sql.console.SqlConsole" mainClassName = "org.elasticsearch.sql.console.SqlConsole"

View File

@ -0,0 +1,13 @@
apply plugin: 'elasticsearch.build'
description = 'Request and response objects shared by the jdbc driver and ' +
'its backend in :x-pack-elasticsearch:plugin'
dependencies {
testCompile project(':x-pack-elasticsearch:sql:test-utils')
}
forbiddenApisMain {
// does not depend on core, so only jdk and http signatures should be checked
signaturesURLs = [this.class.getResource('/forbidden/jdk-signatures.txt')]
}

View File

@ -13,6 +13,11 @@ sourceSets {
} }
} }
forbiddenApisMain {
// does not depend on core, so only jdk and http signatures should be checked
signaturesURLs = [this.class.getResource('/forbidden/jdk-signatures.txt')]
}
task generateGitHash { task generateGitHash {
// TODO use the manifest file automatically built by elasticsearch.build // TODO use the manifest file automatically built by elasticsearch.build
doLast { doLast {
@ -36,12 +41,12 @@ task generateGitHash {
} }
dependencies { dependencies {
compile project(':x-pack-elasticsearch:sql-clients:net-client') compile project(':x-pack-elasticsearch:sql:net-client')
compile project(':x-pack-elasticsearch:sql-clients:jdbc-proto') compile project(':x-pack-elasticsearch:sql:jdbc-proto')
testCompile project(":x-pack-elasticsearch:transport-client") testCompile project(":x-pack-elasticsearch:transport-client") // NOCOMMIT probably can remove this
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts') testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
testCompile project(':x-pack-elasticsearch:sql-clients:test-utils') testCompile project(':x-pack-elasticsearch:sql:test-utils')
// Used by the hack to run InternalTestCluster if not running against a gradle-started cluster. // Used by the hack to run InternalTestCluster if not running against a gradle-started cluster.
testCompile project(path: ':modules:lang-painless', configuration: 'runtime') testCompile project(path: ':modules:lang-painless', configuration: 'runtime')
@ -59,8 +64,8 @@ dependencyLicenses {
// TODO seems like we should use the jars.... // TODO seems like we should use the jars....
jar { jar {
from(zipTree(project(':x-pack-elasticsearch:sql-clients:net-client').jar.archivePath)) from(zipTree(project(':x-pack-elasticsearch:sql:net-client').jar.archivePath))
from(zipTree(project(':x-pack-elasticsearch:sql-clients:jdbc-proto').jar.archivePath)) from(zipTree(project(':x-pack-elasticsearch:sql:jdbc-proto').jar.archivePath))
} }
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'

Some files were not shown because too many files have changed in this diff Show More