-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
127 lines (108 loc) · 3.55 KB
/
build.gradle
File metadata and controls
127 lines (108 loc) · 3.55 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'project-report'
apply plugin: 'ru.d10xa.allure'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3"
classpath "ru.d10xa:gradle-allure-plugin:0.5.1"
}
}
apply plugin: "com.github.johnrengelman.shadow"
sourceCompatibility = 1.8
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'maven central' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
jacoco {
toolVersion = "0.7.6.201602180812"
reportsDir = file("$buildDir/jacoco")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/reports/jacocoHtml"
}
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
//TODO - extract versions to constants
compile(
'org.slf4j:slf4j-api:1.7.21',
"com.sparkjava:spark-core:2.5",
'com.amazonaws:aws-lambda-java-core:1.1.0',
'com.amazonaws:aws-lambda-java-events:1.3.0',
'org.apache.logging.log4j:log4j-api:2.6.1',
'org.apache.logging.log4j:log4j-core:2.6.1',
'org.apache.logging.log4j:log4j-slf4j-impl:2.6.2',
'com.lmax:disruptor:3.3.4' //For using Async loggers
)
testCompile('junit:junit:4.12',
'org.assertj:assertj-core:3.3.0',
'org.mockito:mockito-all:2.0.2-beta',
'com.tngtech.java:junit-dataprovider:1.10.4')
}
tasks.withType(org.gradle.api.tasks.testing.Test) {
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
}
test {
maxParallelForks = 1
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
finalizedBy jacocoTestReport
}
task calculator(type: JavaExec) {
dependsOn = ["classes"]
classpath sourceSets.main.output.classesDir
classpath configurations.runtime
main = "com.bitbucket.learningjava.hotelratecalculator.Main"
}
allure {
aspectjweaver = true
junit = true
testNG = false
spock = false
geb = false
allureResultsDir = "$buildDir/allure-results"
allureReportDir = "$buildDir/allure-report"
allureVersion = "1.4.22"
aspectjVersion = "1.8.9"
}
task awsLambdaShadowJar(type: ShadowJar) {
dependencies {
exclude(dependency('com.sparkjava:spark-core'))
exclude(dependency('org.eclipse.jetty.*:.*'))
exclude(dependency('org.apache.*:.*'))
exclude(dependency('org.apache.logging.*:.*'))
exclude(dependency('com.fasterxml.*:.*'))
exclude(dependency('commons-codec:.*'))
exclude(dependency('commons-logging:.*'))
exclude(dependency('commons-beanutils:.*'))
exclude(dependency('joda-time:.*'))
exclude(dependency('com.lmax:.*'))
}
}
task sparkShadowJar(type: ShadowJar) {
dependencies {
exclude(dependency('com.amazonws:.*'))
}
classifier = 'resource'
from sourceSets.main.output
configurations = [project.configurations.runtime]
manifest {
attributes( 'Main-Class': 'com.github.learningjava.hotelratecalculator.RoomRateCalculatorResource')
}
}