Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
105 lines (89 loc) · 2.86 KB
/
Copy pathbuild.gradle
File metadata and controls
105 lines (89 loc) · 2.86 KB
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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.3.3/userguide/building_java_projects.html
*/
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group = 'org.fiennes'
version = '2.3.0'
repositories {
mavenCentral()
maven {
def releasesRepoUrl = layout.buildDirectory.dir('repos/releases')
def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'com.google.guava:guava:31.0.1-jre'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:31.0.1-jre'
}
java {
withJavadocJar()
withSourcesJar()
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5',true)
}
}
publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
publications {
mavenJava(MavenPublication) {
pom {
groupId = 'org.fiennes'
name = 'JSON-java'
description = 'JSON library for java'
url = 'https://github.com/alex-fiennes/JSON-java'
from components.java
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Alex Fiennes'
email = 'alex@fiennes.org'
organization = 'fiennes.org ltd'
organizationUrl = 'https://www.fiennes.org'
}
}
scm {
connection = 'scm:git:git@github.com:alex-fiennes/JSON-java.git'
developerConnection = 'scm:git:git@github.com:alex-fiennes/JSON-java.git'
url = 'https://github.com/alex-fiennes/JSON-java'
}
}
}
}
}
signing {
// useGpgCmd()
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}