-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
96 lines (85 loc) · 2.78 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
ext.isSnapshotVersion = version.endsWith("SNAPSHOT")
ext.isReleaseVersion = !ext.isSnapshotVersion
sourceCompatibility = '11'
targetCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13.2'
}
tasks.withType(Jar) {
manifest {
attributes 'Implementation-Title': 'AppleSingle',
'Implementation-Version': "${project.version} (${new Date().format('yyyy-MM-dd HH:mm')})"
}
}
javadoc {
title = "applesingle-api ${project.version}"
source = sourceSets.main.allJava
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
groupId = "net.sf.applecommander"
artifactId = "applesingle-api"
name = 'applesingle-api'
description = 'A Java library for managing AppleSingle files.'
url = 'https://applecommander.github.io/'
licenses {
license {
name = 'The GNU General Public License (GPL) Version 2, June 1991'
url = 'https://www.gnu.org/licenses/gpl-2.0.html'
}
}
developers {
developer {
id = 'robgreene'
name = 'Rob Greene'
email = 'robgreene@gmail.com'
}
}
scm {
connection = 'scm:git:https://github.com/AppleCommander/applesingle.git'
developerConnection = 'scm:git:git@github.com:AppleCommander/applesingle.git'
url = 'https://github.com/AppleCommander/applesingle'
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = isSnapshotVersion ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}