This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.gradle
108 lines (87 loc) · 2.66 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
buildscript {
ext {
localversions = [
es : "7.17.7",
c2 : "4.3.1"
]
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${localversions.es}"
}
}
plugins {
id 'java-library'
id 'idea'
id 'com.diffplug.spotless' version "5.8.2" apply false
}
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.java-rest-test'
apply plugin: 'elasticsearch.yaml-rest-test'
apply from: file('gradle/validation/spotless.gradle')
// This plugin's version (typically must match that of ES).
// For bugfix releases against the same ES version, you can add a bugfix suffix.
def bugfix = ""
version = "${localversions.es}${bugfix}"
group = 'org.carrot2'
repositories {
mavenLocal()
mavenCentral()
}
ext {
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
esplugin {
name 'elasticsearch-carrot2'
description "Search results clustering plugin for Elasticsearch ${localversions.es} (Carrot2 ${localversions.c2})"
classname 'org.carrot2.elasticsearch.ClusteringPlugin'
}
configurations {
c2resources
}
dependencies {
c2resources("org.carrot2:carrot2-core:${localversions.c2}", {
transitive false
})
api("org.carrot2:carrot2-core:${localversions.c2}", {
exclude group: "com.carrotsearch", module: "hppc"
})
testImplementation "org.assertj:assertj-core:3.13.2"
// Let the javaRestTest see the classpath of main and tests.
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
javaRestTestImplementation project.sourceSets.test.runtimeClasspath
// TODO: ES 7.10.0-7.17.7 hack: missing log4j classes?
yamlRestTestRuntimeClasspath "org.apache.logging.log4j:log4j-core:2.17.1"
}
// Set target compatibility
sourceCompatibility = 11
targetCompatibility = 11
// We don't have unit tests, only integration tests.
test.enabled = false
// Add plugin configuration files to each testClusters instance.
// 'extraConfigFile' doesn't allow directories, only files, so we
// need to add each individually
testClusters.all {
fileTree(dir: 'src/main/config').each { file ->
extraConfigFile 'elasticsearch-carrot2/' + file.name, file
}
}
// Unpack and bundle the default resources with the plugin.
bundlePlugin {
from({ zipTree(configurations.c2resources.singleFile).matching { include "**/*.utf8" } }, {
eachFile { fcd ->
fcd.path -= "org/carrot2/language/"
}
includeEmptyDirs = false
into 'config'
})
}
// Configure publishing.
apply from: file('gradle/publishing.gradle')
// TODO: ES 7.13.4 hack. We generate our own POM.
tasks.matching { it.path == ":validateElasticPom" }.all { Task t ->
enabled = false
}