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

Commit

Permalink
release(v0.6.1): Prepare Release
Browse files Browse the repository at this point in the history
  • Loading branch information
stachu540 authored Feb 24, 2019
2 parents ee68c63 + e646d12 commit 4bfa288
Show file tree
Hide file tree
Showing 60 changed files with 1,260 additions and 1,208 deletions.
28 changes: 15 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_install: chmod +x ./gradlew
install: chmod +x ./gradlew

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

jobs:
include:
- stage: deploy
name: "Documentation"
name: "Documentation Deploy"
jdk: openjdk11
script: ./gradlew publishDoc
if: tag IS present
deploy: &pages
deploy:
provider: pages
repo: GlitchLib/docs
target-branch: master
Expand All @@ -41,17 +41,19 @@ jobs:
on:
tags: true
- stage: deploy
name: "Upload to Bintray"
name: "Bintray Upload"
jdk: openjdk8
install: skip
script: ./gradlew bintrayUpload publishRelease -x test
script: ./gradlew bintrayUpload -x test
if: tag IS present
deploy: &releases
- stage: deploy
name: "Create Release"
jdk: openjdk8
script: ./gradlew publishRelease
if: tag IS present
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: ./build/release/*.jar
prerelease: true
skip_cleanup: true
on:
tags: true
file: build/release/*
draft: true
skip_cleanup: true
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ A hybrid-reactive Java wrapper for the Twitch. Supports using:
* [Gson](https://github.com/google/gson) - JSON
* [Project Reactor](http://projectreactor.io/)

# Module Supports
| Name | JVM | Android |
|:---:|:---:|:---:|
| [glitch-core](core) | 1.8+ | ✔ SDK 26 |
| [glitch-kraken](kraken) | 1.8+ | ✔ SDK 26 |
| [glitch-helix](helix) | 1.8+ | ✔ SDK 26 |
| [glitch-auth](auth) | 1.8+ | ✔ SDK 26 |
| [glitch-chat](chat) | 1.8+ ||
| [glitch-pubsub](pubsub) | 1.8+ ||

# Getting started

Please introduce the [wiki page](https://glitchlib.github.io/wiki/getting-started/welcome/)
Expand Down
2 changes: 1 addition & 1 deletion all/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tasks {
sourceDirs = files(projectList.flatMap { it.sourceSets.main.get().allSource }.filter { it.name.endsWith(".kt") }.toList())
classpath = files(projectList.flatMap { it.tasks.getByName<DokkaTask>("dokka").classpath }.toList())
}

withType<ShadowJar> {
enabled = true
}
Expand Down
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.jfrog.bintray.gradle.BintrayExtension
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.text.SimpleDateFormat
import java.util.*

plugins {
jacoco
`maven-publish`
kotlin("jvm") version "1.3.21"
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "0.9.17"
id("org.jetbrains.kotlin.jvm") version "1.3.21"
id("com.github.ben-manes.versions") version "0.20.0"
id("com.github.johnrengelman.shadow") version "4.0.3"
id("com.github.johnrengelman.shadow") version "4.0.4"
id("com.gorylenko.gradle-git-properties") version "2.0.0" apply false
}

Expand All @@ -34,6 +34,7 @@ allprojects {

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

compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
Expand Down
2 changes: 0 additions & 2 deletions chat/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
dependencies {
compileOnly(project(":core"))
compileOnly(project(":kraken"))

testCompile(project(":core"))
testCompile(project(":kraken"))
}
77 changes: 62 additions & 15 deletions chat/src/main/java/glitch/chat/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,71 @@
import java.awt.Color;

/**
* Default Twitch Colors
*
* @author Damian Staszewski [damian@stachuofficial.tv]
* @version %I%, %G%
* @since 1.0
*/
public class Colors {
public static Color Red = Color.decode("#FF0000");
public static Color Blue = Color.decode("#0000FF");
public static Color Green = Color.decode("#00FF00");
public static Color FireBrick = Color.decode("#B22222");
public static Color Coral = Color.decode("#FF7F50");
public static Color YellowGreen = Color.decode("#9ACD32");
public static Color OrangeRed = Color.decode("#FF4500");
public static Color SeaGreen = Color.decode("#2E8B57");
public static Color GoldenRod = Color.decode("#DAA520");
public static Color Chocolate = Color.decode("#D2691E");
public static Color CadetBlue = Color.decode("#5F9EA0");
public static Color DodgerBlue = Color.decode("#1E90FF");
public static Color HotPink = Color.decode("#FF69B4");
public static Color BlueViolet = Color.decode("#8A2BE2");
public static Color SpringGreen = Color.decode("#00FF7F");
/**
* Red
*/
public static Color RED = Color.decode("#FF0000");
/**
* Blue
*/
public static Color BLUE = Color.decode("#0000FF");
/**
* Green
*/
public static Color GREEN = Color.decode("#00FF00");
/**
* Fire Brick
*/
public static Color FIRE_BRICK = Color.decode("#B22222");
/**
* Coral
*/
public static Color CORAL = Color.decode("#FF7F50");
/**
* Yellow Green
*/
public static Color YELLOW_GREEN = Color.decode("#9ACD32");
/**
* Orange Red
*/
public static Color ORANGE_RED = Color.decode("#FF4500");
/**
* Sea Green
*/
public static Color SEA_GREEN = Color.decode("#2E8B57");
/**
* Golden Rod
*/
public static Color GOLDEN_ROD = Color.decode("#DAA520");
/**
* Chocolate
*/
public static Color CHOCOLATE = Color.decode("#D2691E");
/**
* Cadet Blue
*/
public static Color CADET_BLUE = Color.decode("#5F9EA0");
/**
* Dodger Blue
*/
public static Color DODGER_BLUE = Color.decode("#1E90FF");
/**
* Hot Pink
*/
public static Color HOT_PINK = Color.decode("#FF69B4");
/**
* Blue Violet
*/
public static Color BLUE_VIOLET = Color.decode("#8A2BE2");
/**
* Spring Green
*/
public static Color SPRING_GREEN = Color.decode("#00FF7F");
}
20 changes: 11 additions & 9 deletions chat/src/main/java/glitch/chat/GlitchChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import glitch.chat.events.IRCEvent;
import glitch.chat.exceptions.AlreadyJoinedChannelException;
import glitch.chat.exceptions.NotJoinedChannelException;
import glitch.chat.irc.TmiConverter;
import glitch.service.ISocketService;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
import okhttp3.logging.HttpLoggingInterceptor;
Expand Down Expand Up @@ -57,7 +57,7 @@ private GlitchChat(
this.client = client;
this.ws = WebSocket.builder(this)
.addInterceptor(new HttpLoggingInterceptor(LOG::debug).setLevel(HttpLoggingInterceptor.Level.BASIC))
.setEventConverter(TmiConverter.create())
.setEventConverter(new TmiConverter())
.setEventProcessor(eventProcessor)
.setEventScheduler(scheduler)
.build((secure) ? URI_SECURE : URI);
Expand All @@ -69,7 +69,7 @@ private GlitchChat(
this.ws.onEvent(PingEvent.class)
.subscribe(ping -> {
if (!configuration.isDisableAutoPing()) {
this.ws.send(Mono.just("PONG :tmi.twitch.tv"));
this.ws.send(Mono.just("PONG :tmi.twitch.tv")).subscribe();
}
});
}
Expand All @@ -89,10 +89,7 @@ public GlitchClient getClient() {

@Override
public Mono<Void> login() {
// TODO: Whispers
// if (!channels.contains("jtv")) {
// channels.add("jtv");
// }
// channels.add("jtv");

return this.ws.connect()
.then(doInit());
Expand Down Expand Up @@ -128,6 +125,11 @@ public <E extends IEvent<GlitchChat>> Flux<E> onEvent(Class<E> type) {
return this.ws.onEvent(type);
}

@Override
public Flux<IEvent<GlitchChat>> onEvents() {
return this.ws.onEvents();
}

public Mono<Void> sendChannel(String channel, Publisher<String> message) throws NotJoinedChannelException {
final String fchannel = (channel.startsWith("#")) ?
channel.substring(1) : channel;
Expand Down Expand Up @@ -246,12 +248,12 @@ public Mono<GlitchChat> buildAsync() {
});
}

public GlitchChat build() throws ExecutionException, InterruptedException, RuntimeException {
public GlitchChat build() {
return new CompletableFuture<GlitchChat>() {
{
buildAsync().subscribe(this::complete);
}
}.get();
}.join();
}

private Mono<Credential> createBotConfig() {
Expand Down
32 changes: 0 additions & 32 deletions chat/src/main/java/glitch/chat/TmiConverter.java

This file was deleted.

4 changes: 3 additions & 1 deletion chat/src/main/kotlin/glitch/chat/ChatUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import glitch.api.ws.events.IEvent
import glitch.api.ws.events.PingEvent
import glitch.api.ws.events.PongEvent
import glitch.chat.events.*
import glitch.chat.irc.Command
import glitch.chat.events.IRCEvent
import java.util.*

/**
Expand Down Expand Up @@ -82,7 +84,7 @@ internal object ChatUtils {
val username = event.prefix.nick!!
val displayName = event.tags["display-name"]!!
val timestamp = event.tags.sentTimestamp
val id = UUID.fromString(event.tags["id"]!!)
val id = event.tags.getInteger("id")
val userId = event.tags.getLong("user-id")

event.client.ws.dispatch(PrivateMessageEvent(
Expand Down
Loading

0 comments on commit 4bfa288

Please sign in to comment.