forked from spring-attic/github-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
126 lines (114 loc) · 3.86 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apply plugin: 'groovy'
apply plugin: 'org.springframework.boot'
apply plugin: 'spring-cloud-contract'
apply plugin: 'maven-publish'
apply from: 'gradle/pipeline.gradle'
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
maven { url "http://repo.spring.io/release" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE"
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${project.hasProperty("scContractVersion") ? project.property("scContractVersion") : "1.1.1.RELEASE"}"
}
}
group = 'com.example.github'
version = getProp('newVersion') ?: '0.0.1-SNAPSHOT'
ext {
projectGroupId = project.group
projectArtifactId = project.name
projectVersion = project.version
// due to CF multiport binding issues we need to hardcode the values
stubrunnerIds = 'com.example.github:github-webhook:+:stubs:10000'
}
repositories {
mavenCentral()
mavenLocal()
if (getProp("M2_LOCAL")) {
maven {
url getProp("M2_LOCAL")
}
}
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
maven { url "http://repo.spring.io/release" }
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$BOM_VERSION"
}
}
if (gradle.startParameter.taskRequests.any { it.args.contains("apiCompatibility") }) {
contracts {
baseClassForTests = 'org.springframework.github.BaseClass'
basePackageForTests = 'com.example.contracttests'
// REPO_WITH_JARS is deprecated
contractsRepositoryUrl = getProp('REPO_WITH_JARS') ?:
getProp('REPO_WITH_BINARIES') ?: 'http://localhost:8081/artifactory/libs-release-local'
contractsPath = "/"
contractDependency {
groupId = project.group
artifactId = project.name
delegate.classifier = "stubs"
delegate.version = getProp("latestProductionVersion")
}
}
} else {
contracts {
baseClassForTests = 'org.springframework.github.BaseClass'
basePackageForTests = 'com.example.contracttests'
}
}
dependencies {
compile ('org.springframework.analytics:spring-analytics:1.0.0.RELEASE')
compile ('org.springframework.cloud:spring-cloud-starter-eureka')
compile ('org.hibernate:hibernate-validator')
compile ('org.springframework.cloud:spring-cloud-starter-stream-rabbit')
compile ('org.springframework.boot:spring-boot-starter-actuator')
compile ('org.flywaydb:flyway-core')
compile ('org.springframework.boot:spring-boot-starter-data-jpa')
compile ('org.springframework.boot:spring-boot-starter-web')
compile ('com.h2database:h2')
compile ('mysql:mysql-connector-java')
compile ('io.micrometer:micrometer-spring-legacy:1.0.0-rc.1')
compile ('io.micrometer:micrometer-registry-prometheus:1.0.0-rc.1')
testCompile ('org.springframework.cloud:spring-cloud-starter-contract-stub-runner')
testCompile ('org.springframework.cloud:spring-cloud-stream-test-support')
testCompile ('org.springframework.cloud:spring-cloud-starter-contract-verifier')
testCompile ('org.awaitility:awaitility:3.0.0')
}
publishing {
repositories {
maven {
url getProp('REPO_WITH_BINARIES_FOR_UPLOAD') ?:
getProp('REPO_WITH_BINARIES') ?: 'http://localhost:8081/artifactory/libs-release-local'
credentials {
username getProp('M2_SETTINGS_REPO_USERNAME') ?: 'admin'
password getProp('M2_SETTINGS_REPO_PASSWORD') ?: 'password'
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId project.name
from components.java
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
String getProp(String propName) {
return hasProperty(propName) ?
(getProperty(propName) ?: System.properties[propName]) : System.properties[propName] ?:
System.getenv(propName)
}
test {
afterTest { desc, result ->
logger.quiet "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}