This repository was archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
144 lines (122 loc) · 4.02 KB
/
build.gradle
File metadata and controls
144 lines (122 loc) · 4.02 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
143
plugins {
id 'java'
id 'maven-publish'
id 'java-library'
id 'signing'
}
group = 'io.github.lni-dev'
archivesBaseName = 'lapi'
version = '1.0.6'
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
compileJava.options.encoding = 'UTF-8'
def useMavenLocal = false;
repositories {
if(useMavenLocal) {
mavenLocal()
}
mavenCentral()
}
tasks.named('compileJava') {
options.javaModuleVersion = provider { project.version }
}
tasks.named('jar') {
manifest {
attributes('Implementation-Title': 'LApi',
'Implementation-Version': project.version,
'Automatic-Module-Name': 'me.linusdev.lapi')
}
}
dependencies {
api 'io.github.lni-dev:data:2.0.19'
implementation 'de.linusdev:lutils:1.0.0'
api 'org.jetbrains:annotations:23.0.0'
}
tasks.withType(JavaExec).configureEach {
enableAssertions = true
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.encoding = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet')
title = "LApi"
configure(options) {
tags(
'implNote:a:Implementation Note:',
'implSpec:a:Implemenatation Requirements:',
'apiNote:a:API Note:'
)
}
}
publishing {
repositories {
maven {
if(project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")){
name = "OSSRH"
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 = ossrhUsername
password = ossrhPassword
}
}else {
project.logger.lifecycle("no OSSRH username and password given. Cannot deploy.")
}
}
maven {
if(project.hasProperty("githubUsername") && project.hasProperty("githubToken")){
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/lni-dev/lapi")
credentials {
username = githubUsername
password = githubToken
}
}else {
project.logger.lifecycle("no github username and token given. Cannot publish package.")
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'lapi'
from components.java
pom {
name = 'LApi'
description = 'A Discord Bot API written in Java'
url = 'https://lni-dev.github.io/'
groupId = 'io.github.lni-dev'
version = project.version
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'linusdev'
name = 'Linus Andera'
email = 'einsuperlinus@gmail.com'
organizationUrl = 'https://lni-dev.github.io/'
}
}
scm {
connection = 'scm:git:git://github.com/lni-dev/lapi.git'
developerConnection ='scm:git:ssh://github.com:lni-dev/lapi.git'
url = 'https://github.com/lni-dev/lapi/tree/master'
}
}
}
}
}
signing {
if(project.hasProperty("signing.keyId") && project.hasProperty("signing.password") && project.hasProperty("signing.secretKeyRingFile")){
sign publishing.publications.mavenJava
}else {
project.logger.lifecycle("No Signing information given. Cannot sign.")
}
}