-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
134 lines (113 loc) · 3.33 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
/*
* Copyright 2014. Binh Nguyen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.gradle.plugin-publish' version "0.11.0"
id 'org.jetbrains.gradle.plugin.idea-ext' version "0.4.2"
}
version = '3.5.0'
group = 'com.github.alisiikh'
ext {
scalaLangVersion = '2.12'
}
wrapper {
gradleVersion = '6.9.4'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
projectGithub = 'https://github.com/alisiikh/gradle-scalastyle-plugin'
pluginId = 'com.github.alisiikh.scalastyle'
pluginDescription = 'Gradle plugin for scalastyle'
}
repositories {
jcenter()
}
dependencies {
implementation gradleApi()
implementation localGroovy()
testImplementation gradleTestKit()
testImplementation('org.spockframework:spock-core:1.3-groovy-2.5') {
exclude module: 'groovy-all'
}
testImplementation 'commons-io:commons-io:2.6'
}
sourceSets {
functionalTest {
java.srcDir file('src/functionalTest/java')
groovy.srcDir file('src/functionalTest/groovy')
resources.srcDir file('src/functionalTest/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
}
task functionalTest(type: Test) {
description = 'Runs the functional tests.'
group = 'verification'
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
testLogging {
showStandardStreams = true
}
mustRunAfter test
}
check.dependsOn functionalTest
gradlePlugin {
testSourceSets sourceSets.functionalTest
}
publishing {
publications {
plugin(MavenPublication) {
from components.java
}
}
}
pluginBundle {
mavenCoordinates {
groupId = project.group
}
website = projectGithub
vcsUrl = projectGithub
description = pluginDescription
tags = ['scalastyle', 'scala', 'code analysis', 'checkstyle']
}
gradlePlugin {
plugins {
scalastyle {
id = pluginId
implementationClass = 'com.github.alisiikh.scalastyle.ScalastylePlugin'
displayName = pluginDescription
}
}
}
task fixIdeaPluginClasspath {
doFirst {
configure(tasks.pluginUnderTestMetadata) {
def ideaClassesPath = project.buildDir.toPath().resolveSibling("out").resolve("production")
def newClasspath = pluginClasspath as List
newClasspath.add(0, ideaClassesPath)
pluginClasspath.setFrom(newClasspath)
}
}
}
pluginUnderTestMetadata.mustRunAfter(fixIdeaPluginClasspath)
idea.project.settings {
taskTriggers {
beforeBuild(fixIdeaPluginClasspath, pluginUnderTestMetadata)
}
}