forked from SDARG/jreliability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
167 lines (144 loc) · 4.5 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
plugins {
id 'com.github.kt3k.coveralls' version '2.6.3'
id "com.github.hierynomus.license" version "0.14.0"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'signing'
mainClassName = 'org.jreliability.tester.ReliabilityTester'
group = 'org.jreliability'
repositories {
mavenCentral()
}
dependencies {
compile group: 'net.sourceforge.collections', name: 'collections-generic', version: '4.01'
compile group: 'de.fosd.typechef', name: 'javabdd_repackaged', version: '1.0b2'
compile group: 'org.bitbucket.vahidi', name: 'jdd', version: '108'
compile files('lib/ptolemyplot-5.7.jar')
testCompile 'junit:junit:4.12'
}
license {
include "**/*.java"
header rootProject.file('utils/licenseHeader')
headerDefinitions {
custom_definition {
firstLine = "/*******************************************************************************"
endLine = " *******************************************************************************/"
beforeEachLine = " * "
firstLineDetectionPattern = "/*"
lastLineDetectionPattern = " *"
allowBlankLines = false
isMultiline = true
}
}
mapping {
java='custom_definition'
}
strictCheck true
}
jacocoTestCoverageVerification {
dependsOn check
}
jacocoTestReport {
dependsOn jacocoTestCoverageVerification
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['org/jreliability/gui/**', 'org/jreliability/tutorial/**', 'org/jreliability/tester/**']) // TODO: combine some of these in a common folder
})
}
}
// maven central artifacts
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required = { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
def sonatypeUsernameUsed = project.hasProperty("sonatypeUsername") ? project.getProperty("sonatypeUsername"): "void"
def sonatypePasswordUsed = project.hasProperty("sonatypePassword") ? project.getProperty("sonatypePassword"): "void"
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsernameUsed, password: sonatypePasswordUsed)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsernameUsed, password: sonatypePasswordUsed)
}
pom.project {
name 'JReliability'
packaging 'jar'
// optionally artifactId can be defined here
description 'A Java-based reliability evaluation library.'
url 'https://felixreimann.github.io/jreliability/'
scm {
connection 'scm:git:https://github.com/felixreimann/jreliability.git'
url 'https://github.com/felixreimann/jreliability'
}
licenses {
license {
name 'GNU Lesser General Public License v3.0'
url 'http://www.gnu.org/licenses/lgpl-3.0.txt'
}
}
developers {
developer {
id 'michaelhglass'
name 'Michael Glaß'
email '[email protected]'
}
developer {
id 'felixreimann'
name 'Felix Reimann'
email '[email protected]'
}
developer {
id 'lukasiewycz'
name 'Martin Lukasiewycz'
email '[email protected]'
}
developer {
id 'faramarzkhosravi'
name 'Faramarz Khosravi'
email '[email protected]'
}
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.8'
}
/*
* Gets the version name from the latest Git tag
*/
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
version=stdout.toString().trim()
if (version.indexOf('-') >= 0)
version += '-SNAPSHOT'
return version
}
version=getVersionName()