Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Commit 4bfa288

Browse files
authored
release(v0.6.1): Prepare Release
2 parents ee68c63 + e646d12 commit 4bfa288

Some content is hidden

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

60 files changed

+1260
-1208
lines changed

.travis.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ cache:
1212
- $HOME/.gradle/caches/
1313
- $HOME/.gradle/wrapper/
1414

15-
before_install: chmod +x ./gradlew
15+
install: chmod +x ./gradlew
1616

1717
before_script:
1818
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1919
- chmod +x ./cc-test-reporter
2020
- ./cc-test-reporter before-build
21-
script: ./gradlew check
21+
script: ./gradlew test
2222
after_script: ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
2323

2424
jobs:
2525
include:
2626
- stage: deploy
27-
name: "Documentation"
27+
name: "Documentation Deploy"
2828
jdk: openjdk11
2929
script: ./gradlew publishDoc
3030
if: tag IS present
31-
deploy: &pages
31+
deploy:
3232
provider: pages
3333
repo: GlitchLib/docs
3434
target-branch: master
@@ -41,17 +41,19 @@ jobs:
4141
on:
4242
tags: true
4343
- stage: deploy
44-
name: "Upload to Bintray"
44+
name: "Bintray Upload"
4545
jdk: openjdk8
46-
install: skip
47-
script: ./gradlew bintrayUpload publishRelease -x test
46+
script: ./gradlew bintrayUpload -x test
4847
if: tag IS present
49-
deploy: &releases
48+
- stage: deploy
49+
name: "Create Release"
50+
jdk: openjdk8
51+
script: ./gradlew publishRelease
52+
if: tag IS present
53+
deploy:
5054
provider: releases
5155
api_key: $GITHUB_TOKEN
5256
file_glob: true
53-
file: ./build/release/*.jar
54-
prerelease: true
55-
skip_cleanup: true
56-
on:
57-
tags: true
57+
file: build/release/*
58+
draft: true
59+
skip_cleanup: true

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ A hybrid-reactive Java wrapper for the Twitch. Supports using:
1616
* [Gson](https://github.com/google/gson) - JSON
1717
* [Project Reactor](http://projectreactor.io/)
1818

19-
# Module Supports
20-
| Name | JVM | Android |
21-
|:---:|:---:|:---:|
22-
| [glitch-core](core) | 1.8+ | ✔ SDK 26 |
23-
| [glitch-kraken](kraken) | 1.8+ | ✔ SDK 26 |
24-
| [glitch-helix](helix) | 1.8+ | ✔ SDK 26 |
25-
| [glitch-auth](auth) | 1.8+ | ✔ SDK 26 |
26-
| [glitch-chat](chat) | 1.8+ ||
27-
| [glitch-pubsub](pubsub) | 1.8+ ||
28-
2919
# Getting started
3020

3121
Please introduce the [wiki page](https://glitchlib.github.io/wiki/getting-started/welcome/)

all/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tasks {
3737
sourceDirs = files(projectList.flatMap { it.sourceSets.main.get().allSource }.filter { it.name.endsWith(".kt") }.toList())
3838
classpath = files(projectList.flatMap { it.tasks.getByName<DokkaTask>("dokka").classpath }.toList())
3939
}
40-
40+
4141
withType<ShadowJar> {
4242
enabled = true
4343
}

build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import com.jfrog.bintray.gradle.BintrayExtension
32
import org.jetbrains.dokka.gradle.DokkaTask
43
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
54
import java.text.SimpleDateFormat
65
import java.util.*
76

87
plugins {
8+
jacoco
99
`maven-publish`
10+
kotlin("jvm") version "1.3.21"
1011
id("com.jfrog.bintray") version "1.8.4"
1112
id("org.jetbrains.dokka") version "0.9.17"
12-
id("org.jetbrains.kotlin.jvm") version "1.3.21"
1313
id("com.github.ben-manes.versions") version "0.20.0"
14-
id("com.github.johnrengelman.shadow") version "4.0.3"
14+
id("com.github.johnrengelman.shadow") version "4.0.4"
1515
id("com.gorylenko.gradle-git-properties") version "2.0.0" apply false
1616
}
1717

@@ -34,6 +34,7 @@ allprojects {
3434

3535
subprojects {
3636
apply(plugin = "java")
37+
apply(plugin = "jacoco")
3738
apply(plugin = "maven-publish")
3839
apply(plugin = "com.jfrog.bintray")
3940
apply(plugin = "org.jetbrains.dokka")
@@ -50,7 +51,7 @@ subprojects {
5051
dependencies {
5152
if (!arrayOf("bom", "all", "auth", rootProject.name).contains(project.name)) {
5253
// https://docs.gradle.org/5.0/userguide/managing_transitive_dependencies.html#sec:bom_import
53-
compile(enforcedPlatform("io.projectreactor:reactor-bom:Californium-SR4"))
54+
compile(enforcedPlatform("io.projectreactor:reactor-bom:Californium-SR5"))
5455

5556
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
5657
compile("org.jetbrains.kotlin:kotlin-reflect")

chat/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
dependencies {
22
compileOnly(project(":core"))
3-
compileOnly(project(":kraken"))
43

54
testCompile(project(":core"))
6-
testCompile(project(":kraken"))
75
}

chat/src/main/java/glitch/chat/Colors.java

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,71 @@
33
import java.awt.Color;
44

55
/**
6+
* Default Twitch Colors
7+
*
68
* @author Damian Staszewski [damian@stachuofficial.tv]
79
* @version %I%, %G%
810
* @since 1.0
911
*/
1012
public class Colors {
11-
public static Color Red = Color.decode("#FF0000");
12-
public static Color Blue = Color.decode("#0000FF");
13-
public static Color Green = Color.decode("#00FF00");
14-
public static Color FireBrick = Color.decode("#B22222");
15-
public static Color Coral = Color.decode("#FF7F50");
16-
public static Color YellowGreen = Color.decode("#9ACD32");
17-
public static Color OrangeRed = Color.decode("#FF4500");
18-
public static Color SeaGreen = Color.decode("#2E8B57");
19-
public static Color GoldenRod = Color.decode("#DAA520");
20-
public static Color Chocolate = Color.decode("#D2691E");
21-
public static Color CadetBlue = Color.decode("#5F9EA0");
22-
public static Color DodgerBlue = Color.decode("#1E90FF");
23-
public static Color HotPink = Color.decode("#FF69B4");
24-
public static Color BlueViolet = Color.decode("#8A2BE2");
25-
public static Color SpringGreen = Color.decode("#00FF7F");
13+
/**
14+
* Red
15+
*/
16+
public static Color RED = Color.decode("#FF0000");
17+
/**
18+
* Blue
19+
*/
20+
public static Color BLUE = Color.decode("#0000FF");
21+
/**
22+
* Green
23+
*/
24+
public static Color GREEN = Color.decode("#00FF00");
25+
/**
26+
* Fire Brick
27+
*/
28+
public static Color FIRE_BRICK = Color.decode("#B22222");
29+
/**
30+
* Coral
31+
*/
32+
public static Color CORAL = Color.decode("#FF7F50");
33+
/**
34+
* Yellow Green
35+
*/
36+
public static Color YELLOW_GREEN = Color.decode("#9ACD32");
37+
/**
38+
* Orange Red
39+
*/
40+
public static Color ORANGE_RED = Color.decode("#FF4500");
41+
/**
42+
* Sea Green
43+
*/
44+
public static Color SEA_GREEN = Color.decode("#2E8B57");
45+
/**
46+
* Golden Rod
47+
*/
48+
public static Color GOLDEN_ROD = Color.decode("#DAA520");
49+
/**
50+
* Chocolate
51+
*/
52+
public static Color CHOCOLATE = Color.decode("#D2691E");
53+
/**
54+
* Cadet Blue
55+
*/
56+
public static Color CADET_BLUE = Color.decode("#5F9EA0");
57+
/**
58+
* Dodger Blue
59+
*/
60+
public static Color DODGER_BLUE = Color.decode("#1E90FF");
61+
/**
62+
* Hot Pink
63+
*/
64+
public static Color HOT_PINK = Color.decode("#FF69B4");
65+
/**
66+
* Blue Violet
67+
*/
68+
public static Color BLUE_VIOLET = Color.decode("#8A2BE2");
69+
/**
70+
* Spring Green
71+
*/
72+
public static Color SPRING_GREEN = Color.decode("#00FF7F");
2673
}

chat/src/main/java/glitch/chat/GlitchChat.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import glitch.chat.events.IRCEvent;
1010
import glitch.chat.exceptions.AlreadyJoinedChannelException;
1111
import glitch.chat.exceptions.NotJoinedChannelException;
12+
import glitch.chat.irc.TmiConverter;
1213
import glitch.service.ISocketService;
1314
import java.util.*;
1415
import java.util.concurrent.CompletableFuture;
15-
import java.util.concurrent.ExecutionException;
1616
import java.util.concurrent.Executors;
1717
import java.util.concurrent.atomic.AtomicBoolean;
1818
import okhttp3.logging.HttpLoggingInterceptor;
@@ -57,7 +57,7 @@ private GlitchChat(
5757
this.client = client;
5858
this.ws = WebSocket.builder(this)
5959
.addInterceptor(new HttpLoggingInterceptor(LOG::debug).setLevel(HttpLoggingInterceptor.Level.BASIC))
60-
.setEventConverter(TmiConverter.create())
60+
.setEventConverter(new TmiConverter())
6161
.setEventProcessor(eventProcessor)
6262
.setEventScheduler(scheduler)
6363
.build((secure) ? URI_SECURE : URI);
@@ -69,7 +69,7 @@ private GlitchChat(
6969
this.ws.onEvent(PingEvent.class)
7070
.subscribe(ping -> {
7171
if (!configuration.isDisableAutoPing()) {
72-
this.ws.send(Mono.just("PONG :tmi.twitch.tv"));
72+
this.ws.send(Mono.just("PONG :tmi.twitch.tv")).subscribe();
7373
}
7474
});
7575
}
@@ -89,10 +89,7 @@ public GlitchClient getClient() {
8989

9090
@Override
9191
public Mono<Void> login() {
92-
// TODO: Whispers
93-
// if (!channels.contains("jtv")) {
94-
// channels.add("jtv");
95-
// }
92+
// channels.add("jtv");
9693

9794
return this.ws.connect()
9895
.then(doInit());
@@ -128,6 +125,11 @@ public <E extends IEvent<GlitchChat>> Flux<E> onEvent(Class<E> type) {
128125
return this.ws.onEvent(type);
129126
}
130127

128+
@Override
129+
public Flux<IEvent<GlitchChat>> onEvents() {
130+
return this.ws.onEvents();
131+
}
132+
131133
public Mono<Void> sendChannel(String channel, Publisher<String> message) throws NotJoinedChannelException {
132134
final String fchannel = (channel.startsWith("#")) ?
133135
channel.substring(1) : channel;
@@ -246,12 +248,12 @@ public Mono<GlitchChat> buildAsync() {
246248
});
247249
}
248250

249-
public GlitchChat build() throws ExecutionException, InterruptedException, RuntimeException {
251+
public GlitchChat build() {
250252
return new CompletableFuture<GlitchChat>() {
251253
{
252254
buildAsync().subscribe(this::complete);
253255
}
254-
}.get();
256+
}.join();
255257
}
256258

257259
private Mono<Credential> createBotConfig() {

chat/src/main/java/glitch/chat/TmiConverter.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

chat/src/main/kotlin/glitch/chat/ChatUtils.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import glitch.api.ws.events.IEvent
44
import glitch.api.ws.events.PingEvent
55
import glitch.api.ws.events.PongEvent
66
import glitch.chat.events.*
7+
import glitch.chat.irc.Command
8+
import glitch.chat.events.IRCEvent
79
import java.util.*
810

911
/**
@@ -82,7 +84,7 @@ internal object ChatUtils {
8284
val username = event.prefix.nick!!
8385
val displayName = event.tags["display-name"]!!
8486
val timestamp = event.tags.sentTimestamp
85-
val id = UUID.fromString(event.tags["id"]!!)
87+
val id = event.tags.getInteger("id")
8688
val userId = event.tags.getLong("user-id")
8789

8890
event.client.ws.dispatch(PrivateMessageEvent(

0 commit comments

Comments
 (0)