-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (74 loc) · 2.17 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
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'maven-publish'
id "com.github.ben-manes.versions" version "0.51.0"
}
group 'de.longri'
version '5.0.0'
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
maven { url "https://www.jitpack.io" }
maven {
url "https://nexus.longri.de/repository/maven-public/"
allowInsecureProtocol = true
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
if (file('gradle.properties.local').exists()) {
def props = new Properties()
file('gradle.properties.local').withInputStream { props.load(it) }
props.each { key, value -> project.ext.set(key, value) }
}
publishing {
publications {
maven(MavenPublication) {
artifact("build/libs/" + rootProject.name + "-" + version + ".jar") {
extension 'jar'
}
}
}
repositories {
maven {
name 'deploy'
url deployRepoUrl
allowInsecureProtocol = true
credentials {
username = deployRepoUsername
password = deployRepoPassword
}
}
}
}
task _FAT_JAR(dependsOn: test, type: Jar) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes 'Main-Class': 'com.longri'
}
from(configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
with jar
}
task _CLEAN_TO_NEXUS {
}
task _BUILD_TO_NEXUS(dependsOn: _CLEAN_TO_NEXUS) {
}
task PUBLISH_TO_NEXUS(dependsOn: _BUILD_TO_NEXUS) {
println "PUBLISH_TO_NEXUS version $version"
}
_CLEAN_TO_NEXUS.dependsOn(clean)
_BUILD_TO_NEXUS.dependsOn(_FAT_JAR)
PUBLISH_TO_NEXUS.mustRunAfter(_FAT_JAR)
PUBLISH_TO_NEXUS.dependsOn(publishAllPublicationsToDeployRepository)
publishMavenPublicationToDeployRepository.dependsOn(_FAT_JAR)
tasks.withType(Copy).all { duplicatesStrategy 'exclude' }
tasks.withType(Jar).all { duplicatesStrategy 'exclude' }