-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
120 lines (107 loc) · 3.23 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
/*
* This file is part of emuLib.
*
* Copyright (C) 2006-2023 Peter Jakubčo
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
id "java-library"
id "maven-publish"
id 'signing'
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
group 'net.emustudio'
version '12.0.0'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.slf4j:slf4j-api:2.0.5'
implementation 'net.jcip:jcip-annotations:1.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.easymock:easymock:5.0.1'
}
java {
withJavadocJar()
withSourcesJar()
}
nexusPublishing {
repositories {
sonatype()
}
// these are not strictly required. The default timeouts are set to 1 minute. But Sonatype can be really slow.
// If you get the error "java.net.SocketTimeoutException: timeout", these lines will help.
connectTimeout = Duration.ofMinutes(3)
clientTimeout = Duration.ofMinutes(3)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'emulib'
from components.java
pom {
name = 'emuLib'
description = 'Run-time library used by emuStudio and plugins'
url = 'https://github.com/emustudio/emuLib'
licenses {
license {
name = 'GNU General Public License, Version 3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
id = 'vbmacher'
name = 'Peter Jakubčo'
email = '[email protected]'
}
developer {
id = 'sulir'
name = 'Matúš Sulír'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:[email protected]:emustudio/emuLib.git'
developerConnection = 'scm:git:[email protected]:emustudio/emuLib.git'
url = 'https://github.com/emustudio/emuLib'
}
}
}
}
repositories {
maven {
// configure publishing to a local directory for testing
name = "local"
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
signing {
required {
project.gradle.taskGraph.hasTask("publish")
}
def signingKey = findProperty("GPG_KEY") ?: System.getenv("GPG_KEY")
def signingPassword = findProperty("GPG_PASSWORD") ?: System.getenv("GPG_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}