-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.gradle
134 lines (119 loc) · 3.65 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
plugins {
id "groovy"
id "maven-publish"
id "com.jfrog.bintray" version "1.3.1"
}
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
version = "0.11-SNAPSHOT"
group = "com.monochromeroad.gradle-plugins"
targetCompatibility = 1.6
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
compile gradleApi()
compile "net.java.dev.jets3t:jets3t:0.9.4"
testCompile("org.spockframework:spock-core:1.0-groovy-2.4") {
exclude group: 'org.codehaus.groovy'
}
}
groovydoc {
link("https://jets3t.s3.amazonaws.com/api/", "org.jets3t.")
link("http://www.gradle.org/docs/current/javadoc/", "org.gradle.")
link("http://docs.oracle.com/javase/1.7.0/docs/api/", "java.")
groovyClasspath = configurations.compile
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = "sources"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from('docs') {
rename('no-java-source', "README")
}
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'groovydoc'
from 'build/docs/groovydoc'
}
jar.dependsOn sourcesJar, javadocJar, groovydocJar
final pomConfig = {
packaging "jar"
name "Gradle Amazon S3 Sync Plugin"
url "https://github.com/literalice/gradle-aws-s3-sync"
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
scm {
url "https://github.com/literalice/gradle-aws-s3-sync"
connection "https://github.com/literalice/gradle-aws-s3-sync"
}
developers {
developer {
id "literalice"
name "Masatoshi Hayashi"
email "[email protected]"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact groovydocJar
pom.withXml {
final root = asNode()
root.appendNode('description', 'The gradle task for synchronizing a local directory with a AWS S3 bucket.')
root.children().last() + pomConfig
}
}
}
}
ext {
bintrayUser = findProperty("bintrayUser") ?: ""
bintrayKey = findProperty("bintrayKey") ?: ""
}
bintray {
user = bintrayUser
key = bintrayKey
publications = ["mavenJava"]
pkg {
repo = "maven"
name = "gradle-aws-s3-sync"
desc = "The gradle task for synchronizing a local directory with a AWS S3 bucket."
licenses = ["Apache-2.0"]
labels = ["gradle", "aws", "s3"]
version {
attributes = [ 'gradle-plugin': "com.monochromeroad.s3sync:${project.group}:${project.name}" ]
}
}
}
task bintraySign {
description "Signs the files of the artifact on bintray site."
}
bintraySign.doLast {
final http = new HTTPBuilder(bintray.apiUrl)
http.headers.Authorization = "Basic ${"$bintrayUser:$bintrayKey".toString().bytes.encodeBase64()}"
http.request(POST, JSON) {
uri.path = "/gpg/${bintrayUser}/${bintray.pkg.repo}/${bintray.pkg.name}/versions/${project.version}"
body = [passphrase: bintraySignPassphrase]
response.success = { resp ->
logger.info("Signed version ${project.version}.")
}
response.failure = { resp ->
logger.error("Could not sign version ${project.version}: $resp.statusLine")
}
}
}