This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
85 lines (72 loc) · 3.88 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
/*
* This software is in the public domain under CC0 1.0 Universal plus a
* Grant of Patent License.
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to the
* public domain worldwide. This software is distributed without any
* warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software (see the LICENSE.md file). If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
apply plugin: 'groovy'
sourceCompatibility = '1.8'
def componentNode = parseComponent(project)
version = componentNode.'@version'
def jarBaseName = componentNode.'@name'
def moquiDir = projectDir.parentFile.parentFile.parentFile
def frameworkDir = file(moquiDir.absolutePath + '/framework')
// to run use "gradle dependencyUpdates"
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories { jcenter() }
dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0' }
}
dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'pr'].any { qualifier -> selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ }
if (rejected) selection.reject('Release candidate')
} } }
repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
jcenter()
}
// Log4J has annotation processors, disable to avoid warning
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
dependencies {
compile project(':framework')
// ElasticSearch Libraries, including Lucene
compile 'org.elasticsearch:elasticsearch:6.3.2' // Apache 2.0
// ElasticSearch uses jackson-dataformat-smile, -yaml, -cbor pulling in jackson-core, also used by OrientDB, but gets an older version
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.9.9'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.9'
// now included in framework, also used by moqui-aws: compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.9'
// JNA, needed by ElasticSearch when running embedded, now included as a dependency: compile 'net.java.dev.jna:jna:4.5.0' // Apache 2.0
// not currently needed/used: compile 'net.java.dev.jna:jna-platform:4.5.0' // Apache 2.0
// modules: when updating these update the versions in the plugin-descriptor.properties files in home/modules/*
compile 'org.codelibs.elasticsearch.lib:plugin-classloader:6.3.2'
compile 'org.codelibs.elasticsearch.module:transport-netty4:6.3.2'
compile 'org.codelibs.elasticsearch.module:reindex:6.3.2'
// painless script
compile 'org.codelibs.elasticsearch.module:lang-painless:6.3.2'
// groovy script lang no longer supported as of ES6: compile module('org.codelibs.elasticsearch.module:lang-groovy:6.3.2')
// would be nice, but doesn't exist: compile 'org.codelibs.elasticsearch.plugins:discovery-ec2:6.3.2'
compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.3.2'
}
// by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
// no longer workds as of gradle 4.8 or possibly earlier, use clear() instead: check.dependsOn.remove(test)
check.dependsOn.clear()
task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib
jar {
destinationDir = file(projectDir.absolutePath + '/lib')
baseName = jarBaseName
}
task copyDependencies { doLast {
copy { from (configurations.runtime - project(':framework').configurations.runtime - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies