-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (83 loc) · 3.13 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'maven-publish'
id 'java'
}
allprojects {
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
group 'dev.mcapi'
version '0.1.0-alpha'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
java {
withSourcesJar()
}
shadowJar {
if (project.hasProperty('dir')) {
destinationDir(new File((String) project.getProperties().get('dir')))
}
}
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'io.projectreactor.netty:reactor-netty:1.0.24'
implementation 'dev.miku:r2dbc-mysql:0.8.2.RELEASE'
implementation 'io.r2dbc:r2dbc-pool:0.9.2.RELEASE'
implementation 'io.projectreactor:reactor-core:3.4.24'
implementation 'net.kyori:adventure-api:4.11.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0'
implementation 'com.google.inject:guice:5.1.0'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
processResources {
from 'src/main'
filter ReplaceTokens, tokens: [version: version]
}
tasks.withType(ProcessResources).configureEach() {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
subprojects {
apply plugin: 'maven-publish'
apply plugin: 'java'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = group
artifactId archivesBaseName
version = project.version
}
}
repositories {
maven {
def snapshotUrl = 'https://repo.codemc.io/repository/maven-snapshots/'
def releaseUrl = 'https://repo.codemc.io/repository/maven-releases/'
// You can use any other check here to set what URL should be used.
url = project.version.endsWith('alpha') || project.version.endsWith('beta') ? snapshotUrl : releaseUrl
// ORG_GRADLE_PROJECT_mavenUsername and ORG_GRADLE_PROJECT_mavenPassword are the environments you defined before.
def mavenUsername = System.getenv('CODEMC_mavenUsername')
def mavenPassword = System.getenv('CODEMC_mavenPassword')
if (mavenUsername != null && mavenPassword != null) {
System.out.println('Setting credentials')
credentials {
username mavenUsername
password mavenPassword
}
}
}
}
}
}