-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
150 lines (127 loc) · 3.15 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
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${bintrayPluginVersion}"
classpath "com.gradle.publish:plugin-publish-plugin:${publishPluginVersion}"
}
}
repositories {
jcenter()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
group = 'com.github.missedone'
version = projectVersion
apply plugin: 'groovy'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven'
apply plugin: "com.gradle.plugin-publish"
targetCompatibility = "1.7"
sourceCompatibility = "1.7"
jar {
// include license into jar
into 'META-INF', {
from 'LICENSE'
}
}
dependencies {
compile gradleApi()
compile localGroovy()
compile "com.jfrog.bintray.gradle:gradle-bintray-plugin:${bintrayPluginVersion}"
compile("org.codehaus.groovy.modules.http-builder:http-builder:${httpBuilderVersion}") {
exclude(module: 'groovy')
}
// override the httpclient version to be consistent with 'gradle-download-task'
runtime 'org.apache.httpcomponents:httpclient:4.5.2'
}
// package source into a jar file
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// define artifacts for upload
artifacts {
archives jar
archives packageSources
}
def configurePom(def pom) {
// ensure correct artifact ID
pom.artifactId = 'gradle-bintray-p2-plugin'
// pom file details
pom.project {
name pluginName
packaging 'jar'
description pluginDesc
url projectUrl
scm {
url "scm:git:${projectUrl}.git"
connection "scm:git:${projectUrl}.git"
developerConnection "scm:git:${projectUrl}.git"
}
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 'missedone'
name 'Nick Tan'
email 'missedone@gmail.com'
}
}
}
}
install {
repositories.mavenInstaller {
// ensure correct artifact ID when installing locally
configurePom(pom)
}
}
bintray { // task bintrayUpload
user =System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
// Whether to run this as dry-run, without deploying
dryRun = false
// Whether version should be auto published after an upload
publish = !project.version.endsWith('-SNAPSHOT')
pkg {
def githubUrl = projectUrl
repo = 'gradle-plugins'
name = pluginName
desc = pluginDesc
websiteUrl = githubUrl
issueTrackerUrl = "$githubUrl/issues"
vcsUrl = "${githubUrl}.git"
licenses = ['Apache-2.0']
labels = ['gradle', 'p2', 'eclipse']
publicDownloadNumbers = true
// version descriptor
version {
name = project.version
released = new Date()
attributes = ['gradle-plugin': "com.github.missedone:${project.group}:gradle-bintray-p2-plugin"]
}
}
}
pluginBundle {
website = projectUrl
vcsUrl = projectUrl
description = pluginDesc
tags = ['p2', 'eclipse']
plugins {
greetingsPlugin {
id = 'com.github.missedone.bintray-p2'
displayName = 'Gradle Bintray P2 plugin'
}
}
}