-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
118 lines (103 loc) · 3.64 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
#!/usr/bin/env groovy
/*
* Build script for gradle-base-plugins
* Copyright © Basil Peace
*
* This file is part of gradle-base-plugins.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
id 'org.fidata.project.java'
id 'org.fidata.project.groovy'
id 'org.fidata.plugin'
}
description = 'Base plugins for Gradle projects and plugins developed by FIDATA'
tags.set(['defaults', 'opinions', 'opinionated', 'conventions', 'internal'])
//noinspection GroovyUnusedAssignment
license = 'LGPL-3.0-or-later'
//noinspection GroovyUnusedAssignment
contacts {
moniker 'Basil Peace'
github 'grv87'
roles 'owner', 'developer'
}
}
ext.rootDir = '.'
sourceSets {
main {
java.srcDirs new File(project.ext.rootDir, 'src/dependencyUtils/java')
groovy.srcDirs += [
new File(project.ext.rootDir, 'src/dependencyUtils/groovy'),
new File(project.ext.rootDir, 'src/pluginDependees/groovy'),
]
}
}
apply from: new File(ext.rootDir, 'gradle/dependencies-compile.gradle')
/*
* WORKAROUND:
* https://github.com/DanySK/javadoc.io-linker/issues/5
* `org.danilopianini.javadoc.io-linker` plugin doesn't work with `java-library` plugin
* <grv87 2018-06-23>
*/
afterEvaluate {
jvm.javadocLinks['org.spdx'] = uri("https://static.javadoc.io/org.spdx/spdx-tools/${ configurations.getByName('compileClasspath').resolvedConfiguration.firstLevelModuleDependencies.find { it.moduleGroup == 'org.spdx' && it.moduleName == 'spdx-tools' }.moduleVersion }/index.html?")
}
apply from: new File(ext.rootDir, 'gradle/gradle-plugin-markers.gradle')
dependencies {
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '[1, 2['
}
sourceSets {
testFixtures {
java.srcDirs = ['src/testFixtures/java']
groovy.srcDirs = ['src/testFixtures/groovy']
}
}
dependencies {
testFixturesImplementation localGroovy()
testFixturesImplementation gradleApi()
testFixturesImplementation gradleTestKit()
functionalTestImplementation sourceSets.testFixtures.output
compatTestImplementation sourceSets.testFixtures.output
}
import static org.fidata.gradle.ProjectPlugin.GRADLE_MINIMUM_SUPPORTED_VERSION
stutter {
java(8) {
compatibleRange GRADLE_MINIMUM_SUPPORTED_VERSION
}
java(9) {
compatibleRange GRADLE_MINIMUM_SUPPORTED_VERSION
}
}
/*
* TOTEST:
* Looks like there is no built-in way to get collection of TaskProvider.
* This is workaround, but it could trigger creation of tasks
* <grv87 2018-08-23>
*/
project.tasks.withType(Test).matching { Test test -> test.name =~ org.fidata.gradle.GradlePluginPlugin.COMPAT_TEST_TASK_NAME_PATTERN }.configureEach {
systemProperty 'org.fidata.compatTest.artifactoryUser', artifactoryUser
systemProperty 'org.fidata.compatTest.artifactoryPassword', artifactoryPassword
}
tasks.named('codenarcBuildSrc').configure {
disabledRules.add 'DuplicateNumberLiteral'
}
tasks.register('codenarcMainResources', CodeNarc) {
for (File srcDir in sourceSets.main.resources.srcDirs) {
source fileTree(dir: srcDir, includes: ['**/*.groovy'])
}
}
publicReleases = false