-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (98 loc) · 3.47 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'org.javafn'
version = "${major}.${minor}.${patch}"
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testImplementation('junit:junit:4.13.1')
}
publishing {
publications {
javafn(MavenPublication) {
groupId = group
artifactId = name
version = version
pom {
name = 'JavaFn'
description = '''\
|Additional functional tools for Java.
|Adds support for Result and Either algebraic types.
|Includes a set of static Try methods that return Results so that checked exceptions
|can be used in streams seamlessly.
|Finally, includes Pair, Trio, and Quad tuples that work well with streams.
|'''.stripMargin().replaceAll("\n", " ")
url = 'https://github.com/javafn-org/javafn'
scm {
connection = 'scm:git:git://github.com:javafn-org/javafn.git'
developerConnection = 'scm:git:ssh://[email protected]:javafn-org/javafn.git'
url = 'https://github.com/javafn-org/javafn'
}
licenses {
license {
name = 'BSD-3-Clause'
url = 'https://opensource.org/license/BSD-3-clause/'
}
}
developers {
developer {
id = 'ben-stringer'
name = 'Ben Stringer'
email = '[email protected]'
}
developer {
id = 'Archthebald'
name = 'Dakota Maulding'
email = ''
}
developer {
id = 'TrevorPatorno'
name = 'Trevor Patorno'
email = ''
}
developer {
id = 'nichipedia'
name = 'Nicholas Moran'
email = ''
}
}
}
from components.java
}
}
repositories {
maven {
// The official documentation on sonatype.org does not use modern gradle.
// I based this configuration from the following
// https://dev.to/kengotoda/deploying-to-ossrh-with-gradle-in-2020-1lhi
url = version.endsWith("-SNAPSHOT")
? "https://s01.oss.sonatype.org/content/repositories/snapshots/"
: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv('MAVEN_USERNAME')
password = System.getenv('MAVEN_PASSWORD')
}
}
}
}
signing {
useGpgCmd()
project.ext.set('signing.gnupg.executable', 'gpg')
project.ext.set('signing.gnupg.keyName', System.getenv("OSSRH_GPG_ID"))
project.ext.set('signing.gnupg.passphrase', System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD"))
sign publishing.publications.javafn
}
tasks.withType(Sign) {
onlyIf { System.getenv().containsKey("CI") }
}