Skip to content

Commit

Permalink
Generate listener manager methods into own interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Jul 31, 2018
1 parent 79b7c48 commit 0d592b3
Show file tree
Hide file tree
Showing 29 changed files with 786 additions and 5,162 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ apply from: 'gradle/jars.gradle'
apply from: 'gradle/java9.gradle'
apply from: 'gradle/tests.gradle'
apply from: 'gradle/javadoc.gradle'
apply from: 'gradle/listener-manager-generation.gradle'
apply from: 'gradle/readme.gradle'
apply from: 'gradle/publishing.gradle'
6 changes: 4 additions & 2 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://checkstyle.sourceforge.net/dtds/suppressions_1_1.dtd">
"-//Puppy Crawl//DTD Suppressions 1.2//EN"
"http://checkstyle.sourceforge.net/dtds/suppressions_1_2.dtd">

<suppressions>
<suppress id="finalizer" files=".*[\\/]DiscordApiImpl.java$" />
<suppress checks="LineLength|CustomImportOrder|OverloadMethodsDeclarationOrder|Indentation"
files="[\\/]build[\\/][^\\/]+[\\/]generated[\\/]" />
</suppressions>
8 changes: 8 additions & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ allprojects {
}
}

project(':javacord-api') {
dependencies {
// For old Generated annotation in Java 9
// can be replaced by javax.annotation.processing.Generated if Java 9 is minimum requirement
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
}
}

project(':javacord-core') {
dependencies {
// OkHttp for REST-calls
Expand Down
10 changes: 8 additions & 2 deletions gradle/java9.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ buildscript {

if (JavaVersion.current().java9Compatible) {
subprojects {
task compileJava9(type: JavaCompile, dependsOn: sourceSets.main.runtimeClasspath) {
task compileJava9(type: JavaCompile, dependsOn: [sourceSets.main.compileClasspath,
sourceSets.main.runtimeClasspath]) {
description 'Compiles main Java 9 source'
source sourceSets.main.java
source 'src/main/java9/'
Expand All @@ -33,7 +34,7 @@ if (JavaVersion.current().java9Compatible) {
// access SourceDirectorySet#asPath in afterEvaluate
// or projects get evaluated before all configuration is done
options.compilerArgs << '--module-path'
options.compilerArgs << sourceSets.main.runtimeClasspath.asPath
options.compilerArgs << (sourceSets.main.compileClasspath + sourceSets.main.runtimeClasspath).asPath
}
}

Expand All @@ -49,6 +50,11 @@ if (JavaVersion.current().java9Compatible) {
}

project(':javacord-api') {
compileJava9 {
options.compilerArgs << '--add-modules' << 'java.annotation'
options.compilerArgs << '--add-reads' << 'org.javacord.api=java.annotation'
}

task generateModuleInfo {
ext.outputDirectory = "$buildDir/generated/module-info"

Expand Down
632 changes: 632 additions & 0 deletions gradle/listener-manager-generation.gradle

Large diffs are not rendered by default.

Loading

0 comments on commit 0d592b3

Please sign in to comment.