Skip to content

Commit cb3ae62

Browse files
Merge pull request discord-jda#710 from DV8FromTheWorld/release/3.7.0
Release 3.7.0
2 parents 3092875 + 01f27aa commit cb3ae62

File tree

115 files changed

+2444
-5821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2444
-5821
lines changed

.editorconfig

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
root = true
33

44
[*]
5+
charset = utf-8
56
end_of_line = crlf
67
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 4
710

811
[gradlew]
912
end_of_line = lf
10-
11-
[*.{java, md, gradle, properties}]
12-
charset = utf-8
13-
indent_style = space
14-
indent_size = 4

.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Preserve gradlew's line ending
2-
.gitattributes text eol=crlf
3-
42
gradlew binary
53

4+
.git* text eol=crlf
65
*.java text eol=crlf
76
*.gradle text eol=crlf
87
*.bat text eol=crlf

README.md

+37-5
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,20 @@ Be sure to replace the **VERSION** key below with the one of the versions shown
172172

173173
```
174174

175+
**Maven without Audio**
176+
```xml
177+
<dependency>
178+
<groupId>net.dv8tion</groupId>
179+
<artifactId>JDA</artifactId>
180+
<version>VERSION</version>
181+
<exclusions>
182+
<exclusion>
183+
<artifactId>opus-java</artifactId>
184+
</exclusion>
185+
</exclusions>
186+
</dependency>
187+
```
188+
175189
**Gradle**
176190
```gradle
177191
dependencies {
@@ -183,8 +197,26 @@ repositories {
183197
}
184198
```
185199

200+
**Gradle without Audio**
201+
```gradle
202+
dependencies {
203+
compile ('net.dv8tion:JDA:VERSION') {
204+
exclude module: 'opus-java'
205+
}
206+
}
207+
```
208+
186209
The builds are distributed using JCenter through Bintray [JDA JCenter Bintray](https://bintray.com/dv8fromtheworld/maven/JDA/)
187210

211+
If you do not need any opus de-/encoding done by JDA (voice receive/send with PCM) you can exclude `opus-java` entirely.
212+
This can be done if you only send audio with an `AudioSendHandler` which only sends opus (`isOpus() = true`). (See [lavaplayer](https://github.com/sedmelluq/lavaplayer))
213+
214+
If you want to use a custom opus library you can provide the absolute path to `OpusLibrary.loadFrom(String)` before using
215+
the audio api of JDA. This works without `opus-java-natives` as it only requires `opus-java-api`.
216+
<br>_For this setup you should only exclude `opus-java-natives` as `opus-java-api` is a requirement for en-/decoding._
217+
218+
See [opus-java](https://github.com/discord-java/opus-java)
219+
188220
### Logging Framework - SLF4J
189221
JDA is using [SLF4J](https://www.slf4j.org/) to log its messages.
190222

@@ -303,10 +335,6 @@ All dependencies are managed automatically by Gradle.
303335
* Version: **20160810**
304336
* [Github](https://github.com/douglascrockford/JSON-java)
305337
* [JCenter Repository](https://bintray.com/bintray/jcenter/org.json%3Ajson/view)
306-
* JNA
307-
* Version: **4.4.0**
308-
* [Github](https://github.com/java-native-access/jna)
309-
* [JCenter Repository](https://bintray.com/bintray/jcenter/net.java.dev.jna%3Ajna/view)
310338
* Trove4j
311339
* Version: **3.0.3**
312340
* [BitBucket](https://bitbucket.org/trove4j/trove)
@@ -315,6 +343,10 @@ All dependencies are managed automatically by Gradle.
315343
* Version: **1.7.25**
316344
* [Website](https://www.slf4j.org/)
317345
* [JCenter Repository](https://bintray.com/bintray/jcenter/org.slf4j%3Aslf4j-api/view)
346+
* opus-java
347+
* Version: **1.0.2**
348+
* [GitHub](https://github.com/discord-java/opus-java)
349+
* [JCenter Repository](https://bintray.com/minndevelopment/maven/opus-java)
318350

319351
## Related Projects
320352

@@ -323,4 +355,4 @@ All dependencies are managed automatically by Gradle.
323355
- [discord.py](https://github.com/Rapptz/discord.py)
324356
- [serenity](https://github.com/zeyla/serenity)
325357

326-
**See also:** https://discordapp.com/developers/docs/topics/libraries
358+
**See also:** https://discordapp.com/developers/docs/topics/community-resources#libraries

build.gradle

+23-13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//to build and upload everything: "gradlew bintrayUpload"
1919

2020
import org.apache.tools.ant.filters.ReplaceTokens
21+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2122

2223
plugins {
2324
id 'com.jfrog.bintray' version '1.7.3'
@@ -28,7 +29,7 @@ plugins {
2829
id 'com.github.johnrengelman.shadow' version '2.0.1'
2930
}
3031

31-
def versionObj = new Version(major: 3, minor: 6, revision: 0)
32+
def versionObj = new Version(major: 3, minor: 7, revision: 0)
3233

3334
group = "net.dv8tion"
3435
archivesBaseName = "JDA"
@@ -61,10 +62,10 @@ dependencies {
6162
compile 'net.sf.trove4j:trove4j:3.0.3'
6263

6364
//Native Library Support
64-
compile 'net.java.dev.jna:jna:4.4.0'
65+
compile 'club.minnced:opus-java:1.0.2'
6566

6667
//Web Connection Support
67-
compile 'com.neovisionaries:nv-websocket-client:2.2'
68+
compile 'com.neovisionaries:nv-websocket-client:2.4'
6869
compile 'com.squareup.okhttp3:okhttp:3.8.1'
6970

7071
//Sets the dependencies for the examples
@@ -101,7 +102,22 @@ jar {
101102
}
102103

103104
shadowJar {
104-
classifier = "withDependencies"
105+
classifier = 'withDependencies'
106+
}
107+
108+
task noOpusJar(type: ShadowJar, dependsOn: shadowJar) {
109+
classifier = shadowJar.classifier + '-no-opus'
110+
111+
configurations = [project.configurations.runtime]
112+
from sourceSets.main.output
113+
exclude 'natives/**' // ~2 MB
114+
exclude 'com/sun/jna/**' // ~1 MB
115+
exclude 'club/minnced/opus/util/*'
116+
exclude 'tomp2p/opuswrapper/*'
117+
118+
manifest {
119+
inheritFrom jar.manifest
120+
}
105121
}
106122

107123
task sourcesJar(type: Jar, dependsOn: classes) {
@@ -147,14 +163,9 @@ javadoc {
147163
'net/dv8tion/jda/core/requests/Route.java',
148164
'net/dv8tion/jda/core/requests/Requester.java',
149165
'net/dv8tion/jda/core/requests/Response.java',
150-
'net/dv8tion/jda/core/requests/ratelimit',
151-
'net/dv8tion/jda/core/requests/restaction/CompletedFuture.java',
152-
'net/dv8tion/jda/core/requests/restaction/RequestFuture.java')
166+
'net/dv8tion/jda/core/requests/ratelimit')
153167
exclude('net/dv8tion/jda/core/utils/cache/impl')
154168

155-
//opuswrapper
156-
exclude('tomp2p/opuswrapper')
157-
158169
//voice crypto
159170
exclude('com/iwebpp/crypto')
160171
}
@@ -199,16 +210,15 @@ String getProjectProperty(String propertyName)
199210
return property
200211
}
201212

202-
task wrapper(type: Wrapper) {
203-
gradleVersion = '4.2.1'
204-
}
213+
wrapper.gradleVersion = '4.6'
205214

206215
build {
207216
dependsOn clean
208217
dependsOn jar
209218
dependsOn javadocJar
210219
dependsOn sourcesJar
211220
dependsOn shadowJar
221+
dependsOn noOpusJar
212222

213223
jar.mustRunAfter clean
214224
javadocJar.mustRunAfter jar

src/main/java/net/dv8tion/jda/client/entities/Application.java

-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package net.dv8tion.jda.client.entities;
1818

1919
import net.dv8tion.jda.client.managers.ApplicationManager;
20-
import net.dv8tion.jda.client.managers.ApplicationManagerUpdatable;
2120
import net.dv8tion.jda.core.JDA;
2221
import net.dv8tion.jda.core.Permission;
2322
import net.dv8tion.jda.core.entities.ISnowflake;
@@ -143,21 +142,6 @@ public interface Application extends ISnowflake
143142
*/
144143
ApplicationManager getManager();
145144

146-
/**
147-
* Returns the {@link net.dv8tion.jda.client.managers.ApplicationManagerUpdatable ApplicationManagerUpdatable} for this Application.
148-
* In the ApplicationManager, you can modify things like the name and icon of this Application.
149-
* <br>This can be used to bulk update application settings.
150-
*
151-
* @return The ApplicationManagerUpdatable of this Application
152-
*
153-
* @see #getManager()
154-
*
155-
* @deprecated
156-
* Use {@link #getManager()} instead
157-
*/
158-
@Deprecated
159-
ApplicationManagerUpdatable getManagerUpdatable();
160-
161145
/**
162146
* The name of this application.
163147
* <br>The application name is <b>not</b> necessarily the same as the bot's name!

src/main/java/net/dv8tion/jda/client/entities/impl/ApplicationImpl.java

-19
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public class ApplicationImpl implements Application
3434
private final JDA api;
3535
private final Object mngLock = new Object();
3636
private ApplicationManager manager;
37-
@Deprecated
38-
private net.dv8tion.jda.client.managers.ApplicationManagerUpdatable managerUpdatable;
3937

4038
private BotImpl bot;
4139
private String description;
@@ -162,23 +160,6 @@ public ApplicationManager getManager()
162160
return mng;
163161
}
164162

165-
@Override
166-
@Deprecated
167-
public net.dv8tion.jda.client.managers.ApplicationManagerUpdatable getManagerUpdatable()
168-
{
169-
net.dv8tion.jda.client.managers.ApplicationManagerUpdatable mng = managerUpdatable;
170-
if (mng == null)
171-
{
172-
synchronized (mngLock)
173-
{
174-
mng = managerUpdatable;
175-
if (mng == null)
176-
mng = managerUpdatable = new net.dv8tion.jda.client.managers.ApplicationManagerUpdatable(this);
177-
}
178-
}
179-
return mng;
180-
}
181-
182163
@Override
183164
public String getName()
184165
{

0 commit comments

Comments
 (0)