forked from diffplug/spotless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (89 loc) · 2.74 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
apply from: rootProject.file('gradle/changelog.gradle')
ext.artifactId = project.artifactIdGradle
version = spotlessChangelog.versionNext
apply from: rootProject.file('gradle/java-setup.gradle')
apply from: rootProject.file('gradle/spotless-freshmark.gradle')
apply plugin: 'java-library'
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'java-gradle-plugin'
dependencies {
if (version.endsWith('-SNAPSHOT')) {
api project(':lib')
api project(':lib-extra')
} else {
api "com.diffplug.spotless:spotless-lib:${rootProject.spotlessChangelog.versionLast}"
api "com.diffplug.spotless:spotless-lib-extra:${rootProject.spotlessChangelog.versionLast}"
}
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
implementation "org.eclipse.jgit:org.eclipse.jgit:${VER_JGIT}"
testImplementation project(':testlib')
testImplementation "junit:junit:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}
test { testLogging.showStandardStreams = true }
apply from: rootProject.file('gradle/special-tests.gradle')
// make it easy for eclipse to run against latest build
tasks.eclipse.dependsOn(pluginUnderTestMetadata)
//////////////////////////
// GRADLE PLUGIN PORTAL //
//////////////////////////
gradlePlugin {
plugins {
spotlessPlugin {
id = 'com.diffplug.spotless'
implementationClass = 'com.diffplug.gradle.spotless.SpotlessPlugin'
displayName = 'Spotless formatting plugin'
description = project.description
}
spotlessPluginLegacy {
id = 'com.diffplug.gradle.spotless'
implementationClass = 'com.diffplug.gradle.spotless.SpotlessPluginRedirect'
displayName = 'Spotless formatting plugin (legacy)'
description = project.description
}
}
}
if (version.endsWith('-SNAPSHOT')) {
publishPlugins.enabled = false
} else {
pluginBundle {
// These settings are set for the whole plugin bundle
website = "https://github.com/diffplug/spotless"
vcsUrl = "https://github.com/diffplug/spotless"
tags = [
'format',
'style',
'license',
'header',
'google-java-format',
'eclipse',
'ktlint',
'ktfmt',
'diktat',
'tsfmt',
'prettier',
'scalafmt',
'scalafix',
'black',
'clang-format'
]
plugins {
spotlessPlugin {
id = 'com.diffplug.spotless'
}
spotlessPluginLegacy {
id = 'com.diffplug.gradle.spotless'
}
}
mavenCoordinates {
groupId = project.group
artifactId = project.artifactIdGradle
version = project.version
}
}
}
// have to apply java-publish after setting up the pluginBundle
apply from: rootProject.file('gradle/java-publish.gradle')