-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
96 lines (82 loc) · 2.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
plugins {
id 'java-gradle-plugin'
id 'jacoco'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'java'
id 'checkstyle'
}
group 'com.bisnode.opa'
version '0.4.2'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
tasks.register('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 {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.16.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.0'
implementation 'com.bisnode.opa:opa-test-result-formatter:0.1.2'
testImplementation gradleTestKit()
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testImplementation 'org.apiguardian:apiguardian-api:1.1.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly files(createClasspathManifest)
}
sourceSets {
functionalTest {
java.srcDir file('src/testFunctional/java')
resources.srcDir file('src/testFunctional/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
}
gradlePlugin {
website = 'https://github.com/Bisnode/opa-gradle-plugin'
vcsUrl = 'https://github.com/Bisnode/opa-gradle-plugin'
plugins {
opa {
id = 'com.bisnode.opa'
implementationClass = 'com.bisnode.opa.OpaPlugin'
displayName = 'Open Policy Agent plugin for Gradle'
description = 'Plugin adding various tasks to help out integrating Open Policy Agent (OPA) in Gradle builds.'
tags.set(['opa', 'openpolicyagent', 'test', 'testing', 'policy', 'policies', 'authorization'])
}
}
testSourceSets sourceSets.functionalTest
}
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(false)
}
}
tasks.register('functionalTest', Test) {
useJUnitPlatform()
group = 'verification'
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
mustRunAfter test
}
check.dependsOn functionalTest
wrapper {
gradleVersion = '8.2.1'
distributionType = Wrapper.DistributionType.ALL
}
javadoc {
options {
(it as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}