forked from web-push-libs/webpush-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
153 lines (123 loc) · 4.39 KB
/
Copy pathbuild.gradle
File metadata and controls
153 lines (123 loc) · 4.39 KB
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
plugins {
id 'application'
id 'java-library'
id 'com.github.johnrengelman.shadow' version '7.1.1'
// Used by JitPack and release.gradle
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' apply false
}
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
// JitPack provides GROUP, ARTIFACT and VERSION while building a tag.
// Keep the historical Maven Central coordinates everywhere else.
group = System.getenv('GROUP') ?: 'nl.martijndwars'
version = System.getenv('VERSION') ?: findProperty('releaseVersion') ?: '5.2.1'
def publishedArtifactId = System.getenv('ARTIFACT') ?: 'web-push'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// For CLI
api group: 'com.beust', name: 'jcommander', version: '1.81'
// For making HTTP requests
api group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.5'
// For making async HTTP requests
api group: 'org.asynchttpclient', name: 'async-http-client', version: '2.12.4'
// For cryptographic operations
shadow group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70'
// For creating and signing JWT
api group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.9.6'
// For parsing JSON
testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
// For making HTTP requests
testImplementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.13'
// For testing, obviously
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
// For running JUnit tests
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
// For turning InputStream to String
testImplementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
// For reading the demo vapid keypair from a pem file
testImplementation group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.70'
// For verifying Base64Encoder results in unit tests
testImplementation group: 'com.google.guava', name: 'guava', version: '33.4.8-jre'
}
wrapper {
gradleVersion = '7.2'
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
}
mainClassName = 'nl.martijndwars.webpush.cli.Cli'
run {
classpath configurations.shadow.files
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
showStandardStreams true
exceptionFormat 'full'
}
exclude '**/SeleniumTests.class'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar
archives sourcesJar
}
// JitPack invokes `build publishToMavenLocal` for Gradle projects using
// maven-publish. Its environment variables make the published coordinates:
// com.github.<owner>:<repository>:<tag>.
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group.toString()
artifactId = publishedArtifactId
version = project.version.toString()
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'web-push'
description = 'A Web Push library for Java.'
url = 'https://github.com/p4535992/webpush-java'
scm {
connection = 'scm:git:https://github.com/p4535992/webpush-java.git'
developerConnection = 'scm:git:https://github.com/p4535992/webpush-java.git'
url = 'https://github.com/p4535992/webpush-java'
}
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'martijndwars'
name = 'Martijn Dwars'
email = 'ikben@martijndwars.nl'
}
}
}
}
}
}
if (hasProperty('release')) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: 'release.gradle'
}