-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
95 lines (69 loc) · 2.72 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
maven {url "https://plugins.gradle.org/m2/"}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.3.2'
classpath 'org.jacoco:org.jacoco.core:0.8.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.4.2'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
classpath "gradle.plugin.com.palantir:jacoco-coverage:0.4.0"
//noinspection GradleDependency. versions > 6.0.3 do not work with our project currently
classpath 'org.owasp:dependency-check-gradle:6.0.3'
}
}
def allTestDestination = "$buildDir/JACOCO/"
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
/*
subprojects {
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.7"
}
afterEvaluate { project ->
if (project.plugins.hasPlugin('java') || project.plugins.hasPlugin('org.jetbrains.kotlin.jvm')) {
// Registering jacocoTestReport task
tasks.register('jacocoTestReport', JacocoReport) {
dependsOn tasks.withType(Test)
reports {
xml.required.set(true)
csv.required.set(true)
html.required.set(true)
}
executionData.setFrom(fileTree(project.buildDir).include("/jacoco/*.exec"))
sourceDirectories.setFrom(files(project.sourceSets.main.allSource.srcDirs))
classDirectories.setFrom(files(project.sourceSets.main.output))
}
// Ensure jacocoTestReport runs after all test tasks
tasks.withType(Test).configureEach {
finalizedBy 'jacocoTestReport'
}
}
}
dependencies {
// Ensuring that these dependencies are only added to Java/Kotlin projects
if (plugins.hasPlugin('java') || plugins.hasPlugin('org.jetbrains.kotlin.jvm')) {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
}
}
*/
// For publishing
apply plugin: 'maven-publish'
apply from: rootProject.file('gradle/enable-jacoco.gradle')
apply plugin: 'org.owasp.dependencycheck'