This repository was archived by the owner on Nov 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
148 lines (126 loc) · 4.13 KB
/
build.gradle.kts
File metadata and controls
148 lines (126 loc) · 4.13 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
144
145
146
147
148
/*
* Copyright 2021 Duncan "duncte123" Sterken
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType
plugins {
idea
`java-library`
`maven-publish`
// id("com.github.breadmoirai.github-release") version "2.2.12"
}
project.group = "com.dunctebot"
project.version = "1.9.0"
val archivesBaseName = "sourcemanagers"
repositories {
mavenCentral()
jcenter()
maven("https://maven.lavalink.dev/releases")
maven {
url = uri("https://jitpack.io")
}
}
dependencies {
compileOnly(group = "dev.arbjerg", name = "lavaplayer", version = "2.0.3")
implementation("org.slf4j:slf4j-api:2.0.7")
implementation("commons-io:commons-io:2.7")
implementation(group = "org.jsoup", name = "jsoup", version = "1.15.3")
implementation(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2")
testImplementation(group = "dev.arbjerg", name = "lavaplayer", version = "2.0.3")
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<Wrapper> {
distributionType = DistributionType.ALL
gradleVersion = "7.3.3"
}
val jar: Jar by tasks
val build: Task by tasks
val clean: Task by tasks
val publish: Task by tasks
val sourcesJar = task<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets["main"].allJava)
}
build.apply {
// dependsOn(clean)
dependsOn(jar)
dependsOn(sourcesJar)
jar.mustRunAfter(clean)
sourcesJar.mustRunAfter(jar)
}
publishing {
repositories {
maven {
name = "duncte123-m2"
url = uri("https://m2.duncte123.dev/releases")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("PASSWORD")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
register<MavenPublication>("duncte123-m2") {
pom {
name.set(archivesBaseName)
description.set("Source managers for skybot")
url.set("https://github.com/DuncteBot/skybot-source-managers")
licenses {
license {
name.set("Apache-2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("duncte123")
name.set("Duncan Sterken")
email.set("contact@duncte123.me")
}
}
scm {
connection.set("scm:git:git://github.com/DuncteBot/skybot-source-managers.git")
developerConnection.set("scm:git:ssh://git@github.com:DuncteBot/skybot-source-managers.git")
url.set("https://github.com/DuncteBot/skybot-source-managers")
}
}
from(components["java"])
artifactId = archivesBaseName
groupId = project.group as String
version = project.version as String
artifact(sourcesJar)
}
}
}
publish.apply {
dependsOn(build)
onlyIf {
System.getenv("USERNAME") != null && System.getenv("PASSWORD") != null
}
}
/*githubRelease {
token(System.getenv("GITHUB_TOKEN"))
owner("DuncteBot")
repo("skybot-source-managers")
tagName(project.version as String)
overwrite(false)
prerelease(false)
body(changelog())
}*/