-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbuild.gradle
148 lines (123 loc) · 3.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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.10.1"
}
}
plugins {
id "com.jfrog.bintray" version "1.0"
}
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'groovy'
group = 'com.github.maiflai'
description = 'gradle-scalatest is a Gradle plugin for executing scalatest tests'
ext {
websiteUrl = 'https://github.com/maiflai/gradle-scalatest'
sourceUrl = 'https://github.com/maiflai/gradle-scalatest.git'
}
targetCompatibility = '1.6'
repositories {
mavenCentral()
}
dependencies {
compile gradleApi()
compile localGroovy()
testCompile 'junit:junit:4.12'
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
from "$buildDir/docs/groovydoc"
archiveClassifier = 'groovydoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
test.dependsOn(jar)
artifacts {
archives groovydocJar
archives sourcesJar
}
signing {
sign configurations.archives
}
if (project.version == 'unspecified') {
version = '0.1-SNAPSHOT'
project.signArchives.enabled = false
}
task showVersion() { doLast { println(project.version) } }
def propOrDefault(String property) {
if (project.hasProperty(property)) {
return project.getProperty(property)
} else {
return ''
}
}
pluginBundle {
website = project.websiteUrl
vcsUrl = project.sourceUrl
description = project.description
tags = ['testing', 'scala', 'scalatest']
plugins {
scalatestPlugin {
id = 'com.github.maiflai.scalatest'
displayName = 'Gradle ScalaTest plugin'
}
}
}
bintray {
user = propOrDefault('bintrayUsername')
key = propOrDefault('bintrayApiKey')
configurations = ['archives']
dryRun = false
publish = false
pkg {
repo = 'maven'
name = project.name
desc = project.description
websiteUrl = project.websiteUrl
issueTrackerUrl = 'https://github.com/maiflai/gradle-scalatest/issues'
vcsUrl = project.sourceUrl
licenses = ['unlicense']
labels = ['gradle', 'testing', 'scala']
publicDownloadNumbers = true
version {
attributes = ['gradle-plugin': 'com.github.maiflai.scalatest:com.github.maiflai:gradle-scalatest']
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: propOrDefault('sonatypeUsername'), password: propOrDefault('sonatypePassword'))
}
pom.project {
name project.name
description project.description
url project.websiteUrl
scm {
url "scm:git:${project.sourceUrl}"
}
licenses {
license {
name 'unlicense'
url 'http://unlicense.org'
distribution 'repo'
}
}
developers {
developer {
id 'maiflai'
}
}
}
}
}
}