-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathbuild.gradle
157 lines (136 loc) · 4.05 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
plugins {
id 'jacoco'
// id "org.sonarqube" version "3.3"
// spotless pre v5 used to allow gradle 4 on ubuntu-latest
id "com.diffplug.gradle.spotless" version "4.5.1"
id 'maven-publish'
id 'signing'
id 'java'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'io.github.java-native:jssc:2.9.4'
implementation 'org.json:json:20220320'
testImplementation 'junit:junit:4.13.2'
}
sourceSets {
test {
java {
srcDir 'test'
}
}
main {
java {
srcDir 'src'
}
resources {
srcDir 'src/resources'
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
test {
useJUnit()
finalizedBy jacocoTestReport
}
archivesBaseName = 'sbp'
jacocoTestReport {
reports {
// Using deprecated 'enabled' for gradle 4 compatibility
xml.enabled = true
}
}
// sonarqube {
// properties {
// property 'sonar.projectName', "libsbp-java"
// property "sonar.projectKey", "swift-nav_libsbp"
// property "sonar.organization", "swift-nav"
// property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/jacoco/test/jacocoTestReport.xml'
// property "sonar.host.url", "https://sonarcloud.io"
// }
// }
spotless {
java {
// Use Android Open Source Project style
googleJavaFormat().aosp()
importOrder()
endWithNewline()
removeUnusedImports()
licenseHeader '/* Copyright (C) 2015-2022 Swift Navigation Inc.\n' +
' * Contact: https://support.swiftnav.com\n' +
' *\n' +
' * This source is subject to the license found in the file \'LICENSE\' which must\n' +
' * be distributed together with this source. All other rights reserved.\n' +
' *\n' +
' * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n' +
' * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED\n' +
' * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n' +
' */\n'
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.swiftnav'
artifactId = 'sbp'
version = System.getenv("VERSION") ?: "unset-version-build" // should instead fail if version not provided?
from components.java
pom {
name = 'libsbp'
description = 'Swift binary protocol client libraries'
url = 'https://github.com/swift-nav/libsbp'
inceptionYear = '2021'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'swift-nav'
name = 'Swift Navigation'
email = 'dev@swiftnav.com'
}
}
scm {
connection = 'scm:git:git:github.com/swift-nav/libsbp.git'
developerConnection = 'scm:git:ssh://github.com/swift-nav/libsbp.git'
url = 'https://github.com/swift-nav/libsbp'
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.properties["ossrhUsername"]
password = project.properties["ossrhPassword"]
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}