-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
138 lines (111 loc) · 3.27 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
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'jacoco'
id "pl.droidsonroids.jacoco.testkit" version "1.0.9"
id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.1.0'
id 'com.palantir.git-version' version '0.15.0'
id "com.diffplug.spotless" version "6.11.0"
}
version = "${gitVersion()}".replaceFirst(~/^v/, '')
spotless {
groovy {
importOrder() // standard import order
excludeJava()
greclipse()
licenseHeaderFile file("license-header.spotless") // or licenseHeaderFile
}
groovyGradle {
target '*.gradle' // default target of groovyGradle
greclipse()
}
}
repositories {
mavenCentral()
}
task createClasspathManifest {
def outputDir = file("${buildDir}/${name}")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("${outputDir}/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n")
}
}
dependencies {
testImplementation 'org.spockframework:spock-core:2.1-groovy-2.5'
testImplementation platform('org.junit:junit-bom:5.9.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation "org.assertj:assertj-core:3.24.2"
testImplementation "org.apache.commons:commons-text:1.10.0"
testImplementation files(createClasspathManifest)
}
jacoco {
toolVersion = "0.8.9"
}
jacocoTestReport {
reports.html.enabled = true
executionData.setFrom fileTree(buildDir).include("/jacoco/*.exec")
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
gradlePlugin {
plugins {
gitlabRepositories {
id = 'at.schrottner.gitlab-repositories'
implementationClass = 'at.schrottner.gradle.GitlabRepositoriesPlugin'
displayName = 'GitLab-Repositories'
description = 'Handling Maven GitLab dependencies easy. Define multiple tokens and selectively apply them to repositories.'
}
}
}
pluginBundle {
website = 'http://schrottner.at/gradle-gitlab-repositories/'
vcsUrl = 'https://github.com/aepfli/gradle-gitlab-repositories.git'
tags = [
'GitLab',
'repositories',
'maven'
]
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
sourceSets {
functionalTest {
}
}
gradlePlugin.testSourceSets(sourceSets.functionalTest)
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)
configurations.functionalTestRuntimeOnly.extendsFrom(configurations.testRuntimeOnly)
task functionalTest(type: Test) {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
description = 'Runs the functional tests.'
group = 'verification'
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
}
functionalTest.dependsOn generateJacocoTestKitProperties
generateJacocoTestKitProperties.destinationFile = "$buildDir.absolutePath/jacoco/functional.exec"
check {
// Run the functional tests as part of `check`
dependsOn(tasks.functionalTest)
}
publishing.publications.all {
pom {
scm {
connection = 'scm:git:https://github.com/aepfli/gradle-gitlab-repositories.git'
developerConnection = 'ssh://[email protected]:aepfli/gradle-gitlab-repositories.git'
url = 'https://github.com/aepfli/gradle-gitlab-repositories'
}
}
}