forked from MinnDevelopment/java-discord-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
120 lines (98 loc) · 2.68 KB
/
build.gradle
File metadata and controls
120 lines (98 loc) · 2.68 KB
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
plugins {
id 'java-library'
id 'maven-publish'
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 {
compileOnly '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
}
}
repositories {
maven {
name = "meteor-maven"
url = "https://maven.meteordev.org"
credentials {
username = System.getenv("MAVEN_METEOR_ALIAS")
password = System.getenv("MAVEN_METEOR_TOKEN")
}
authentication {
basic(BasicAuthentication)
}
}
}
}
build {
dependsOn jar
dependsOn javadocJar
dependsOn sourcesJar
dependsOn shadowJar
jar.mustRunAfter clean
javadocJar.mustRunAfter jar
sourcesJar.mustRunAfter javadocJar
shadowJar.mustRunAfter sourcesJar
}