-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
executable file
·156 lines (129 loc) · 3.67 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
buildscript {
repositories {
mavenCentral()
//Needed only for SNAPSHOT versions
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.10'
classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.11"
}
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'net.ltgt.errorprone'
apply plugin: "info.solidsoft.pitest"
sourceCompatibility = JavaVersion.VERSION_1_8
group = 'se.fearless'
archivesBaseName = "fettle"
version = '1.0.0-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
defaultTasks 'build'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit-dep', version: '4.11'
testCompile group: 'se.mockachino', name: 'mockachino', version: '0.6.1'
compile group: 'com.google.guava', name: 'guava', version: '18.0'
}
task gwtJar(type: Jar, dependsOn: classes) {
classifier = 'gwt'
from sourceSets.main.getOutput().classesDir
exclude("**/export/DotExporter*", "**/util/PredicateCondition*")
into('se/fearless/fettle/super') {
from sourceSets.main.allJava
}
into('se/fearless/fettle') {
from sourceSets.main.resources
exclude("**/export*")
}
}
jar {
exclude("**/*.xml")
}
checkstyleMain {
doLast {
ant.xslt(in: "$buildDir/reports/checkstyle/main.xml",
style:"config/checkstyle/checkstyle.xsl",
out:"$buildDir/reports/checkstyle/checkstyle.html"
)
}
}
checkstyleTest {
ignoreFailures = true
}
jacocoTestReport {
reports {
html.enabled = true
csv.enabled = false
xml.enabled = false
}
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
}
// custom tasks for creating source jar
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// custom tasks for creating javadoc jar
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives gwtJar
archives sourcesJar
archives javadocJar
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'Fettle'
packaging 'jar'
description 'Fettle is a state machine framework for java'
url 'http://http://thehiflyer.github.com/Fettle/'
scm {
url 'https://github.com/thehiflyer/Fettle.git'
connection 'https://github.com/thehiflyer/Fettle.git'
developerConnection 'https://github.com/thehiflyer/Fettle.git'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
distribution 'repo'
}
}
developers {
developer {
id 'hiflyer'
name 'Per Malmén'
}
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}