-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
100 lines (82 loc) · 3.46 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
apply plugin: 'groovy'
apply from: "$rootDir/gradle/cdeliveryboy-release.gradle"
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'com.toomuchcoding.uptodate'
buildscript {
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/' //for plugin-publish-plugin
}
}
dependencies {
classpath 'info.solidsoft.gradle:cdeliveryboy:0.8.0'
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.3'
classpath 'com.gradle.publish:plugin-publish-plugin:0.13.0'
classpath 'com.toomuchcoding:uptodate-gradle-plugin:1.0.1'
}
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
sourceSets {
funcTest {
java.srcDir file('src/funcTest/java')
groovy.srcDir file('src/funcTest/groovy')
resources.srcDir file('src/funcTest/resources')
}
}
dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.squareup.okhttp3:okhttp:4.9.1'
testCompile('org.spockframework:spock-core:1.3-groovy-2.5') {
//groovy 2.3.x or 2.4.x is already provided by Gradle itself
exclude group: 'org.codehaus.groovy'
}
testCompile 'info.solidsoft.spock:spock-global-unroll:0.5.1'
testCompile 'org.objenesis:objenesis:3.1' //for mocking classes with Spock
testCompile 'net.bytebuddy:byte-buddy:1.10.21' //for Spying with Spock
testCompile 'junit:junit:4.13.2'
funcTestCompile sourceSets.main.output //to make production plugin classes visible in functional tests (it's not in testCompile configuration)
funcTestCompile sourceSets.test.output //to depends on common unit and integration helper classes
funcTestCompile configurations.testCompile
funcTestRuntime configurations.testRuntime
funcTestCompile('com.netflix.nebula:nebula-test:7.10.2') {
exclude group: 'org.codehaus.groovy'
}
funcTestCompile 'com.github.tomakehurst:wiremock:1.50' //1.54+ makes GroovyBuilder to fail with parsing empty response on POST
signature 'org.codehaus.mojo.signature:java18:1.0@signature'
}
//noinspection GroovyAssignabilityCheck
task funcTest(type: Test) {
description = 'Run the functional tests.'
group = 'Verification'
testClassesDirs = sourceSets.funcTest.output.classesDirs
classpath = sourceSets.funcTest.runtimeClasspath
if (!project.hasProperty('enableE2ETests') && System.getenv().NEXUS_AT_ENABLE_E2E_TESTS == null) {
logger.lifecycle("E2E tests execution is disabled.")
exclude '**/*E2ESpec.*'
}
reports.html {
destination = file("${reporting.baseDir}/funcTests")
}
systemProperty("ignoreDeprecations", "true") //TODO: Remove once Gradle 5 deprecation warnings are fixed - https://github.com/Codearte/gradle-nexus-staging-plugin/issues/81
}
funcTest.shouldRunAfter test
check.shouldRunAfter funcTest
check.dependsOn funcTestClasses
uploadArchives.dependsOn funcTest, check
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
reportOn test, funcTest
}
tasks.withType(ru.vyarus.gradle.plugin.animalsniffer.AnimalSniffer) {
onlyIf { project.hasProperty('compatibility') }
}
animalsniffer {
sourceSets = [project.sourceSets.main] //just for production classes - Animal Sniffer fails with: 'Undefined reference: void for Spock tests'
//https://github.com/mojohaus/animal-sniffer/issues/27
}