This repository was archived by the owner on Aug 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpublish.gradle
106 lines (89 loc) · 4.13 KB
/
publish.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
// Copyright (c) 2014 Project Iris. All rights reserved.
//
// The current language binding is an official support library of the Iris
// cloud messaging framework, and as such, the same licensing terms apply.
// For details please see http://iris.karalabe.com/downloads#License
apply from: 'build.gradle'
apply plugin: 'maven'
apply plugin: 'signing'
// Make sure dependent properties are configured
def validProperty = { String propertyName ->
try { project.property(propertyName) != null }
catch (MissingPropertyException ignore) { false }
}
assert validProperty('signing.keyId'), 'property for signing must be provided'
assert validProperty('signing.secretKeyRingFile'), 'property for signing must be provided'
assert validProperty('ossrhUsername'), 'property for publish must be provided'
// Ask for the PGP key password and the OSSRK user password
ext."signing.password" = new String(System.console().readPassword("\nPassword for PGP key ${property('signing.keyId')}: "))
ext.ossrhPassword = new String(System.console().readPassword("\nPassword for OSSRH user ${ossrhUsername}@oss.sonatype.org: "))
// Define a few more archives for publishing
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
// Sign all defined JAR archives in this configuration
signing {
sign configurations.archives
}
// Define the artifacts to assemble
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
// Configure the Maven Central upload task
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Iris: Decentralized cloud messaging'
packaging 'jar'
description 'Iris is an attempt at bringing the simplicity and elegance of cloud \
computing to the application layer. Consumer clouds provide unlimited virtual \
machines at the click of a button, but leaves it to developer to wire them \
together. Iris ensures that you can forget about networking challenges and \
instead focus on solving your own domain problems.\
\
It is a completely decentralized messaging solution for simplifying the design \
and implementation of cloud services. Among others, Iris features zero-configuration \
(i.e. start it up and it will do its magic), semantic addressing (i.e. application \
use textual names to address each other), clusters as units (i.e. automatic load \
balancing between apps of the same name) and perfect secrecy (i.e. all network traffic \
is encrypted).'
url 'http://iris.karalabe.com/'
scm {
url 'https://github.com/project-iris/iris-java'
connection 'scm:git:git://github.com/project-iris/iris-java.git'
developerConnection 'scm:git:[email protected]:project-iris/iris-java.git'
}
licenses {
license {
name 'GNU General Public License, Version 3'
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
id 'karalabe'
name 'Péter Szilágyi'
email '[email protected]'
}
}
}
}
}
}
// Don't require remembering the tasks, just run the publishing
defaultTasks 'clean', 'uploadArchives'