-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.bk
More file actions
126 lines (101 loc) · 2.82 KB
/
build.gradle.bk
File metadata and controls
126 lines (101 loc) · 2.82 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
buildscript {
ext {
springBootVersion = "2.0.3.RELEASE"
}
repositories {
mavenLocal()
mavenCentral()
// maven{
// url("http://maven.aliyun.com/nexus/content/repositories/central")
// }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
classpath "com.google.gradle:osdetector-gradle-plugin:1.4.0"
}
}
apply from: "build-dependencies.gradle"
subprojects {
apply plugin: "java"
apply plugin: "maven"
apply plugin: "idea"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "com.google.protobuf"
group = "cn.elmi.microservice"
version = "1.0-SNAPSHOT"
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = "UTF-8"
repositories {
mavenLocal()
mavenCentral()
}
configurations {
all*.exclude module: ["commons-logging", "commons-lang", "guava"]
}
dependencyManagement {
imports {
mavenBom lib.spring.boot.dependencies
}
}
jar {
enabled = true
}
// springboot2.0 new feature
bootJar {
manifest {
attributes "Start-Class": "cn.elmi.Application"
}
}
dependencies {
compile lib.spring.boot.starter.core,
lib.lombok,
lib.slf4j,
lib.logback.classic,
lib.logback.core
testCompile lib.testng
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
java {}
}
task.plugins {
grpc {
}
}
}
}
generatedFilesBaseDir = "$projectDir/src-gen"
}
clean {
delete protobuf.generatedFilesBaseDir
}
// TODO
task protoJar(type: Jar, dependsOn: ["build"]) {
archiveName = "example-proto-${version}.jar"
from("build/classes/java/main/")
destinationDir = file("build/libs")
include("cn/elmi/grpc/**/*.class")
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://10.72.46.201:8080/content/repositories/snapshots/")
repository(url: "http://10.72.46.201:8080/content/repositories/releases/")
}
}
}
}