forked from quickfix-j/quickfixj
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
206 lines (174 loc) · 6.96 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/******************************************************************************
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
allprojects {
ext {
sharedDir = file("${project.rootDir}/shared")
srcDir = file('src')
genDir = file("${srcDir}/gen")
genJavaDir = file("${genDir}/java")
incremental_build = project.hasProperty('i') ? true : false
sonatype_publish = project.hasProperty('sonatypePublish') ? true : false
// Set defaults
if (!project.hasProperty("revision")) {
revision = '00000' // mark local builds
}
if (!project.hasProperty('build_number')) {
build_number = '0000' // mark local builds
}
if (!project.hasProperty('git_hash')) {
git_hash = 'local_build'
}
//Lib versions
version_slf4j = '1.7.5'
exactproVersion = '12'
}
}
subprojects {
apply plugin: 'eclipse'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
if (sonatype_publish) {
apply plugin: 'signing'
}
group = 'com.exactpro.quickfixj'
version = "1.6.0.${exactproVersion}"
sourceCompatibility = 1.7 //Java version compatibility to use when compiling Java source.
targetCompatibility = 1.7 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = "source,lines,vars" // Include debug information
buildscript { // artifacrory plugin
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.+')
classpath(group: 'com.netflix.nebula', name: 'gradle-extra-configurations-plugin', version: '2.2.+')
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
repositories {
maven {
name 'MavenLocal' // for local builds only
url sharedDir
}
jcenter()
}
configurations {
compile.exclude module: 'avalon-framework-api'
all {
transitive = true
resolutionStrategy {
// fail eagerly on version conflict (includes transitive dependencies)
// e.g. multiple different versions of the same dependency (group and name are equal)
failOnVersionConflict()
force "org.slf4j:slf4j-api:${version_slf4j}",
'commons-logging:commons-logging-api:1.1',
'commons-logging:commons-logging:1.1.3'
// don't cache changing modules at all
cacheChangingModulesFor 0, 'seconds'
}
}
}
eclipse {
project {
natures 'org.springsource.ide.eclipse.gradle.core.nature'
natures 'org.eclipse.jdt.core.javanature'
natures 'edu.umd.cs.findbugs.plugin.eclipse.findbugsNature'
buildCommand 'org.eclipse.jdt.core.javabuilder'
}
classpath {
downloadSources = true
downloadJavadoc = true
containers.clear()
containers "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-${sourceCompatibility}"
}
}
jar {
manifest {
attributes('Implementation-Version': "${revision}")
attributes('Build_Name': "${archivesBaseName}")
attributes('Build_Number': "${build_number}")
attributes('Git_Hash': "${git_hash}")
}
}
uploadArchives {
repositories {
mavenDeployer {
if (sonatype_publish) {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Exactpro QuickFixJ'
packaging 'jar'
// optionally artifactId can be defined here
description 'QuickFixJ is one of such libraries we depend on and which was modified by Exactpro.'
url 'https://github.com/Exactpro/quickfixj'
scm {
connection 'scm:git:https://github.com/Exactpro/quickfixj'
developerConnection 'scm:git:https://github.com/Exactpro/quickfixj'
url 'https://github.com/Exactpro/quickfixj'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'Nikita-Smirnov-Exactpro'
name 'Nikita Smirnov'
email 'nikita.smirnov@exactprosystems.com'
}
}
}
} else {
// uniqueVersion = false // publish non unique snapshots to local repository
repository(url: "file://${sharedDir}")
}
}
}
doFirst { sharedDir.mkdirs() }
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar, javadocJar
}
if (sonatype_publish) {
signing {
sign configurations.archives
}
}
clean {
delete genDir
}
}