-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
108 lines (93 loc) · 2.08 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
}
}
group 'de.heisluft.buildtools'
version '0.0.1'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {
url 'https://heisluft.tk/maven/'
}
maven {
url 'https://files.minecraftforge.net/maven/'
}
}
dependencies {
shadow gradleApi()
compileOnly 'com.googlecode.json-simple:json-simple:1.2.0'
compileOnly 'net.md-5:SpecialSource:1.8.5'
compileOnly('com.custardsource.dybdob:java-diff-utils-copy:1.0.5') {
transitive = false
}
compileOnly 'net.sf.jopt-simple:jopt-simple:5.0.4'
compileOnly 'org.eclipse.jgit:org.eclipse.jgit:5.1.3.201810200350-r'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier.set('sources')
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier.set('javadoc')
}
compileJava {
options.encoding = 'UTF-8'
}
javadoc {
options.encoding = 'UTF-8'
}
shadowJar {
configurations = [project.configurations.compileOnly]
archiveClassifier.set("")
}
publishing {
repositories {
maven {
url = mavenRepo
credentials {
username = mavenUsername
password = mavenPassword
}
authentication {
digest(DigestAuthentication)
}
}
}
publications {
mavenJava(MavenPublication) {
pom {
developers {
developer {
id = 'heisluft'
name = 'heisluft'
email = '[email protected]'
roles = ['developer']
}
}
}
artifact sourcesJar
artifact javadocJar
from components.java
}
}
}
signing {
sign publishing.publications.mavenJava
}
//Ensure that in a maven publication only the shaded jar is present
shadowJar.dependsOn jar
publishMavenJavaPublicationToMavenRepository.dependsOn test, shadowJar
publishMavenJavaPublicationToMavenLocal.dependsOn test, shadowJar
test {
useJUnit()
}