You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
4.9 KiB
Groovy

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${project.property('elasticsearch.version')}"
}
}
plugins {
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "org.xbib.gradle.plugin.jflex" version "1.2.1"
id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.1"
}
apply plugin: 'java-library'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.rest-resources'
apply plugin: 'org.xbib.gradle.plugin.jflex'
ext {
user = 'joerg'
name = 'elasticsearch-plugin-bundle'
inceptionYear = '2013'
pluginName = 'bundle'
pluginClassname = 'org.xbib.elasticsearch.plugin.bundle.BundlePlugin'
pluginDescription = 'A bundle of plugins for Elasticsearch'
description = 'A bundle of plugins for Elasticsearch'
url = 'https://xbib.org/' + user + '/' + name
scmUrl = 'https://xbib.org/' + user + '/' + name
scmConnection = 'scm:git:git://xbib.org/' + user + '/' + name + '.git'
scmDeveloperConnection = 'scm:git:ssh://forgejo@xbib.org:' + user + '/' + name + '.git'
issueManagementSystem = 'Github'
issueManagementUrl = ext.scmUrl + '/issues'
licenseName = 'GNU Affero General Public License 3.0'
licenseUrl = 'https://www.gnu.org/licenses/agpl-3.0.txt'
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
sourceSets {
main {
java {
srcDir "build/generated-src/jflex"
}
}
}
esplugin {
description 'Plugin bundle for Elasticsearch'
name 'elasticsearch-plugin-bundle'
classname 'org.xbib.elasticsearch.plugin.bundle.BundlePlugin'
}
dependencies {
// we must use "compile" and not "implementation" otherwise ES build does not detect dependencies
compile "com.ibm.icu:icu4j:${project.property('icu4j.version')}"
compile "org.xbib:standardnumber:${project.property('standardnumber.version')}"
testImplementation "org.codelibs.elasticsearch.module:analysis-common:${project.property('elasticsearch.version')}"
}
apply plugin: 'java-library'
java {
modularity.inferModulePath.set(true)
withSourcesJar()
withJavadocJar()
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all,-exports')
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
}
/*
apply from: rootProject.file('gradle/ide/idea.gradle')
apply from: rootProject.file('gradle/repositories/maven.gradle')
apply from: rootProject.file('gradle/compile/java.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
apply from: rootProject.file('gradle/quality/checkstyle.gradle')
apply from: rootProject.file('gradle/quality/pmd.gradle')
apply from: rootProject.file('gradle/publish/maven.gradle')
apply from: rootProject.file('gradle/publish/sonatype.gradle')
apply from: rootProject.file('gradle/publish/forgejo.gradle')
*/
jar {
manifest {
attributes(
'Implementation-Title': "${project.group}#${project.name};${project.version}",
'Implementation-Version': "${project.version}",
'Implementation-Vendor': "${user}",
'Build-Date': ZonedDateTime.now(ZoneOffset.UTC),
'Build-Java-Version': System.getProperty("java.version")
)
}
}
clean {
delete fileTree('.') { include '.local*.log' }
}
artifacts {
archives sourcesJar, javadocJar
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
/*sonarqube {
properties {
property "sonar.projectName", "${project.group} ${project.name}"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.tests", "src/test/java"
property "sonar.scm.provider", "git"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.junit.reportsPath", "build/test-results/test/"
}
}*/
/*asciidoctor {
attributes toc: 'left',
doctype: 'book',
icons: 'font',
encoding: 'utf-8',
sectlink: true,
sectanchors: true,
linkattrs: true,
imagesdir: 'img',
'source-highlighter': 'coderay'
}*/
checkstyleMain.source = 'src/main/java'
// we use @Ignore
forbiddenApisTest.enabled = false
forbiddenPatterns.exclude('**/*.txt', '**/*.brk', '**/*.fst', '**/*.tree', '**/*.nrm')
licenseHeaders.enabled = false
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
loggerUsageCheck.enabled = false
testingConventions.enabled = false
validateNebulaPom.enabled = false