1
1
plugins {
2
- id " com.github.hierynomus.license" version " 0.11.0"
2
+ id ' java-library'
3
+ id ' jacoco'
4
+ id ' signing'
5
+ id ' maven-publish'
6
+ id " com.github.hierynomus.license" version " 0.16.1"
3
7
}
4
8
5
- apply plugin : ' java'
6
- apply plugin : ' maven'
7
- apply plugin : ' signing'
8
- apply plugin : ' idea'
9
- apply plugin : ' eclipse'
10
- apply plugin : ' license'
11
- apply plugin : ' jacoco'
12
-
13
9
group = ' com.tokbox'
14
10
archivesBaseName = ' opentok-server-sdk'
15
- version = ' 4.6.0'
11
+ version = ' 4.7.0'
12
+
13
+ sourceCompatibility = " 1.8"
14
+ targetCompatibility = " 1.8"
15
+
16
+ repositories {
17
+ mavenCentral()
18
+ }
19
+
20
+ dependencies {
21
+ testImplementation ' junit:junit:4.13.2'
22
+ testImplementation ' com.github.tomakehurst:wiremock:1.58'
23
+ implementation ' commons-lang:commons-lang:2.6'
24
+ implementation ' commons-validator:commons-validator:1.7'
25
+ implementation ' org.asynchttpclient:async-http-client:2.12.3'
26
+ implementation ' com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
27
+ implementation ' commons-codec:commons-codec:1.15'
28
+ implementation ' org.bitbucket.b_c:jose4j:0.7.11'
29
+ }
30
+
31
+ task sourcesJar (type : Jar ) {
32
+ archiveClassifier. set(" sources" )
33
+ from sourceSets. main. allSource
34
+ }
35
+
36
+ tasks. withType(JavaCompile ) {
37
+ options. compilerArgs << " -Xlint:deprecation" << " -Xlint:unchecked"
38
+ }
16
39
17
40
task javadocJar (type : Jar ) {
18
- classifier = ' javadoc'
41
+ archiveClassifier . set( " javadoc" )
19
42
from javadoc
20
43
}
21
44
javadoc {
@@ -28,35 +51,16 @@ javadoc {
28
51
}
29
52
}
30
53
54
+ jacoco {
55
+ toolVersion = " 0.8.8"
56
+ }
31
57
jacocoTestReport {
32
58
reports {
33
- xml. enabled true
34
- html. enabled false
59
+ xml. getRequired() . set( true )
60
+ html. getRequired() . set( true )
35
61
}
36
62
}
37
-
38
- task sourcesJar (type : Jar ) {
39
- classifier = ' sources'
40
- from sourceSets. main. allSource
41
- }
42
-
43
- repositories {
44
- mavenCentral()
45
- }
46
-
47
- dependencies {
48
- testCompile group : ' junit' , name : ' junit' , version : ' [4.3,5.0]'
49
- testCompile group : ' com.github.tomakehurst' , name : ' wiremock' , version : ' [1.45,2.0]'
50
- compile group : ' commons-lang' , name : ' commons-lang' , version : ' [2.6,3.0]'
51
- compile group : ' org.asynchttpclient' , name : ' async-http-client' , version : ' [2.0,2.99999)'
52
- compile group : ' com.fasterxml.jackson.core' , name : ' jackson-databind' , version : ' [2.3.1,2.99999)'
53
- compile group : ' commons-validator' , name : ' commons-validator' , version : ' [1.4.0,1.99999)'
54
- compile group : ' commons-codec' , name : ' commons-codec' , version : ' [1.9,1.99999]'
55
- compile group : ' org.bitbucket.b_c' , name : ' jose4j' , version : ' [0.7,1.0)'
56
- // TODO: find out how to initialize these dependencies properly, or remove them
57
- // compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5'
58
- // compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.5'
59
- }
63
+ check. dependsOn jacocoTestReport
60
64
61
65
license {
62
66
header rootProject. file(' codequality/HEADER' )
@@ -68,77 +72,83 @@ artifacts {
68
72
}
69
73
70
74
ext. isReleaseVersion = hasProperty(' isReleaseVersion' ) ? isReleaseVersion : false
71
- signing {
72
- required { isReleaseVersion && gradle. taskGraph. hasTask(" uploadArchives" ) }
73
- sign configurations. archives
74
- }
75
-
76
75
ext. ossrhUsername = hasProperty(' ossrhUsername' ) ? ossrhUsername : ' dummyuser'
77
76
ext. ossrhPassword = hasProperty(' ossrhPassword' ) ? ossrhPassword : ' dummypass'
78
- uploadArchives {
79
- repositories {
80
- mavenDeployer {
81
- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
82
-
83
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2" ) {
84
- authentication(userName : ossrhUsername, password : ossrhPassword)
85
- }
86
-
87
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots" ) {
88
- authentication(userName : ossrhUsername, password : ossrhPassword)
89
- }
90
-
91
- pom. project {
92
- name ' OpenTok Java SDK'
93
- packaging ' jar'
94
- description ' The OpenTok Java SDK lets you generate sessions and tokens for OpenTok applications. This version of the SDK also includes support for working with OpenTok 2.0 archives.'
95
- url ' http://www.tokbox.com/opentok'
96
-
97
- scm {
98
- connection ' scm:git:https://github.com/opentok/Opentok-Java-SDK.git'
99
- developerConnection ' scm:git:https://github.com/opentok/Opentok-Java-SDK.git'
100
- url ' opentok.github.io/opentok-java-sdk'
101
- }
102
77
78
+ publishing {
79
+ publications {
80
+ mavenJava(MavenPublication ) {
81
+ from components. java
82
+ pom {
83
+ name = " OpenTok Java SDK"
84
+ artifactId = ' opentok-server-sdk'
85
+ packaging = ' jar'
86
+ description = " The OpenTok Java SDK lets you generate sessions and tokens for OpenTok applications. This version of the SDK also includes support for working with OpenTok 2.0 archives."
87
+ url = " https://github.com/opentok/opentok-java-sdk"
103
88
licenses {
104
89
license {
105
- name ' MIT License'
106
- url ' http ://www.opensource.org/licenses/mit-license '
90
+ name = ' MIT License'
91
+ url = " https ://raw.github.com/opentok/opentok-java-sdk/main/LICENCE.txt "
107
92
}
108
93
}
109
-
110
94
developers {
111
95
developer {
112
- id ' manasdpradhan'
113
- name ' Manas Pradhan'
114
- email ' manas@tokbox.com'
115
- organization ' Vonage.'
96
+ id = " devrel"
97
+ name = " Vonage Devrel"
98
+ email = " devrel@vonage.com"
99
+ }
100
+ developer {
101
+ id = ' manasdpradhan'
102
+ name = ' Manas Pradhan'
103
+ email = ' manas@tokbox.com'
104
+ organization = ' Vonage'
105
+ }
106
+ developer {
107
+ id = ' aoberoi'
108
+ name = ' Ankur Oberoi'
109
+ email = ' aoberoi@gmail.com'
110
+ organization = ' Vonage'
116
111
}
117
112
developer {
118
- id ' aoberoi '
119
- name ' Ankur Oberoi '
120
- email ' aoberoi@gmail .com'
121
- organization ' Vonage. '
113
+ id = ' slorello89 '
114
+ name = ' Steve Lorello '
115
+ email = ' steve.lorello@vonage .com'
116
+ organization = ' Vonage'
122
117
}
118
+ developer {
119
+ id = ' SMadani'
120
+ name = ' Sina Madani'
121
+ email = ' sina.madani@vonage.com'
122
+ organization = ' Vonage'
123
+ }
124
+ }
125
+ scm {
126
+ connection = " scm:git@github.com/opentok/opentok-java-sdk"
127
+ developerConnection = " scm:git@github.com/opentok/opentok-java-sdk"
128
+ url = " http://github.com/opentok/opentok-java-sdk"
129
+ }
130
+
131
+ issueManagement {
132
+ system = " GitHub"
133
+ url = " https://http://github.com/opentok/opentok-java-sdk"
123
134
}
124
135
}
125
136
}
126
137
}
127
- }
128
-
129
- test {
130
- maxHeapSize = " 1024m"
131
- }
132
-
133
- sourceCompatibility = 1.8
134
- // credit: http://stackoverflow.com/a/22681854/305340
135
- tasks. withType(JavaCompile ) {
136
- options. compilerArgs << " -Xlint:deprecation" << " -Xlint:unchecked"
137
- doFirst {
138
- if (System . env. JDK8_HOME != null ) {
139
- options. bootClasspath = " $System . env . JDK8_HOME /jre/lib/rt.jar"
140
- options. bootClasspath + = " $File . pathSeparator $System . env . JDK8_HOME /jre/lib/jce.jar"
141
- // and other specific JDK jars
138
+ repositories {
139
+ maven {
140
+ def releasesRepoUrl = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
141
+ def snapshotsRepoUrl = uri(" https://oss.sonatype.org/content/repositories/snapshots/" )
142
+ credentials. username(System . getenv(" OSS_USERNAME" ))
143
+ credentials. password(System . getenv(" OSS_PASSWORD" ))
144
+ url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
142
145
}
143
146
}
144
147
}
148
+
149
+ signing {
150
+ def signingKey = System . getenv(" signingKey" )
151
+ def signingPassword = System . getenv(" signingPassword" )
152
+ useInMemoryPgpKeys(signingKey, signingPassword)
153
+ sign publishing. publications. mavenJava
154
+ }
0 commit comments