-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
118 lines (98 loc) · 3.52 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
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
plugins {
`java-library`
`maven-publish`
id("org.sonarqube") version "4.4.1.3373"
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
subprojects {
if(project.name == "games") {
return@subprojects
}
apply(plugin = "maven-publish")
apply(plugin = "java")
group = "fr.efreicraft.ludos"
version = "1.1"
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
javaCompiler.set(project.javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
})
}
// move jars to a folder
tasks.withType<Jar> {
if (project.name == "core") {
destinationDirectory.set(file("${project.rootDir}/run/plugins"))
} else {
destinationDirectory.set(file("${project.rootDir}/run/plugins/LudosCore/games"))
}
archiveFileName.set("Ludos${project.name.substring(0, 1).toUpperCase()}${project.name.substring(1)}.jar")
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://maven.enginehub.org/repo/")
maven("https://repo.dmulloy2.net/repository/public/")
if (System.getenv("NEXUS_REPOSITORY") != null) {
maven {
url = uri(System.getenv("NEXUS_REPOSITORY"))
credentials {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "fr.efreicraft"
artifactId = "Ludos" + project.name.substring(0, 1).toUpperCase() + project.name.substring(1)
version = project.version.toString()
from(components["java"])
pom.packaging = "jar"
if(project.name == "core") {
artifact ("${project.rootDir}/run/plugins/${artifactId}.jar") {
classifier = "jar"
}
} else {
artifact ("${project.rootDir}/run/plugins/LudosCore/games/${artifactId}.jar") {
classifier = "jar"
}
}
}
}
repositories {
if (System.getenv("NEXUS_REPOSITORY") != null) {
maven {
url = uri(System.getenv("NEXUS_REPOSITORY"))
credentials {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
} else {
mavenLocal()
}
}
}
}
tasks.register<Exec>("devBuildDockerImage") {
dependsOn(":core:jar")
workingDir = File("../")
commandLine("docker", "build", "-t", "dev.efrei-craft/acp/templates/mini", "-f", "Ludos/dev/Dockerfile", ".")
}
tasks.register<Exec>("devRunDockerImage") {
dependsOn(":core:jar")
dependsOn("devBuildDockerImage")
workingDir = File("../")
commandLine("docker", "run", "-p", "25565:25565", "-v", "${project.rootDir}/run:/home/minecraft/server", "-e", "ANIMUS_STANDALONE=true", "--name", "ludos_dev", "dev.efrei-craft/acp/templates/mini")
}
sonar {
properties {
property("sonar.projectKey", "efrei-craft_Ludos_AYxT1h2K0r1VQ1KDYPJu")
property("sonar.projectName", "Ludos")
}
}