This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle
140 lines (117 loc) · 3.21 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
plugins {
id 'java-library'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.7.3'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
id 'com.github.johnrengelman.shadow' version '4.0.4'
}
group 'club.minnced'
version '2.0.2'
sourceSets {
examples {
compileClasspath = main.output
runtimeClasspath = main.output
java.srcDirs = ['examples/java']
kotlin.srcDirs = ['examples/kotlin']
}
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
repositories {
jcenter()
}
dependencies {
api 'net.java.dev.jna:jna:4.4.0'
implementation 'club.minnced:discord-rpc-release:v3.4.0'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
examplesCompile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21'
examplesCompile compileJava.classpath
}
tasks.withType(JavaCompile) {
options.incremental = true
options.encoding = 'UTF-8'
}
// Publishing
task sources(type: Copy) {
from 'src/main/java'
into "$buildDir/sources"
}
classes.dependsOn sources
jar {
baseName = project.name
manifest {
attributes 'Implementation-Version': version
attributes 'Target-Platforms': 'win32-x86-64, win32-x86, linux-x86-64, darwin'
}
dependsOn sources
}
javadoc {
failOnError = false
options.author()
options.encoding = 'UTF-8'
if (JavaVersion.current().java9Compatible)
options.addBooleanOption('html5', true) // jdk-9 docs
options.links("https://java-native-access.github.io/jna/4.2.1/", "https://docs.oracle.com/javase/8/docs/api/")
dependsOn sources
source = sources.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from "$buildDir/sources"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
BintrayRelease(MavenPublication) {
from components.java
groupId group
artifactId archivesBaseName
version version
artifact javadocJar
artifact sourcesJar
}
}
}
bintray {
user = getProjectProperty('bintrayUsername')
key = getProjectProperty('bintrayApiKey')
publications = ["BintrayRelease"]
pkg {
repo = 'maven'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/MinnDevelopment/java-discord-rpc.git'
githubRepo = 'MinnDevelopment/java-discord-rpc'
publish = true
version {
name = project.version
vcsTag = project.version
released = new Date()
gpg {
sign = true
}
}
}
}
bintrayUpload {
dependsOn clean
dependsOn build
build.mustRunAfter clean
onlyIf { !getProjectProperty('bintrayUsername').empty }
onlyIf { !getProjectProperty('bintrayApiKey').empty }
}
def getProjectProperty(String key) {
return hasProperty(key) ? this.properties[key] : ''
}
build {
dependsOn jar
dependsOn javadocJar
dependsOn sourcesJar
dependsOn shadowJar
jar.mustRunAfter clean
javadocJar.mustRunAfter jar
sourcesJar.mustRunAfter javadocJar
shadowJar.mustRunAfter sourcesJar
}