This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
89 lines (75 loc) · 2.04 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
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'groovy'
id 'maven-publish'
id 'java-gradle-plugin'
id "com.gradle.plugin-publish" version "0.15.0"
}
group = 'com.microsoft'
version = file('version.txt').text.trim()
repositories {
mavenCentral()
}
configurations {
jacocoRuntime
}
dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation('org.spockframework:spock-core:1.2-groovy-2.5') {
exclude module: 'groovy-all'
}
testRuntimeOnly files("$buildDir/testkit")
jacocoRuntime "org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
test {
testLogging {
exceptionFormat = 'full'
}
beforeTest { TestDescriptor descriptor ->
logger.lifecycle("Running test: $descriptor.name")
}
dependsOn 'createTestkitFiles'
}
task createTestkitFiles {
def outputDir = file("$buildDir/testkit")
inputs.files sourceSets.main.runtimeClasspath
inputs.files configurations.jacocoRuntime
outputs.dir outputDir
doLast {
outputDir.mkdirs()
String propString = "org.gradle.jvmargs=-javaagent:${configurations.jacocoRuntime.asPath}=destfile=$buildDir/jacoco/test.exec".replace('\\', '/')
file("$outputDir/testkit-gradle.properties").text = propString
}
}
pluginBundle {
website = 'https://github.com/AzureAD/java-flavors-plugin'
vcsUrl = 'https://github.com/AzureAD/java-flavors-plugin'
tags = ['javaflavour', 'buildVariants']
}
gradlePlugin {
plugins {
javaFlavours {
id = 'com.microsoft.javaflavours'
displayName = 'Add Android Style flavours to your java projects'
description = 'A plugin that adds Android style flavours to your java projects'
implementationClass = 'com.microsoft.javaflavours.JavaFlavoursPlugin'
}
}
}
tasks.publish.dependsOn(build)
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}