-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
143 lines (121 loc) · 2.88 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
plugins {
id 'java-library'
id 'maven-publish'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.4'
id "org.checkerframework" version "0.3.4"
}
apply plugin: 'org.checkerframework'
repositories {
jcenter()
}
sourceCompatibility = java_version
targetCompatibility = java_version_target
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
sourceSets {
samples {
java {
srcDir 'src/samples/java'
}
resources {
srcDir 'src/samples/resources'
}
}
}
dependencies {
samplesImplementation sourceSets.main.compileClasspath
samplesImplementation sourceSets.main.output
testImplementation "org.junit.jupiter:junit-jupiter:$junit_jupiter_version"
testImplementation "net.jodah:concurrentunit:$concurrentunit_version"
testImplementation sourceSets.samples.output
}
/*Awaiting checkerframework for Java 12...
checkerFramework {
checkers = [
'org.checkerframework.checker.nullness.NullnessChecker'
]
}*/
// Project properties
if(!project.hasProperty('publish_name')) ext.publish_name = project.name
if(!project.hasProperty('github_repo')) ext.github_repo = publish_name
ext.github_repo_full = github_owner + '/' + github_repo
archivesBaseName = publish_name
version = "${version_major}.${version_minor}.${version_patch}"
if(version_channel != ''){
version += "-$version_channel"
if(version_pre != '') version += ".$version_pre"
}
group = publish_group
// Java Opts
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
failOnError = false
options.encoding = 'UTF-8'
options.addBooleanOption('html5', true)
}
// Tesing
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}
// Publishing
publishing {
publications {
mavenJava(MavenPublication){
pom {
name = publish_name
description = publish_desc
url = "https://github.com/${github_repo_full}"
from components.java
licenses {
license {
}
}
developers {
developer {
id = 'Elix-x'
name = 'Elix X'
email = '[email protected]'
url = 'https://github.com/Elix-x'
}
}
scm {
connection = "scm:git:git://github.com/${github_repo_full}.git"
developerConnection = "scm:git:ssh://github.com:${github_repo_full}.git"
url = "https://github.com/${github_repo_full}/tree/master"
}
}
}
}
repositories {
maven {
name = 'GitHubPackages'
url = "https://maven.pkg.github.com/${github_repo_full}"
credentials {
username = System.getenv('GITHUBACCESSUSER')
password = System.getenv('GITHUBACCESSTOKEN')
}
}
}
}
/*tasks.withType(Jar){ task ->
task.doLast {
ant.checksum file: task.archivePath
ant.checksum(file: task.archivePath, algorithm: 'SHA')
}
}*/