-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
66 lines (54 loc) · 1.62 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
plugins {
id "maven-publish"
id "tannery"
id "org.jetbrains.kotlin.jvm" version "1.5.21"
}
def branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
def buildNumber = System.getenv().BUILD_NUMBER ? "build.${System.getenv().BUILD_NUMBER}" : "local"
group "org.bookmc"
version "0.2.2+${buildNumber}"
repositories {
mavenCentral()
maven {
url "https://maven.fabricmc.net"
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "cuchaz:enigma-swing:1.4.1:all"
implementation "commons-io:commons-io:2.11.0"
}
jar {
exclude "org/**" // Only for launching
}
publishing {
repositories {
maven {
def env = System.getenv()
def local = !env.GITHUB_ACTIONS
boolean isEnvVarsAvailable = env.containsKey("MAVEN_USER") && env.containsKey("MAVEN_PASSWORD")
if (isEnvVarsAvailable) {
credentials {
username env.get("MAVEN_USER")
password env.get("MAVEN_PASSWORD")
}
}
url = local || !isEnvVarsAvailable ? "$buildDir/repository" : "https://maven.bookmc.org/releases/"
}
}
publications {
//noinspection GroovyAssignabilityCheck
mavenJava(MavenPublication) {
from components.java
pom {
name = project.name
url = "https://github.com/BookMC/${project.name}"
developers {
developer {
name = "ChachyDev"
}
}
}
}
}
}