-
Notifications
You must be signed in to change notification settings - Fork 88
/
build.gradle
117 lines (99 loc) · 2.95 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
plugins {
id 'signing'
id('io.github.gradle-nexus.publish-plugin') version '2.0.0'
}
apply plugin: 'java'
apply plugin: 'maven-publish'
group 'io.tus.java.client'
allprojects {
repositories {
mavenCentral()
}
}
// We compile the library using Java 1.7 compatibility
// in order to ensure interoperability with older Android platforms.
sourceCompatibility = 1.8
targetCompatibility = 1.8
// load version number from file
def config = new ConfigSlurper().parse(new File("${projectDir}/src/main/resources/tus-java-client-version/version.properties").toURI().toURL())
version = config.versionNumber
dependencies {
implementation 'org.jetbrains:annotations:26.0.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mock-server:mockserver-junit-rule:5.15.0'
testImplementation 'org.mockito:mockito-core:5.14.2'
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
def pomConfig = {
name 'tus-java-client'
url 'https://tus.io'
scm {
url 'https://github.com/tus/tus-java-client'
connection 'https://github.com/tus/tus-java-client'
developerConnection 'https://github.com/tus/tus-java-client'
}
developers {
developer {
id 'acconut'
name 'Marius Kleidl'
email 'maerious@gmail.com'
}
developer {
id 'cdr-chakotay'
name 'Florian Kuenzig'
email 'florian@transloadit.com'
}
}
inceptionYear '2015'
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = 'io.tus.java.client'
artifactId = 'tus-java-client'
version project.getVersion()
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'Java client for tus, the resumable file uploading protocol.')
root.children().last() + pomConfig
}
}
}
}
signing {
def signingKeyId = System.getenv("SIGNING_KEY_ID")
def signingPassword = System.getenv("SIGNING_KEY_PASSWORD")
def signingKey = System.getenv("SIGNING_KEY_AMORED")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv("SONATYPE_USER")
password = System.getenv("SONATYPE_KEY")
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE')
}
}
}