-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (73 loc) · 2.02 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
plugins {
id "java"
id "maven-publish"
id "net.kyori.blossom" version "1.2.0"
}
ext {
branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(16)
}
}
group "org.bookmc"
version "0.3.0${branch != "main" && !branch.isEmpty() ? "-$branch" : ""}"
repositories {
mavenCentral()
maven {
url "https://maven.bookmc.org/releases/"
}
}
configurations {
include
implementation.extendsFrom(include)
}
dependencies {
include "com.google.code.gson:gson:2.8.8"
include "org.bookmc:install:0.3.1"
include "net.sf.jopt-simple:jopt-simple:6.0-alpha-3"
include "com.github.zafarkhaja:java-semver:0.9.0"
include "org.apache.logging.log4j:log4j-api:2.14.1"
include "org.apache.logging.log4j:log4j-core:2.14.1"
}
blossom {
replaceToken("%INSTALLER_VERSION%", project.version)
}
jar {
from {
configurations.include.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy DuplicatesStrategy.EXCLUDE
manifest.attributes("Main-Class": "org.bookmc.installer.Main")
}
publishing {
repositories {
maven {
def env = System.getenv()
boolean login = env.containsKey("MAVEN_USER") && env.containsKey("MAVEN_PASSWORD")
if (login) {
credentials {
username env.get("MAVEN_USER")
password env.get("MAVEN_PASSWORD")
}
}
url = !login ? "$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"
}
}
}
}
}
}