-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
107 lines (93 loc) · 2.12 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
}
group = 'dev.eruizc'
version = System.env.BUILD_VERSION
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
testImplementation('org.junit.jupiter:junit-jupiter:5.8.2')
}
testing {
suites {
test {
useJUnitJupiter('5.8.2')
}
}
}
jacocoTestCoverageVerification {
dependsOn test
violationRules {
rule {
limit {
minimum = 0.95
}
}
}
}
jacocoTestReport {
dependsOn test
reports {
xml.required = false
csv.required = false
}
}
java {
withJavadocJar()
withSourcesJar()
}
// https://docs.gradle.org/current/userguide/publishing_maven.html
// https://central.sonatype.org/publish/publish-guide
// https://www.youtube.com/watch?v=24gsrR9jsF4
publishing {
publications {
maven(MavenPublication) {
artifactId = 'sml4j'
from components.java
pom {
name = 'sml4j'
description = 'A State Machine Library for Java projects'
url = 'https://github.com/eruizc-dev/sml4j'
inceptionYear = '2022'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/eruizc-dev/sml4j/blob/master/LICENSE'
}
}
developers {
developer {
id = 'eruizc-dev'
name = 'Emiliano Ruiz Carletti'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/eruizc-dev/sml4j.git'
developerConnection = 'scm:git:ssh://github.com/eruizc-dev/sml4j.git'
url = 'https://github.com/eruizc-dev/sml4j'
}
}
}
}
repositories {
maven {
name = 'OSSRH'
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.env.OSSRH_USERNAME
password = System.env.OSSRH_PASSWORD
}
}
}
}
// https://docs.gradle.org/current/userguide/signing_plugin.html
signing {
useInMemoryPgpKeys(System.env.GPG_ARMORED_KEY, System.env.GPG_PASSPHRASE)
sign publishing.publications.maven
}