forked from reportportal/client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.gradle
76 lines (64 loc) · 2.01 KB
/
release.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
apply plugin: 'maven'
apply plugin: 'maven-publish'
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
javadoc() {
failOnError = false
}
artifacts {
archives sourcesJar
archives javadocJar
archives shadowJar
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
}
project.ext.githubUserName = project.hasProperty('githubUserName') ? githubUserName : ""
project.ext.githubToken = project.hasProperty('githubToken') ? githubToken : ""
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
groupId 'com.epam.reportportal'
artifactId "$project.name"
pom.withXml {
def root = asNode()
root.dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.shadow.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
root.children().last() + pomConfig
}
artifact project.tasks.javadocJar
artifact project.tasks.sourcesJar
}
}
repositories {
maven {
name = "Client GitHub Packages"
url = uri("https://maven.pkg.github.com/reportportal/client-java")
credentials {
username = githubUserName
password = githubToken
}
}
}
}
def releaseDependencies = [publish]
releaseDependencies.addAll(afterReleaseBuild.getDependsOn())
afterReleaseBuild.setDependsOn(releaseDependencies)