forked from twitch4j/twitch4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.gradle
More file actions
162 lines (151 loc) · 3.71 KB
/
deployment.gradle
File metadata and controls
162 lines (151 loc) · 3.71 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
154
155
156
157
158
159
160
161
162
/**
* Artifact
*/
group = project.groupId
description = project.artifactDescription
version = project.artifactVersion
/**
* java version requirements
*/
sourceCompatibility = 1.8
targetCompatibility = 1.8
/**
* Testing
*/
test {
useJUnitPlatform {
includeTags 'unittest'
excludeTags 'integration'
}
}
/**
* Javadoc
*/
javadoc {
options {
title = "${project.artifactName} (v${project.version})"
windowTitle = "${project.artifactName} (v${project.version})"
encoding = "UTF-8"
}
if (JavaVersion.current() != JavaVersion.VERSION_1_8){
options.addBooleanOption('html5', true)
}
}
/**
* Sources - build a jar with source files
*/
task sourcesJar(type: Jar, dependsOn: classes, description: 'Builds the sourcesJar.', group: 'build') {
from sourceSets.main.allSource
baseName = baseName.toLowerCase()
classifier = 'sources'
}
// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc, description: 'Builds the javadocJar.', group: 'build') {
classifier = 'javadoc'
baseName = baseName.toLowerCase()
from javadoc.destinationDir
}
/**
* Artifacts
*/
artifacts {
archives sourcesJar
archives javadocJar
}
/**
* Deployment
*/
def pomConfig = {
licenses {
license {
name "MIT License"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
developers {
developer {
id "PhilippHeuer"
name "Philipp Heuer"
email "git@philippheuer.me"
}
}
scm {
url project.vcsUrl
}
}
publishing {
publications {
mainProject(MavenPublication) {
from project.components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId String.valueOf(project.artifactName).toLowerCase()
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', project.artifactDescription)
root.appendNode('name', String.valueOf(project.artifactName))
root.appendNode('url', String.valueOf(project.websiteUrl))
root.children().last() + pomConfig
}
}
}
}
/**
* Artifactory Upload
*/
artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-release-local'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_API_KEY")
}
defaults {
publications('mainProject')
publishArtifacts = true
publishPom = true
properties = [
'build.number': String.valueOf(System.getenv("CI_PIPELINE_IID")),
'build.name' : String.valueOf(project.artifactName).toLowerCase()
]
}
}
resolve {
repoKey = 'jcenter'
}
clientConfig.info.setBuildName(String.valueOf(project.name).toLowerCase())
clientConfig.info.setBuildNumber(String.valueOf(System.getenv("CI_PIPELINE_IID")))
}
/**
* Bintray Upload
*/
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
publications = ['mainProject']
dryRun = false
publish = true
override = false
pkg {
// jcenter repository namespace and name
userOrg = String.valueOf(project.artifactNamespace).toLowerCase()
repo = 'maven'
name = String.valueOf(project.artifactName).toLowerCase()
desc = project.description
licenses = ['MIT']
websiteUrl = project.websiteUrl
issueTrackerUrl = project.issueTrackerUrl
vcsUrl = project.vcsUrl
labels = []
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
released = new Date()
}
}
}