-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
73 lines (59 loc) · 1.71 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
buildscript {
repositories {
maven {
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: "org.jfrog.buildinfo", name: "build-info-extractor-gradle", version: "4.7.2"
}
}
apply plugin: "java"
apply plugin: "maven-publish"
def build = System.getenv("BUILD_NUMBER") ?: "0"
group = "net.msrandom.events"
version = "1.0.0${build == "0" ? "" : "-" + build}"
archivesBaseName = "SimpleEventHandler"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
testImplementation(group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.8.0-M1")
testImplementation(group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.8.0-M1")
}
test {
useJUnitPlatform()
maxHeapSize = "1G"
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
if (hasProperty("maven_username") && hasProperty("maven_password")) {
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = archivesBaseName
from components.java
artifact sourcesJar
}
}
repositories {
maven {
url = "https://maven.msrandom.net/repository/root/"
credentials {
username = maven_username
password = maven_password
}
}
}
}
}
if (build != "0") {
tasks.build.finalizedBy publish
}