-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild.gradle
98 lines (83 loc) · 2.88 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
// Applies BrazilGradle plugin then uses it to setup the build script classpath.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14"
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9"
}
}
/*
Applies core Gradle plugins, which are ones built into Gradle itself.
*/
plugins {
// Java for compile and unit test of Java source files. Read more at:
// https://docs.gradle.org/current/userguide/java_plugin.html
id 'java'
// JaCoCo for coverage metrics and reports of Java source files. Read more at:
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
id 'jacoco'
id 'application'
}
/*
Applies community Gradle plugins, usually added as build-tools in Config.
*/
// SpotBugs for quality checks and reports of source files. Read more at:
// https://spotbugs.readthedocs.io/en/stable/gradle.html
apply plugin: 'com.github.spotbugs'
/*
Configures the JaCoCo "jacoco" plugin. Remove this if you want to skip
these checks and report generation.
Set minimum code coverage to fail build, where 0.01 = 1%.
*/
check.dependsOn jacocoTestCoverageVerification
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.01
}
}
}
}
/*
Configures the SpotBugs "com.github.spotbugs" plugin. Remove this and the
plugin to skip these checks and report generation.
*/
spotbugs {
ignoreFailures.set(false)
}
repositories {
maven {
url "https://repo1.maven.org/maven2"
}
}
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.0'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'com.google.code.findbugs:findbugs:3.0.1'
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'
implementation 'com.cedarpolicy:cedar-java:3.1.2:uber'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'net.jqwik:jqwik:1.7.3'
testImplementation 'org.slf4j:slf4j-reload4j:2.0.7'
}
test {
useJUnitPlatform()
// environment 'CEDAR_JAVA_FFI_LIB', 'path to cedar_java_ffi dynamic lib'
// If you want to run these, you need tests matching the version of cedar-policy you pulled from github/crates:
environment "CEDAR_INTEGRATION_TESTS_ROOT", '/tmp' // bogus path to skip integration tests.
testLogging {
showStandardStreams false
exceptionFormat 'full'
}
}