forked from bintray/gradle-bintray-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
110 lines (94 loc) · 2.49 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
import org.gradle.api.publish.maven.MavenPublication
group = 'com.jfrog.bintray.gradle'
version = '0.5-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:0.4.1"
}
}
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'com.jfrog.bintray'
repositories {
jcenter()
}
dependencies {
compile gradleApi()
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2') {
exclude(module: 'groovy')
}
testCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude(module: 'groovy-all')
}
}
compileGroovy {
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
}
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
//jar.dependsOn sourcesJar
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "yoav"
name "Yoav Landman"
email "[email protected]"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'A gradle plugin for publishing to Bintray')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = has('bintrayUser') ? bintrayUser : 'USER'
key = has('bintrayKey') ? bintrayKey : 'KEY'
publications = ['mavenJava']
pkg {
repo = 'jfrog-jars'
userOrg = 'jfrog'
name = 'gradle-bintray-plugin'
licenses = ['Apache-2.0']
}
}
task install(dependsOn: 'publishMavenJavaPublicationToMavenLocal') << {
logger.info "Installing $project.name"
}
task wrapper(type: Wrapper, description: 'Gradle Wrapper task') {
gradleVersion = '2.0-rc-2'
}