mirror of
https://github.com/elastic/logstash.git
synced 2025-04-20 04:37:18 -04:00
129 lines
3.6 KiB
Groovy
129 lines
3.6 KiB
Groovy
import org.yaml.snakeyaml.Yaml
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'idea'
|
|
|
|
// fetch version from Logstash's master versions.yml file
|
|
def versionMap = (Map) (new Yaml()).load(new File("$projectDir/../versions.yml").text)
|
|
|
|
group = 'org.logstash'
|
|
description = """Logstash Core Java"""
|
|
version = versionMap['logstash-core']
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath 'org.yaml:snakeyaml:1.17'
|
|
}
|
|
}
|
|
|
|
gradle.projectsEvaluated {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << "-Xlint:deprecation"
|
|
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
|
}
|
|
}
|
|
|
|
project.sourceCompatibility = 1.8
|
|
project.targetCompatibility = 1.8
|
|
|
|
task sourcesJar(type: org.gradle.api.tasks.bundling.Jar, dependsOn: classes) {
|
|
from sourceSets.main.allSource
|
|
classifier 'sources'
|
|
extension 'jar'
|
|
}
|
|
|
|
task javadocJar(type: org.gradle.api.tasks.bundling.Jar, dependsOn: javadoc) {
|
|
from javadoc.destinationDir
|
|
classifier 'javadoc'
|
|
extension 'jar'
|
|
}
|
|
|
|
// copy jar file into the gem lib dir but without the version number in filename
|
|
task copyGemjar(type: org.gradle.api.tasks.Copy, dependsOn: sourcesJar) {
|
|
from project.jar
|
|
into project.file('lib/logstash-core/')
|
|
rename(/(.+)-${project.version}.jar/, '$1.jar')
|
|
}
|
|
|
|
task cleanGemjar {
|
|
delete fileTree(project.file('lib/logstash-core/')) {
|
|
include '*.jar'
|
|
}
|
|
}
|
|
|
|
clean.dependsOn(cleanGemjar)
|
|
jar.finalizedBy(copyGemjar)
|
|
|
|
task gemspec_jars << {
|
|
File gemspec_jars = file("./gemspec_jars.rb")
|
|
gemspec_jars.newWriter().withWriter { w ->
|
|
w << "# This file is generated by Gradle as part of the build process. It extracts the build.gradle\n"
|
|
w << "# runtime dependencies to generate this gemspec dependencies file to be eval'ed by the gemspec\n"
|
|
w << "# for the jar-dependencies requirements.\n\n"
|
|
configurations.runtime.allDependencies.each { dependency ->
|
|
w << "gem.requirements << \"jar ${dependency.group}:${dependency.name}, ${dependency.version}\"\n"
|
|
}
|
|
}
|
|
}
|
|
build.finalizedBy(gemspec_jars)
|
|
|
|
configurations.create('sources')
|
|
configurations.create('javadoc')
|
|
configurations.archives {
|
|
extendsFrom configurations.sources
|
|
extendsFrom configurations.javadoc
|
|
}
|
|
|
|
artifacts {
|
|
sources(sourcesJar) {
|
|
// Weird Gradle quirk where type will be used for the extension, but only for sources
|
|
type 'jar'
|
|
}
|
|
javadoc(javadocJar) {
|
|
type 'javadoc'
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
provided
|
|
}
|
|
|
|
project.sourceSets {
|
|
main.compileClasspath += project.configurations.provided
|
|
main.runtimeClasspath += project.configurations.provided
|
|
test.compileClasspath += project.configurations.provided
|
|
test.runtimeClasspath += project.configurations.provided
|
|
}
|
|
project.javadoc.classpath += project.configurations.provided
|
|
|
|
idea {
|
|
module {
|
|
scopes.PROVIDED.plus += [project.configurations.provided]
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
runtime 'org.apache.logging.log4j:log4j-1.2-api:2.6.2'
|
|
compile 'org.apache.logging.log4j:log4j-api:2.6.2'
|
|
compile 'org.apache.logging.log4j:log4j-core:2.6.2'
|
|
compile 'com.fasterxml.jackson.core:jackson-core:2.7.4'
|
|
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.4'
|
|
testCompile 'org.apache.logging.log4j:log4j-core:2.6.2:tests'
|
|
testCompile 'org.apache.logging.log4j:log4j-api:2.6.2:tests'
|
|
testCompile 'junit:junit:4.12'
|
|
provided 'org.jruby:jruby-core:1.7.25'
|
|
}
|
|
|
|
// See http://www.gradle.org/docs/current/userguide/gradle_wrapper.html
|
|
task wrapper(type: Wrapper) {
|
|
description = 'Install Gradle wrapper'
|
|
gradleVersion = '2.8'
|
|
}
|
|
|