-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
141 lines (118 loc) · 3.53 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.5.2'
}
ext {
repoName = "git config --get remote.origin.url".execute().getText()
projectName = "basename -s .git ${repoName}".execute().getText().trim()
}
}
def dep(p, version) {
return (gradle.ext.has('projects') && gradle.projects.contains(p)) ? project(p) : "com.github.leeonky${p}:${version}"
}
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'de.marcphilipp.nexus-publish' version '0.2.0'
}
jacoco {
toolVersion = "0.8.2"
}
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'info.solidsoft.pitest'
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
group = 'com.github.leeonky'
version = '0.3.23' + System.env.VERSION_SCOPE
sourceCompatibility = 1.8
jacocoTestReport {
reports {
xml.enabled = true // for coveralls
html.enabled = true
}
}
repositories {
mavenCentral()
}
dependencies {
compile dep(':bean-util', '0.6.4')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.3'
testImplementation 'org.assertj:assertj-core:3.15.0'
testImplementation 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.3'
testImplementation dep(':DAL-java', '0.4.2')
testImplementation dep(':java-compiler-util', '0.0.3')
testImplementation "io.cucumber:cucumber-java:6.10.4"
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.0.0'
pitest 'io.github.wmaarts:pitest-mutation-testing-elements-plugin:0.3.1'
}
test {
useJUnitPlatform()
environment 'TZ', 'GMT'
}
pitest {
targetClasses = ['com.github.leeonky.jfactory.*']
excludedClasses = ['com.github.leeonky.jfactory.spec.*']
outputFormats = ['HTML2']
junit5PluginVersion = "0.12"
}
//build.dependsOn 'pitest'
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = projectName
from(components.java)
artifact sourcesJar
artifact javadocJar
pom {
name = projectName
description = projectName
url = 'https://github.com/leeonky/' + projectName
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'leeonky'
name = 'Liangchen'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/leeonky/' + projectName + '.git'
developerConnection = 'scm:git:[email protected]:leeonky' + projectName + '.git'
url = 'https://github.com/leeonky/' + projectName + '.git'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
nexusPublishing {
username = System.env.ossrhUsername
password = System.env.ossrhPassword
}
task currentVersion {
doLast {
println project.version
}
}
tasks.coveralls {
dependsOn jacocoTestReport
}