This repository has been archived by the owner on Apr 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from GlitchLib/dev
release(v0.5.0): Release Kotlin Support
- Loading branch information
Showing
417 changed files
with
7,910 additions
and
7,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
language: java | ||
jdk: | ||
- openjdk8 | ||
- openjdk11 | ||
- openjdk8 | ||
- openjdk11 | ||
|
||
before_cache: | ||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock | ||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ | ||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock | ||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ | ||
|
||
cache: | ||
directories: | ||
- $HOME/.gradle/caches/ | ||
- $HOME/.gradle/wrapper/ | ||
- $HOME/.gradle/caches/ | ||
- $HOME/.gradle/wrapper/ | ||
|
||
before_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 | ||
- 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 | ||
after_script: ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT | ||
|
||
jobs: | ||
include: | ||
- stage: deploy | ||
jdk: openjdk11 | ||
install: chmod +x ./javadoc.sh | ||
script: ./javadoc.sh | ||
if: tag IS present | ||
- stage: deploy | ||
jdk: openjdk8 | ||
install: skip | ||
script: ./gradlew bintrayUpload -x test | ||
if: tag IS present | ||
- stage: deploy | ||
jdk: openjdk11 | ||
install: chmod +x ./javadoc.sh | ||
script: ./javadoc.sh | ||
if: tag IS present | ||
- stage: deploy | ||
jdk: openjdk8 | ||
install: skip | ||
script: ./gradlew bintrayUpload -x test | ||
if: tag IS present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import java.util.stream.Collectors | ||
|
||
def projectList = rootProject.subprojects.stream().filter { | ||
!["bom", "auth", name].contains(it.name) | ||
}.collect(Collectors.toSet()) | ||
|
||
dependencies { | ||
projectList.each { | ||
compile(it) | ||
} | ||
} | ||
|
||
sourceJar.enabled = false | ||
|
||
javadoc { | ||
failOnError false | ||
title = "Gltich ${rootProject.version} API" | ||
|
||
options { | ||
windowTitle = "Glitch ${rootProject.version}" | ||
addStringOption "Xdoclint:none", "-quiet" | ||
author true | ||
} | ||
projectList.each { | ||
source += it.javadoc.source | ||
classpath += it.javadoc.classpath | ||
excludes += it.javadoc.excludes | ||
includes += it.javadoc.includes | ||
} | ||
} | ||
|
||
dokka { | ||
moduleName = rootProject.name | ||
sourceDirs = projectList.stream().flatMap { it.dokka.sourceDirs.stream() }.collect(Collectors.toList()) | ||
sourceRoots = projectList.stream().flatMap { it.dokka.sourceRoots.stream() }.collect(Collectors.toList()) | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
import java.text.SimpleDateFormat | ||
|
||
plugins { | ||
id "net.ltgt.apt" version "0.19" | ||
id "com.jfrog.bintray" version "1.8.4" | ||
id "de.lukaskoerfer.gradle.delombok" version "0.2" | ||
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.gorylenko.gradle-git-properties" version "2.0.0" apply false | ||
} | ||
|
||
allprojects { | ||
apply plugin: "net.ltgt.apt" | ||
apply plugin: "net.ltgt.apt-idea" | ||
apply plugin: "net.ltgt.apt-eclipse" | ||
apply plugin: "de.lukaskoerfer.gradle.delombok" | ||
def timestamp() { | ||
def sdf = new SimpleDateFormat("MMM dd yyyy HH:mm:ss zzz", Locale.ENGLISH) | ||
sdf.setTimeZone(TimeZone.getTimeZone("GMT")) | ||
return sdf.format(new Date()) | ||
} | ||
|
||
def bintrayUser = System.getenv("BINTRAY_USER") ?: findProperty("bintray.user").toString() | ||
def bintrayApiKey = System.getenv("BINTRAY_API_KEY") ?: findProperty("bintray.api_key").toString() | ||
def sonatypeUser = System.getenv("CENTRAL_USER") ?: findProject("central.user").toString() | ||
def sonatypePassword = System.getenv("CENTRAL_PASSWORD") ?: findProject("central.password").toString() | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
|
@@ -18,41 +31,201 @@ allprojects { | |
subprojects { | ||
apply plugin: "java" | ||
apply plugin: "maven-publish" | ||
apply plugin: "com.jfrog.bintray" | ||
apply plugin: "org.jetbrains.dokka" | ||
apply plugin: "org.jetbrains.kotlin.jvm" | ||
|
||
|
||
tasks.withType(JavaCompile) { | ||
options.incremental = true | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
if (project.name != "docs") { | ||
archivesBaseName = "${rootProject.name.toLowerCase()}-${project.name.replace(':', '-')}" | ||
tasks.withType(KotlinCompile) { | ||
incremental = true | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
|
||
archivesBaseName = "${rootProject.name.toLowerCase()}-${project.name.replace(':', '-')}" | ||
sourceCompatibility = targetCompatibility = 1.8 | ||
|
||
dependencies { | ||
if (project.name != "BOM" && project.name != "docs") { | ||
// https://docs.gradle.org/5.0/userguide/managing_transitive_dependencies.html#sec:bom_import | ||
compile enforcedPlatform("io.projectreactor:reactor-bom:Californium-SR3") | ||
if (!["bom", "all", "auth", rootProject.name].contains(project.name)) { | ||
compile enforcedPlatform("io.projectreactor:reactor-bom:Californium-SR4") | ||
|
||
compile "org.slf4j:slf4j-api:1.7.25" | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
compile "org.jetbrains.kotlin:kotlin-reflect" | ||
|
||
compileOnly "org.projectlombok:lombok:1.18.4" | ||
annotationProcessor "org.projectlombok:lombok:1.18.4" | ||
compile "org.slf4j:slf4j-api:1.7.25" | ||
|
||
testCompile "ch.qos.logback:logback-classic:1.2.3" | ||
|
||
testCompile "io.projectreactor:reactor-test" | ||
} | ||
} | ||
|
||
apply from: "${rootDir}/gradle/deploy.gradle" | ||
jar { | ||
manifest { | ||
attributes([ | ||
'Manifest-Version' : '1.0', | ||
'Created-By' : "Gradle ${gradle.gradleVersion} - JDK ${System.getProperty("java.specification.version")} (${System.getProperty("java.version")})", | ||
'Implementation-Title' : rootProject.name, | ||
'Implementation-Vendor' : archivesBaseName, | ||
'Implementation-Version': version, | ||
'Implementation-Date' : timestamp() | ||
]) | ||
} | ||
} | ||
|
||
dokka { | ||
moduleName = archivesBaseName | ||
jdkVersion = 8 | ||
} | ||
|
||
javadoc { | ||
options { | ||
encoding = "UTF-8" | ||
} | ||
exclude "**/*Impl.java" | ||
exclude "**/GsonAdapters*.java" | ||
} | ||
|
||
task sourceJar(type: Jar, dependsOn: classes, description: 'Builds the sources jar.', group: 'build') { | ||
from sourceSets.main.allSource | ||
classifier "sources" | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc, description: 'Builds the javadoc jar.', group: 'build') { | ||
from javadoc.outputDirectory | ||
classifier "javadoc" | ||
} | ||
|
||
task kdocJar(type: Jar, dependsOn: javadoc, description: 'Builds the kotlin-doc jar.', group: 'build') { | ||
dependsOn dokka | ||
from dokka.outputDirectory | ||
classifier "kdoc" | ||
} | ||
|
||
task dependecySize { | ||
if (["bom", "auth"].contains(project.name)) { | ||
enabled = false | ||
} | ||
doLast { | ||
def size = 0 | ||
def formatStr = "%,10.2f" | ||
configurations.default.collect { it.length() / (1024 * 1024) }.each { size += it } | ||
|
||
def out = new StringBuffer() | ||
out << 'Total dependencies size:'.padRight(45) | ||
out << "${String.format(formatStr, size)} MiB\n\n" | ||
|
||
configurations | ||
.default | ||
.sort { -it.length() } | ||
.each { | ||
out << "${it.name}".padRight(45) | ||
out << "${String.format(formatStr, (it.length() / 1024))} KiB\n" | ||
} | ||
println(out) | ||
} | ||
} | ||
|
||
if (project.name != "bom") { | ||
artifacts { | ||
if (project.name != "all") { | ||
archives sourceJar | ||
} | ||
archives javadocJar | ||
archives kdocJar | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
artifactId = archivesBaseName | ||
if (project.name != "bom") { | ||
if (project.name != "all") { | ||
from components.java | ||
artifact sourceJar | ||
} | ||
artifact javadocJar | ||
artifact kdocJar | ||
} | ||
|
||
pom { | ||
url = "https://glitchlib.github.io/" | ||
issueManagement { | ||
system = 'GitHub' | ||
url = 'https://github.com/glitchlib/glitch/issues' | ||
} | ||
ciManagement { | ||
system = "Travis-CI" | ||
url = "https://travis-ci.com/GlitchLib/glitch" | ||
} | ||
inceptionYear = "2018" | ||
developers { | ||
developer { | ||
id = "stachu540" | ||
name = "Damian Staszewski" | ||
url = "https://github.com/stachu540" | ||
timezone = "Europe/Warsaw" | ||
} | ||
} | ||
licenses { | ||
license { | ||
name = "MIT" | ||
url = "https://github.com/GlitchLib/glitch/blob/master/LICENCE.md" | ||
distribution = "repo" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:https://github.com/glitchlib/glitch.git" | ||
developerConnection = "scm:git:[email protected]:glitchlib/glitch.git" | ||
url = "https://github.com/glitchlib/glitch" | ||
} | ||
distributionManagement { | ||
downloadUrl = "https://github.com/glitchlib/glitch/releases" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
bintray { | ||
user = bintrayUser | ||
key = bintrayApiKey | ||
publications = ["maven"] | ||
dryRun = false | ||
publish = true | ||
override = false | ||
pkg { | ||
userOrg = bintrayUser | ||
repo = "GlitchLib" | ||
name = "Glitch" | ||
desc = "Java API Wrapper for Twitch" | ||
licenses = ["MIT"] | ||
publicDownloadNumbers = true | ||
vcsUrl = "https://github.com/GlitchLib/glitch.git" | ||
version { | ||
name = rootProject.version.toString() | ||
vcsTag = "v${rootProject.version}" | ||
released = Calendar.getInstance(TimeZone.getTimeZone("GMT")).time.toInstant().toString() | ||
} | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
shouldRunAfter dependecySize | ||
} | ||
|
||
} | ||
|
||
rootProject.bintrayUpload.enabled = false | ||
rootProject.bintrayPublish.enabled = false | ||
|
||
wrapper { | ||
gradleVersion = "5.0" | ||
gradleVersion = "5.2.1" | ||
distributionType = Wrapper.DistributionType.ALL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
dependencies { | ||
compileOnly project(":core") | ||
compileOnly project(":kraken") | ||
|
||
testCompile project(":core") | ||
testCompile project(":kraken") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package glitch.chat; | ||
|
||
import java.awt.Color; | ||
|
||
/** | ||
* @author Damian Staszewski [[email protected]] | ||
* @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"); | ||
} |
Oops, something went wrong.