forked from selenide/selenide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.gradle
85 lines (73 loc) · 2.77 KB
/
deploy.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
buildscript {
repositories { jcenter() }
dependencies {
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.4'
classpath 'de.undercouch:gradle-download-task:2.0.0'
}
}
apply from: 'build.gradle'
apply plugin: 'signing'
defaultTasks 'clean', 'check', 'allTests', 'install', 'uploadArchives'
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: project.version.endsWith("-SNAPSHOT") ?
'https://oss.sonatype.org/content/repositories/snapshots/' :
'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: "$sonatypeUsername", password: "$sonatypePassword")
}
pom.project {
name archivesBaseName
packaging 'jar'
description 'Selenide = concise API for Selenium WebDriver'
url 'https://github.com/codeborne/selenide'
scm {
url 'scm:[email protected]:codeborne/selenide.git'
connection 'scm:[email protected]:codeborne/selenide.git'
developerConnection 'scm:[email protected]:codeborne/selenide.git'
}
licenses {
license {
name 'MIT'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'asolntsev'
name 'Andrei Solntsev'
}
developer {
id 'vadger'
name 'Vadim Gerasimov'
}
developer {
id 'vinogradoff'
name 'Aleksei Vinogradov'
}
developer {
id 'angryziber'
name 'Anton Keks'
}
}
}
//mess with the generated pom to set the 'packaging' tag
pom.withXml { XmlProvider xmlProvider ->
def xml = xmlProvider.asString()
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes))
pomXml.version[0] + { packaging('jar') }
def newXml = new StringWriter()
def printer = new XmlNodePrinter(new PrintWriter(newXml))
printer.preserveWhitespace = true
printer.print(pomXml)
xml.setLength(0)
xml.append(newXml.toString())
}
}
}
}