-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
115 lines (94 loc) · 2.5 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
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
group = 'com.celsius.tsp'
version = '1.0-SNAPSHOT'
description = """tsp-solver"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
}
}
repositories {
mavenCentral()
mavenLocal()
}
jar {
manifest {
attributes 'Implementation-Title': 'TSP Solver',
'Implementation-Version': version,
'Main-Class': 'com.celsius.tsp.TravellingSalesmanSolverApplication'
}
}
def grpcVersion = '1.0.0'
dependencies {
compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compile 'io.reactivex.rxjava2:rxjava:2.0.0'
compile 'io.dropwizard.metrics:metrics-core:3.1.0'
compile 'org.apache.logging.log4j:log4j-api:2.7'
compile 'org.apache.logging.log4j:log4j-core:2.7'
compile 'org.projectlombok:lombok:1.12.6'
testCompile 'junit:junit:4.12'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {
option 'enable_deprecated=false'
}
}
}
}
apply plugin: 'jacoco'
jacocoTestReport {
reports {
xml.enabled true
html.destination "${buildDir}/jacocoHtml"
}
}
apply plugin: 'checkstyle'
checkstyle {
configFile = file("$rootDir/checkstyle.xml")
toolVersion = "6.17"
ignoreFailures = false
if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean()
}
configProperties["rootDir"] = rootDir
}
apply plugin: "application"
startScripts.enabled = false
task travellingSalesmanProblem(type: CreateStartScripts) {
mainClassName = 'com.celsius.tsp.TravellingSalesmanSolverApplication'
applicationName = 'travelling-salesman-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(travellingSalesmanProblem)
fileMode = 0755
}
apply plugin: 'idea'
idea {
module {
sourceDirs += file("${projectDir}/build/generated/source/proto/main/java")
sourceDirs += file("${projectDir}/build/generated/source/proto/main/grpc")
}
}