-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbuild.gradle
131 lines (107 loc) · 3.44 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
buildscript {
repositories {
mavenCentral()
maven {
name 'sonatype-snapshots'
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:6.4.2"
}
}
plugins {
id "me.champeau.gradle.jmh" version "0.4.7"
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'
group = 'com.github.staysense'
if (project.hasProperty('projectVersion')) {
version = project.projectVersion
} else {
version = '6.4.2'
}
licenseFile = rootProject.file('LICENSE')
noticeFile = rootProject.file('README.md')
ext {
isIdea = System.getProperty("idea.active") != null || gradle.startParameter.taskNames.contains('idea') || gradle.startParameter.taskNames.contains('cleanIdea')
}
description = "Vector cosine similarity scoring for Elasticsearch"
sourceCompatibility = 1.8
targetCompatibility = 1.8
esplugin {
name 'fast-cosine-similarity'
description 'ElasticSearch Plugin for Cosine Similarity'
classname 'com.staysense.fastcosinesimilarity.FastCosineSimilarityPlugin'
licenseFile rootProject.file('LICENSE')
noticeFile rootProject.file('README.md')
}
integTestCluster {
// numNodes = 2
}
dependencies {
compile "org.elasticsearch:elasticsearch:${version}"
testCompile "org.elasticsearch.test:framework:${version}"
jmh 'org.eclipse.january:org.eclipse.january:2.1.5'
jmh ("org.apache.commons:commons-math3:3.6.1") {
// jmh depends on 3.2, january depends on 3.3.
force = true
}
}
// no unit tests
test.enabled = false
// skip license header checks
licenseHeaders.enabled = false
dependencyLicenses.enabled = false
// january fails forbiddenapis
thirdPartyAudit.enabled = false
// IntelliJ
// =============================================================================
if (isIdea) {
project.buildDir = file('build-idea')
}
idea {
module {
inheritOutputDirs = false
outputDir = file('build-idea/classes/main')
testOutputDir = file('build-idea/classes/test')
// also ignore other possible build dirs
excludeDirs += file('build')
excludeDirs += file('build-eclipse')
iml {
// fix so that Gradle idea plugin properly generates support for resource folders
// see also https://issues.gradle.org/browse/GRADLE-2975
withXml {
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/main/resources' }.each {
it.attributes().remove('isTestSource')
it.attributes().put('type', 'java-resource')
}
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/test/resources' }.each {
it.attributes().remove('isTestSource')
it.attributes().put('type', 'java-test-resource')
}
}
}
}
}
task cleanIdeaBuildDir(type: Delete) {
delete 'build-idea'
}
cleanIdeaBuildDir.setGroup("ide")
cleanIdeaBuildDir.setDescription("Deletes the IDEA build directory.")
tasks.cleanIdea.dependsOn(cleanIdeaBuildDir)
idea {
project {
vcs = 'Git'
}
}
// Make sure gradle idea was run before running anything in intellij (including import).
File ideaMarker = new File(projectDir, '.local-idea-is-configured')
tasks.idea.doLast {
ideaMarker.setText('', 'UTF-8')
}
if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) {
throw new GradleException('You must run gradle idea from the root of elasticsearch before importing into IntelliJ')
}