-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (98 loc) · 2.81 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
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
plugins {
id 'java'
id 'maven-publish'
id "org.sonarqube" version "4.4.1.3373"
}
group = 'fr.efreicraft'
version = '1.1.2'
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
maven {
name = 'papermc-repo'
url = 'https://repo.papermc.io/repository/maven-public/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
if (System.getenv("NEXUS_REPOSITORY")) {
println "Using Nexus repository"
maven {
name = 'nexus'
url = uri(System.getenv("NEXUS_REPOSITORY"))
credentials {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
}
}
dependencies {
compileOnly 'io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT'
compileOnly "fr.efreicraft:AnimusClient:latest.integration"
compileOnly "fr.efreicraft:ECATUP:latest.integration"
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
configurations {
jar.archiveName = rootProject.name + ".jar"
}
publishing {
publications {
maven(MavenPublication) {
groupId = rootProject.group
artifactId = rootProject.name
version = rootProject.version
from components.java
pom.packaging = 'jar'
artifact("${buildDir}/libs/${rootProject.name}.jar") {
classifier = 'jar'
}
}
}
repositories {
if (System.getenv("NEXUS_REPOSITORY")) {
maven {
url = uri(System.getenv("NEXUS_REPOSITORY"))
credentials {
username = System.getenv("NEXUS_USERNAME")
password = System.getenv("NEXUS_PASSWORD")
}
}
} else {
mavenLocal()
}
}
}
task devBuildDockerImage(type: Exec) {
dependsOn build
workingDir '../'
commandLine 'docker', 'build', '-t', 'dev.efrei-craft/acp/templates/lobby', '-f', 'eclobby/dev/Dockerfile', '.'
}
sonar {
properties {
property "sonar.projectKey", "efrei-craft_eclobby_AYxT1h4W0r1VQ1KDYPLh"
property "sonar.projectName", "eclobby"
}
}