-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
130 lines (112 loc) · 3.44 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
}
plugins {
id 'maven'
id 'maven-publish'
id 'java'
id 'checkstyle'
id 'me.champeau.jmh' version '0.6.6'
id 'signing'
id 'jacoco'
}
group 'name.velikodniy.vitaliy'
version '0.13'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar, sourcesJar
}
checkstyle {
sourceSets = [ project.sourceSets.main ]
checkstyleMain.exclude '**/jmh/**'
}
signing {
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign configurations.archives
}
// Github publishing
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/g0ddest/fixedlength")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
// Maven Central publish
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_PASSWORD"))
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_PASSWORD"))
}
pom.project {
name = 'fixedlength'
packaging 'jar'
description = 'Fast simple zero-dependency Java library to parse fixed length files'
url = 'https://github.com/g0ddest/fixedlength'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://github.com/g0ddest/fixedlength/blob/master/LICENSE'
}
}
developers {
developer {
id = 'g0ddest'
name = 'Vitalii Velicodnîi'
email = 'vitaliy@velikodniy.name'
}
}
scm {
connection = 'scm:git:https://github.com/g0ddest/fixedlength.git'
developerConnection = 'scm:git:ssh://git@github.com:g0ddest/fixedlength.git'
url = "https://github.com/g0ddest/fixedlength.git"
}
}
}
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}