forked from marklogic/ml-app-deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (89 loc) · 2.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
plugins {
id "java"
id "maven-publish"
id "eclipse"
id "idea"
id "com.jfrog.bintray" version "1.5"
id "com.github.jk1.dependency-license-report" version "0.3.11"
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
repositories {
jcenter()
mavenLocal()
}
dependencies {
compile 'com.marklogic:ml-javaclient-util:' + mlJavaclientUtilVersion
compile 'jaxen:jaxen:1.1.6'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'org.springframework:spring-web:4.3.5.RELEASE'
// Don't want to include this in the published jar, just the executable jar
compileOnly "com.beust:jcommander:1.72"
testCompile 'com.marklogic:ml-junit:' + mlJunitVersion
testCompile 'commons-io:commons-io:2.5'
// Forcing Spring to use logback instead of commons-logging
compile "ch.qos.logback:logback-classic:1.1.8" // Needs to be compile for CLI
runtime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.22"
runtime group: "org.slf4j", name: "slf4j-api", version: "1.7.22"
}
// This ensures that Gradle includes in the published jar any non-java files under src/main/java
sourceSets.main.resources.srcDir 'src/main/java'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allJava
}
javadoc.destinationDir = file(javadocsDir + "/" + project.name)
javadoc.failOnError = false
publishing {
publications {
mainJava(MavenPublication) {
from components.java
}
sourcesJava(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
if (project.hasProperty("myBintrayUser")) {
bintray {
user = myBintrayUser
key = myBintrayKey
publications = ['mainJava', 'sourcesJava']
pkg {
repo = 'maven'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/rjrudin/' + project.name + '.git'
version {
name = project.version
released = new Date()
}
}
}
}
test {
testLogging {
events 'started','passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
task executableJar(type: Jar) {
baseName = "deployer"
manifest {
attributes("Main-Class": "com.marklogic.appdeployer.cli.Main")
}
// Include this project's class files
from sourceSets.main.output
// Include all project dependencies
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
}
from {
configurations.compileOnly.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}