-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.gradle
123 lines (101 loc) · 3.31 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
// https://medium.com/viascom/complete-guide-publish-with-gradle-to-maven-central-native-7b128addbb6
// https://github.com/researchgate/gradle-release
plugins {
id "maven-publish"
id "signing"
id "java-library"
id 'net.researchgate.release' version '3.0.2'
id 'jacoco'
}
java {
withJavadocJar()
withSourcesJar()
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
sourceCompatibility = 1.8
group = 'com.github.drapostolos'
archivesBaseName = 'type-parser'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.23.1'
}
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled = true
html.required = true
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.8
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
publishing {
repositories {
maven {
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "OSSRH"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
groupId = 'com.github.drapostolos'
name = 'type-parser'
description = 'This is a lightweigth library that does nothing but parse a string to a given type. Supports most of the java classes, such as Integer, File, Enum, Float and also generic types as well, such as List<Integer>, Set<File> etc. Also possible to register your own parsers.'
url = 'https://github.com/drapostolos/type-parser'
packaging = 'jar'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'http://opensource.org/licenses/MIT'
}
}
scm {
url = 'https://github.com/drapostolos/type-parser'
connection = 'scm:git://github.com:drapostolos/type-parser.git'
developerConnection = 'scm:git://github.com:drapostolos/type-parser.git'
}
developers {
developer {
id = 'drapostolos'
name = 'Alexander Poulikakos'
email = '[email protected]'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
release {
tagTemplate = '$name-$version'
git {
requireBranch.set('master')
}
}
afterReleaseBuild.dependsOn publish