-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
160 lines (135 loc) · 3.58 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
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.10.0"
}
}
plugins {
id "com.jfrog.artifactory" version "4.5.4"
id "maven-publish"
id "java"
}
apply plugin: 'com.diffplug.gradle.spotless' //Check sources are correctly formatted
apply plugin: "jacoco"
group = 'cat.joanpujol.smasolar'
version = '0.0.1-SNAPSHOT'
tasks.withType(JavaCompile) {
sourceCompatibility = 1.10
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://maven.mangoautomation.net/repository/ias-release/"
}
}
dependencies {
compile group: 'io.netty', name: 'netty-all', version: '4.1.25.Final'
compile 'com.digitalpetri.modbus:modbus-master-tcp:1.1.0'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile "io.reactivex.rxjava2:rxjava:2.1.14"
runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
testCompile('org.assertj:assertj-core:3.9.1')
testCompile 'org.mockito:mockito-core:2.19.0'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
reports {
html.enabled = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
artifactory {
contextUrl = 'http://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = System.getProperty('bintray.user')
password = System.getProperty('bintray.key')
}
defaults {
publications('mavenPublication') // References publishing.publications
publishArtifacts = true
publishPom = true
}
}
resolve {
repoKey = 'jcenter'
}
clientConfig.info.setBuildNumber(System.getProperty('build.number'))
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}
def pomConfig = {
licenses {
license {
name "GNU General Public License v3.0"
url "https://www.gnu.org/licenses/gpl-3.0.en.html"
distribution "repo"
}
}
developers {
developer {
id "lujop"
name "Joan Pujol"
}
}
scm {
url "https://github.com/lujop/smasolarlib.git"
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId rootProject.group
artifactId 'smasolarlib'
version rootProject.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'A library with interface to some sma devices')
root.appendNode('name', 'smasolarlib')
root.appendNode('url', 'https://github.com/lujop/smasolarlib')
root.children().last() + pomConfig
}
}
}
}
spotless {
java {
googleJavaFormat('1.5')
}
}