-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
186 lines (157 loc) · 4.45 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
classpath 'org.standardout:gradle-eclipseconfig:1.1.0'
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.standardout.eclipseconfig' // applies 'eclipse' plugin automatically
repositories {
mavenCentral()
}
group = 'org.standardout'
version = '1.6.0-SNAPSHOT'
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
jar {
// include license into jar
into 'META-INF', {
from 'LICENSE'
}
}
dependencies {
compile gradleApi()
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1', {
// Only needed for HTML parsing
exclude group: 'net.sourceforge.nekohtml', module: 'nekohtml'
// Add this dependency if you are using OAuth in HTTPBuilder or RESTClient
exclude group: 'oauth.signpost', module: 'signpost-commonshttp4'
// Add this dependency if you are using OAuth in HttpURLClient
exclude group: 'oauth.signpost', module: 'signpost-core'
// try to do without
exclude group: 'com.google.appengine'
exclude group: 'xerces', module: 'xercesImpl'
}
compile 'org.apache.httpcomponents:httpmime:4.5.2'
compile localGroovy()
}
task wrapper(type: Wrapper) {
gradleVersion = '4.0.1'
}
// package groovydoc into a jar file
task packageJavadoc(type: Jar, dependsOn: 'groovydoc') {
from groovydoc.destinationDir
classifier = 'javadoc'
}
// package source into a jar file
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// define artifacts for upload
artifacts {
archives jar
archives packageJavadoc
archives packageSources
}
def configurePom(def pom) {
// ensure correct artifact ID
pom.artifactId = 'gradle-versioneye-plugin'
// pom file details
pom.project {
name 'gradle-versioneye-plugin'
packaging 'jar'
description 'Check your Gradle project dependencies with www.versioneye.com'
url 'https://github.com/stempler/gradle-versioneye-plugin'
scm {
url 'scm:git:https://github.com/stempler/gradle-versioneye-plugin.git'
connection 'scm:git:https://github.com/stempler/gradle-versioneye-plugin.git'
developerConnection 'scm:git:https://github.com/stempler/gradle-versioneye-plugin.git'
}
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'stempler'
name 'Simon Templer'
email '[email protected]'
}
}
}
}
install {
repositories.mavenInstaller {
// ensure correct artifact ID when installing locally
configurePom(pom)
}
}
// sign all artifacts
signing {
required { gradle.taskGraph.hasTask(uploadArchives) }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
// sign artifacts before upload
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// upload to sonatype OSS (snapshot/release)
repository(url: this.version.endsWith('-SNAPSHOT') ?
'https://oss.sonatype.org/content/repositories/snapshots' :
'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: this.hasProperty('sonatypeUsername') ? sonatypeUsername : '',
password: this.hasProperty('sonatypePassword') ? sonatypePassword : '')
}
configurePom(pom)
}
}
}
// groovydoc task work-around
configurations {
jansi.extendsFrom(runtime)
}
groovydoc {
groovyClasspath = project.configurations.jansi
}
dependencies {
jansi 'org.fusesource.jansi:jansi:1.11'
}
// bintray
bintray { // task bintrayUpload
user = project.getProperty('bintrayUser')
key = project.getProperty('bintrayApiKey')
configurations = ['archives']
dryRun = false
publish = !project.version.endsWith('-SNAPSHOT')
pkg {
def githubUrl = 'https://github.com/stempler/gradle-versioneye-plugin'
repo = 'gradle-plugins'
name = 'gradle-versioneye-plugin'
desc = 'Plugin for Gradle to update your project\'s dependencies status on http://www.versioneye.com'
websiteUrl = githubUrl
issueTrackerUrl = "$githubUrl/issues"
vcsUrl = "${githubUrl}.git"
licenses = ['MIT']
labels = ['gradle', 'versioneye', 'dependencies']
publicDownloadNumbers = true
// version descriptor
version {
name = project.version
attributes = ['gradle-plugin': "org.standardout.versioneye:${project.group}:gradle-versioneye-plugin"]
}
}
}