-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathbuild.gradle
executable file
·146 lines (124 loc) · 4.46 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
plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'com.gradle.plugin-publish' version "1.2.2"
id 'maven-publish'
id 'idea'
id 'eclipse'
id 'org.ajoberstar.git-publish' version '4.2.2'
}
group = 'com.bmuschko'
gradlePlugin {
website = "https://github.com/bmuschko/gradle-clover-plugin"
vcsUrl = "https://github.com/bmuschko/gradle-clover-plugin"
description = 'Gradle Clover Plugin'
plugins {
gradleCloverPlugin {
id = 'com.bmuschko.clover'
implementationClass = 'com.bmuschko.gradle.clover.CloverPlugin'
displayName = 'Gradle Clover Plugin'
description = 'Gradle Clover Plugin'
tags.set(['clover', 'code_coverage'])
}
}
}
defaultTasks 'clean', 'build'
apply from: "gradle/release.gradle"
apply from: "gradle/integration-test.gradle"
apply from: "gradle/functional-test.gradle"
apply from: "gradle/additional-artifacts.gradle"
apply from: "gradle/publishing.gradle"
apply from: "gradle/documentation.gradle"
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(GroovyCompile).configureEach {
groovyOptions.encoding = 'UTF-8'
options.encoding = 'UTF-8'
}
tasks.withType(Test).configureEach {
testLogging {
events 'started', 'passed', 'failed', 'skipped'
}
}
repositories {
mavenCentral()
}
dependencies {
implementation localGroovy()
implementation gradleApi()
testImplementation gradleTestKit()
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
testImplementation 'junit:junit:4.13.2'
testRuntimeOnly 'junit:junit:4.13.2'
testImplementation 'commons-io:commons-io:2.5'
testRuntimeOnly 'commons-io:commons-io:2.16.1'
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testRuntimeOnly('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
}
ext.compatibilityVersion = '1.8'
java {
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
}
// Only add changing data to the manifest when publishing
gradle.taskGraph.whenReady { graph ->
if (graph.allTasks.any { task -> task instanceof PublishToMavenLocal || task instanceof PublishToMavenRepository }) {
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Clover plugin',
'Implementation-Version': version,
'Built-By': System.getProperty("user.name"),
'Built-Date': new Date(),
'Built-JDK': System.getProperty("java.version")
}
}
}
}
idea.project {
jdkName = '1.8'
languageLevel = compatibilityVersion
ipr.withXml { provider ->
def node = provider.asNode()
// Use GIT
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
// Set Gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir])
}
}
eclipse {
classpath {
// default settings for downloading sources and Javadoc:
downloadSources = true
downloadJavadoc = true
// This makes the Gradle paths and Eclipse paths align so
// that we have a working workspace from the start.
file {
whenMerged { classpath ->
classpath.entries.findAll { entry -> entry.kind == 'src' }.each { entry ->
switch(entry.path) {
case ~'src/main/groovy':
entry.output = "build/classes/groovy/main"
break
case ~'src/test/groovy':
entry.output = "build/classes/groovy/test"
break
}
}
def src = new org.gradle.plugins.ide.eclipse.model.SourceFolder("build/resources/main", null)
src.getEntryAttributes().put("gradle_scope", "main")
src.getEntryAttributes().put("gradle_used_by_scope", "main,test")
classpath.entries << src
classpath.entries.unique(true) {
(it instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency) ? it.path : it
}
}
}
}
}