-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
129 lines (104 loc) · 3.39 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.21'
id 'maven-publish'
id 'signing'
}
apply plugin: 'kotlin'
group 'org.buldakov.huawei.modem.client'
version '1.0.9'
repositories {
mavenCentral()
}
dependencies {
//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.21"
//Networking
implementation "com.squareup.okhttp3:okhttp:4.9.0"
//Time
implementation "joda-time:joda-time:2.10.5"
//Serialization
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.12.0"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.0"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.0"
//Logging
implementation "ch.qos.logback:logback-classic:1.2.3"
//Testing
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.0"
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.0"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
test {
useJUnitPlatform()
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'huawei-api-client'
from components.java
artifact(sourcesJar)
artifact(javadocJar)
pom {
name = 'Huawei 4G Modem API Client'
description = 'Client library which provides access to the Huawei Modem features.'
url = 'https://github.com/v1ctor/huawei-api-client'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'v1ctor'
name = 'Victor Buldakov'
email = 'victor@buldakov.org'
}
}
scm {
connection = 'scm:git:git@github.com:v1ctor/huawei-api-client.git'
developerConnection = 'scm:git:git@github.com:v1ctor/huawei-api-client.git'
url = 'https://github.com/v1ctor/huawei-api-client'
}
}
}
}
repositories {
maven {
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('NEXUS_USERNAME')
password = System.getenv('NEXUS_PASSWORD')
}
}
}
}
signing {
sign publishing.publications.mavenJava
}