forked from linkedin/pygradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (79 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
import com.linkedin.gradle.build.DistributeTask
import org.gradle.api.logging.configuration.ConsoleOutput
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'version'
apply plugin: 'idea'
allprojects {
group = 'com.linkedin.pygradle'
}
ext {
startTime = System.currentTimeMillis()
}
subprojects {
apply plugin: 'idea'
apply plugin: 'java'
buildDir = new File(rootProject.buildDir, path.replace(":", File.separator).substring(0))
task downloadDependencies {
description = 'Download all dependencies to help with CI cacheing'
group = 'CI'
doLast {
//noinspection GroovyAssignabilityCheck
configurations.each { conf ->
conf.files
}
}
}
tasks.withType(Test) { task ->
if (gradle.startParameter.consoleOutput == ConsoleOutput.Plain) { //on ci we will see tests as they run
task.afterTest { TestDescriptor td, TestResult tr ->
logger.lifecycle("[${tr.resultType}] - ${td.className}#${td.name}")
}
task.testLogging.exceptionFormat = 'full'
}
task.afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
logger.lifecycle("Task {} results: {} ({} tests, {} successes, {} failures, {} skipped)", task.path,
result.resultType, result.testCount, result.successfulTestCount, result.failedTestCount, result.skippedTestCount)
}
}
}
tasks.matching { it instanceof JavaCompile || it instanceof GroovyCompile }.all {
it.options.compilerArgs += ['-Xlint:deprecation']
}
idea {
module {
excludeDirs += buildDir
}
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
/* temporarily disable to fit in CI memory limit
afterEvaluate {
project.tasks.withType(FindBugs)
.matching { it.name != 'findbugsMain' }
.each { it.enabled = false }
}
*/
}
artifactoryPublish.skip = true
artifactory {
contextUrl = 'https://linkedin.jfrog.io/linkedin'
publish {
repoKey = 'pygradle'
username = System.getenv('ARTIFACTORY_USER') ?: ""
password = System.getenv('ARTIFACTORY_KEY') ?: ""
defaults {
publications ('standardjava')
}
}
clientConfig.setIncludeEnvVars(false)
}
task distributeBuild(type: DistributeTask) {
dependsOn ':artifactoryPublish', ':pivy-importer:artifactoryPublish', ':pygradle-plugin:artifactoryPublish'
}
idea {
project {
jdkName = '1.7'
languageLevel = '1.7'
}
}