Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

[Feature] Implementation of the public discord statuspage api #55

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
gradlew binary
gradlew.bat binary
/gradle/wrapper/gradle-wrapper.properties binary

.gitattributes text eol=crlf

Expand Down
15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,29 @@ allprojects {
slf4jVersion = '1.7.25'
okhttpVersion = '3.9.1'
findbugsVersion = '3.0.2'
jsonVersion = '20180130'
junitVersion = '4.12'

jda = { project.dependencies.compileOnly group: 'net.dv8tion', name: 'JDA', version: jdaVersion }
jda = {
project.dependencies.compileOnly group: 'net.dv8tion', name: 'JDA', version: jdaVersion
project.dependencies.testCompile group: 'net.dv8tion', name: 'JDA', version: jdaVersion
}
slf4j = { project.dependencies.compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion }
okhttp = { project.dependencies.compile group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttpVersion }
findbugs = { project.dependencies.compile group: 'com.google.code.findbugs', name: 'jsr305', version: findbugsVersion }

include = { String name -> project.dependencies.compile project.project(':' + name) }
json = { project.dependencies.compile group: 'org.json', name: 'json', version: jsonVersion }
junit = { project.dependencies.testCompile group: 'junit', name: 'junit', version: junitVersion }

artifactId = (rootProject == project ? rootProject.name : (rootProject.name + '-' + project.name)).toLowerCase()

moduleName = rootProject == project ? "com.jagrosh.jdautilities" :
"com.jagrosh.jdautilities.${project.name.toLowerCase()}"
}

rootProject.subprojects.each { subproject ->
project.ext."$subproject.name" = { project.dependencies.compile project.project(":$subproject.name") }
}

repositories {
jcenter()
}
Expand Down
2 changes: 1 addition & 1 deletion command/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
dependencies {
include('commons')
commons()

jda()
slf4j()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.jagrosh.jdautilities.commons.async;

import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;

public interface AsyncFuture<T> extends Future<T>, CompletionStage<T> {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.jagrosh.jdautilities.commons.async;

import java.util.concurrent.CompletableFuture;

public class AsyncTask<T> extends CompletableFuture<T> implements AsyncFuture<T>
{
@Override
public CompletableFuture<T> toCompletableFuture()
{
throw new UnsupportedOperationException("Access to the CompletableFuture is not supported.");
}
}
2 changes: 1 addition & 1 deletion doc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
dependencies {
include('commons')
commons()

jda()
}
8 changes: 4 additions & 4 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/
dependencies {
include('commons')
include('command')
include('menu')
include('doc')
commons()
command()
menu()
doc()

jda()
slf4j()
Expand Down
19 changes: 2 additions & 17 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
#
# Copyright 2016-2018 John Grosh (jagrosh) & Kaidan Gustave (TheMonitorLizard)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
2 changes: 1 addition & 1 deletion menu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
dependencies {
include('commons')
commons()

jda()
findbugs()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/
rootProject.name = 'JDA-Utilities'

include 'commons', 'menu', 'command', 'doc', 'examples'
include 'commons', 'menu', 'command', 'doc', 'examples', 'statuspage'
3 changes: 3 additions & 0 deletions statuspage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Statuspage Package

This API can be used to retrieve data from [https://status.discordapp.com](https://status.discordapp.com).
24 changes: 24 additions & 0 deletions statuspage/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2016-2018 John Grosh (jagrosh) & Kaidan Gustave (TheMonitorLizard)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
commons()

okhttp()
json()
findbugs()

junit()
}
Loading