-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (90 loc) · 2.18 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group = 'io.github.toggery'
version = '2.0.3'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenLocal()
mavenCentral()
}
ext {
jt808MessageBodyVersion = '2.0.1'
nettyVersion = '4.1.85.Final'
jupiterVersion = '5.9.1'
}
dependencies {
api "io.github.toggery:jt808-messagebody:${jt808MessageBodyVersion}"
implementation "io.netty:netty-buffer:${nettyVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${jupiterVersion}"
}
tasks.named('test') {
useJUnitPlatform()
}
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.encoding = 'UTF-8'
options.addStringOption('charset', 'UTF-8')
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
publishing {
publications {
MyLibrary(MavenPublication) {
artifactId = 'jt808-codec'
from components.java
pom {
name = 'JT/T 808 Codec'
description = 'Java 语言实现的 JT/T 808 编码解码'
url = 'https://github.com/toggery/java-jt808-codec'
scm {
connection = 'scm:git:git://github.com/toggery/java-jt808-codec.git'
developerConnection = 'scm:git:ssh://github.com/toggery/java-jt808-codec.git'
url = 'https://github.com/toggery/java-jt808-codec'
}
licenses {
license {
name = 'The MIT License'
url = 'https://choosealicense.com/licenses/mit/'
}
}
developers {
developer {
id = 'togger'
name = 'Togger Jiang'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
if (version.endsWith('SNAPSHOT')) {
url = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
} else {
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2'
}
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
sign publishing.publications.MyLibrary
}