1
- buildscript {
2
- repositories {
3
- mavenCentral()
4
- }
5
- dependencies {
6
- classpath ' org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4 '
7
- classpath ' io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0 '
8
- }
1
+ plugins {
2
+ id ' application '
3
+ id ' com.github.johnrengelman.shadow ' version ' 4.0.2 '
4
+
5
+ // Used by release.gradle
6
+ id ' maven '
7
+ id ' signing '
8
+ id ' io.codearte.nexus-staging ' version ' 0.12.0 '
9
9
}
10
10
11
- plugins {
12
- id ' com.github.johnrengelman.shadow ' version ' 2.0.0 '
11
+ if (hasProperty( ' release ' )) {
12
+ apply from : ' release.gradle '
13
13
}
14
14
15
+ apply plugin : ' application'
16
+ apply plugin : ' com.github.johnrengelman.shadow'
17
+
15
18
group ' nl.martijndwars'
16
19
version ' 3.1.1'
17
20
18
- apply plugin : ' java'
19
- apply plugin : ' maven'
20
- apply plugin : ' signing'
21
- apply plugin : ' org.junit.platform.gradle.plugin'
22
- apply plugin : ' io.codearte.nexus-staging'
21
+ repositories {
22
+ mavenLocal()
23
+ mavenCentral()
24
+ }
25
+
26
+ dependencies {
27
+ // For CLI
28
+ compile group : ' com.beust' , name : ' jcommander' , version : ' 1.72'
29
+
30
+ // For parsing JSON
31
+ compile group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.0'
32
+
33
+ // For making async HTTP requests
34
+ compile group : ' org.apache.httpcomponents' , name : ' httpasyncclient' , version : ' 4.1.3'
35
+
36
+ // For cryptographic operations
37
+ compile group : ' org.bouncycastle' , name : ' bcprov-jdk15on' , version : ' 1.54'
23
38
24
- task wrapper (type : Wrapper ) {
25
- gradleVersion = ' 3.0'
39
+ // For creating and signing JWT
40
+ compile group : ' org.bitbucket.b_c' , name : ' jose4j' , version : ' 0.5.2'
41
+
42
+ // For making HTTP requests
43
+ testCompile group : ' org.apache.httpcomponents' , name : ' fluent-hc' , version : ' 4.5.2'
44
+
45
+ // For testing, obviously
46
+ testCompile group : ' org.junit.jupiter' , name : ' junit-jupiter-api' , version : ' 5.3.1'
47
+
48
+ // For running JUnit tests
49
+ testRuntime group : ' org.junit.jupiter' , name : ' junit-jupiter-engine' , version : ' 5.3.1'
50
+
51
+ // For turning InputStream to String
52
+ testCompile group : ' commons-io' , name : ' commons-io' , version : ' 2.5'
53
+
54
+ // For reading the demo vapid keypair from a pem file
55
+ testCompile group : ' org.bouncycastle' , name : ' bcpkix-jdk15on' , version : ' 1.55'
56
+
57
+ // For verifying Base64Encoder results in unit tests
58
+ testCompile group : ' com.google.guava' , name : ' guava' , version : ' 19.0'
59
+ }
60
+
61
+ wrapper {
62
+ gradleVersion = ' 4.10.2'
26
63
}
27
64
28
65
compileJava {
@@ -34,10 +71,7 @@ compileTestJava {
34
71
sourceCompatibility = 1.8
35
72
}
36
73
37
- jar {
38
- baseName = ' web-push'
39
- version = ' 3.1.1'
40
- }
74
+ mainClassName = ' nl.martijndwars.webpush.cli.Cli'
41
75
42
76
shadowJar {
43
77
// BouncyCastle JAR is signed; it cannot be extracted and merged into the fat JAR.
@@ -47,15 +81,15 @@ shadowJar {
47
81
)
48
82
}
49
83
manifest {
50
- attributes ' Main-Class' : ' nl.martijndwars.webpush.cli.Cli' ,
51
- ' Class-Path' : ' ../../lib/bcprov-jdk15on-154.jar'
84
+ attributes ' Class-Path' : ' ../../lib/bcprov-jdk15on-154.jar'
52
85
}
53
86
}
54
87
55
- junitPlatform {
56
- selectors {
57
- aClass ' nl.martijndwars.webpush.selenium.SeleniumTests'
58
- }
88
+ test {
89
+ useJUnitPlatform()
90
+
91
+ // TODO: Make the other test proper unit tests and remove this filter.
92
+ include ' **/SeleniumTests.class'
59
93
}
60
94
61
95
task javadocJar (type : Jar ) {
@@ -71,97 +105,3 @@ task sourcesJar(type: Jar) {
71
105
artifacts {
72
106
archives javadocJar, sourcesJar
73
107
}
74
-
75
- signing {
76
- sign configurations. archives
77
- }
78
-
79
- uploadArchives {
80
- repositories {
81
- mavenDeployer {
82
- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
83
-
84
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
85
- authentication(
86
- userName : project. hasProperty(' ossrhPassword' ) ? ossrhUsername : ' ' ,
87
- password : project. hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
88
- )
89
- }
90
-
91
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
92
- authentication(
93
- userName : project. hasProperty(' ossrhPassword' ) ? ossrhUsername : ' ' ,
94
- password : project. hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
95
- )
96
- }
97
-
98
- pom. project {
99
- name ' web-push'
100
- packaging ' jar'
101
- description ' A Web Push library for Java.'
102
- url ' https://github.com/web-push-libs/webpush-java'
103
-
104
- scm {
105
- connection
' scm:git:[email protected] :web-push-libs/webpush-java.git'
106
- developerConnection
' scm:git:[email protected] :web-push-libs/webpush-java.git'
107
- url
' [email protected] :web-push-libs/webpush-java.git'
108
- }
109
-
110
- licenses {
111
- license {
112
- name ' MIT License'
113
- url ' https://opensource.org/licenses/MIT'
114
- }
115
- }
116
-
117
- developers {
118
- developer {
119
- id ' martijndwars'
120
- name ' Martijn Dwars'
121
-
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- repositories {
130
- mavenLocal()
131
- mavenCentral()
132
- }
133
-
134
- dependencies {
135
- // For CLI
136
- compile group : ' com.beust' , name : ' jcommander' , version : ' 1.72'
137
-
138
- // For parsing JSON
139
- compile group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.0'
140
-
141
- // For making async HTTP requests
142
- compile group : ' org.apache.httpcomponents' , name : ' httpasyncclient' , version : ' 4.1.3'
143
-
144
- // For cryptographic operations
145
- compile group : ' org.bouncycastle' , name : ' bcprov-jdk15on' , version : ' 1.54'
146
-
147
- // For creating and signing JWT
148
- compile group : ' org.bitbucket.b_c' , name : ' jose4j' , version : ' 0.5.2'
149
-
150
- // For making HTTP requests
151
- testCompile group : ' org.apache.httpcomponents' , name : ' fluent-hc' , version : ' 4.5.2'
152
-
153
- // For testing, obviously
154
- testCompile group : ' org.junit.jupiter' , name : ' junit-jupiter-api' , version : ' 5.0.0-M4'
155
-
156
- // For running JUnit tests
157
- testRuntime group : ' org.junit.jupiter' , name : ' junit-jupiter-engine' , version : ' 5.0.0-M4'
158
-
159
- // For turning InputStream to String
160
- testCompile group : ' commons-io' , name : ' commons-io' , version : ' 2.5'
161
-
162
- // For reading the demo vapid keypair from a pem file
163
- testCompile group : ' org.bouncycastle' , name : ' bcpkix-jdk15on' , version : ' 1.55'
164
-
165
- // For verifying Base64Encoder results in unit tests
166
- testCompile group : ' com.google.guava' , name : ' guava' , version : ' 19.0'
167
- }
0 commit comments