/
build.gradle
108 lines (89 loc) · 2.55 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
plugins {
id 'idea'
id 'groovy'
id 'java-gradle-plugin'
id 'jacoco'
id 'com.gradle.build-scan' version '2.4.2'
id 'com.gradle.plugin-publish' version '0.10.1'
}
ext {
junit5Version = '5.5.2'
}
group "net.madeng.slack"
version '0.0.24-SNAPSHOT'
sourceCompatibility = 1.8
pluginBundle {
website = 'https://github.com/jongyoul/gradle-slack-plugin'
vcsUrl = 'https://github.com/jongyoul/gradle-slack-plugin'
description = 'Slack plugin for gradle'
tags = ['slack']
// To prevent from adding the prefix of 'gradle.plugin' in front of groupId
/*mavenCoordinates {
groupId = "${project.group}"
artifactId = "${rootProject.name}"
version = "${project.version}"
}*/
}
gradlePlugin {
plugins {
slackPlugin {
id = 'net.madeng.slack'
displayName = 'Slack Plugin'
description = 'Send a message to slack easily'
implementationClass = 'net.madeng.slack.SlackPlugin'
}
}
}
repositories {
mavenCentral()
}
// For testing
// Write the plugin's classpath to a file to share with the tests
task createClasspathManifest {
def outputDir = file("$buildDir/$name")
inputs.files(sourceSets.main.runtimeClasspath)
.withPropertyName("runtimeClasspath")
.withNormalizer(ClasspathNormalizer)
outputs.dir(outputDir)
.withPropertyName("outputDir")
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n")
}
}
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
compile 'org.apache.httpcomponents:httpclient:4.5.3'
testImplementation gradleTestKit()
testImplementation("org.spockframework:spock-core:1.3-groovy-2.4") {
exclude module: 'groovy-all'
}
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit5Version}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit5Version}"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit5Version}"
// Add the classpath file to the test runtime classpath
testRuntimeOnly files(createClasspathManifest)
}
test {
environment(
"PLUGIN_ID": "${project.group}",
"PLUGIN_ARTIFACT": "${rootProject.name}",
"PLUGIN_PROPERTIES_FILE": "${System.getProperty('user.home')}/.slack/publish.properties"
)
useJUnitPlatform()
testLogging {
events "PASSED", "FAILED", "SKIPPED"
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
publishAlways()
}