-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
166 lines (136 loc) · 3.73 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
buildscript {
repositories {
jcenter()
maven { url "https://maven.aliyun.com/repository/public" }
}
}
plugins {
id 'java'
id 'maven'
id 'idea'
id 'maven-publish'
id "com.jfrog.bintray" version "1.8.1"
}
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://dl.bintray.com/nextabc/maven" }
maven { url "https://dl.bintray.com/yoojia/maven" }
jcenter()
}
group 'net.nextabc'
version '1.12.0'
description = 'Edge X for java'
sourceCompatibility = 1.8
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.slf4j:slf4j-log4j12:1.7.5'
// TOML
compile 'com.moandjiezana.toml:toml4j:0.7.2'
// MQTT
compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.1'
// Kit
compile 'net.nextabc:toolkit:1.0.0'
// JSON
compile 'com.google.code.gson:gson:2.8.5'
// Lombok, 注意,需要IDE插件支持
compileOnly 'org.projectlombok:lombok:1.18.8'
annotationProcessor 'org.projectlombok:lombok:1.18.8'
// Test
testCompile 'junit:junit:4.12'
}
ext {
projectGroupId = project.group
projectVersion = project.version
projectName = rootProject.name
projectDesc = description
projectURL = "https://github.com/nextabc-lab/edgex-java"
projectVCS = "https://github.com/nextabc-lab/edgex-java.git"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/8/docs/api"
title projectName
}
}
artifacts {
archives sourcesJar, javadocJar
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenJava']
configurations = ['archives']
dryRun = false
publish = true
pkg {
repo = 'maven'
name = projectName
userOrg = 'nextabc'
licenses = ['Apache-2.0']
vcsUrl = projectVCS
labels = ['Java', 'Mqtt', 'Edge']
publicDownloadNumbers = true
version {
name = projectVersion
desc = projectDesc
vcsTag = projectVersion
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
}
}
}
def pomConfig = {
name projectName
url projectURL
inceptionYear '2019'
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "yoojia"
name "yoojia chen"
email "[email protected]"
}
}
scm {
url projectVCS
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId projectGroupId
artifactId projectName
version projectVersion
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', projectDesc)
root.children().last() + pomConfig
}
}
}
}