-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
56 lines (48 loc) · 1.38 KB
/
build.gradle.kts
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
plugins {
id("java")
id("maven-publish")
}
val release = System.getenv("GRADLE_RELEASE").equals("true", ignoreCase = true)
group = "com.oskarsmc"
version = "1.0.0"
if (!release) {
version = "$version-SNAPSHOT"
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains:annotations:23.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
implementation("com.google.code.gson:gson:2.10.1")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "oskarsmc-repository"
val releasesRepoUrl = uri("https://repository.oskarsmc.com/releases")
val snapshotsRepoUrl = uri("https://repository.oskarsmc.com/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_SECRET")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group as String?
artifactId = project.name
version = project.version as String?
from(components["java"])
}
}
}
java {
withJavadocJar()
withSourcesJar()
}