-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (128 loc) · 4.09 KB
/
Copy pathbuild.gradle
File metadata and controls
142 lines (128 loc) · 4.09 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//file:noinspection GroovyAssignabilityCheck
import java.nio.charset.StandardCharsets
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0'
}
}
apply plugin: 'io.codearte.nexus-staging'
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
}
version = BUILD_VERSION
group = BUILD_GROUP
description = BUILD_DESCRIPTION
archivesBaseName = BUILD_NAME
compileJava.options.encoding = StandardCharsets.UTF_8.name()
javadoc.options.encoding = StandardCharsets.UTF_8.name()
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha1'
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation group: 'org.jetbrains', name: 'annotations', version: '20.1.0'
}
jar {
manifest {
attributes 'Build-By': BUILD_AUTHOR,
'Build-Date': new Date(),
'Build-Jdk': System.getProperty('java.version'),
'Package': BUILD_GROUP,
'Name': BUILD_NAME,
'Created-By': BUILD_AUTHOR
}
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:none', true)
}
}
task javadocJar(type: Jar) {
//noinspection GrDeprecatedAPIUsage
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
//noinspection GrDeprecatedAPIUsage
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
description = BUILD_DESCRIPTION
name = BUILD_NAME
url = BUILD_URL
inceptionYear = BUILD_INCEPTION_YEAR
packaging 'jar'
licenses {
license {
name = BUILD_LICENSE_NAME
url = BUILD_LICENSE_URL
}
}
developers {
developer {
id = 'levasseur.wesley'
name = 'Levasseur Wesley'
email = 'contact@wesley-dev.codes'
}
}
scm {
connection = 'scm:git:git://github.com/kanekireal/RemasteredLogger.git'
developerConnection = 'scm:git:ssh://github.com/kanekireal/RemasteredLogger.git'
url = BUILD_URL
tag = 'HEAD'
}
}
groupId = BUILD_GROUP_ID
artifactId = BUILD_ARTIFACT_ID
version = BUILD_VERSION
from components.java
artifact(sourcesJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('-SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('oss_username')
password = System.getenv('oss_password')
}
}
}
signing {
required {
!version.toString().endsWith('-SNAPSHOT') && tasks.withType(PublishToMavenRepository).find {
gradle.taskGraph.hasTask it
}
}
sign publishing.publications
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}