Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDA v4 support #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ buildscript {
}
}
dependencies {
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.7'
classpath 'com.gradle.publish:plugin-publish-plugin:0.10.1'
}
}

plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.7.3'
id 'com.jfrog.bintray' version '1.8.4'
}

apply plugin: 'com.gradle.plugin-publish'

group 'com.sedmelluq'
ext.moduleName = 'jdaction'
version = '1.0.2'
version = '1.0.3'

repositories {
jcenter()
}

dependencies {
compile gradleApi()
compile 'org.ow2.asm:asm-debug-all:5.0.3'
implementation gradleApi()
implementation 'org.ow2.asm:asm-debug-all:6.0_BETA'
}

gradlePlugin {
Expand Down Expand Up @@ -68,4 +68,4 @@ pluginBundle {
artifactId = moduleName
version = project.version
}
}
}
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Dec 20 23:58:45 EET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
19 changes: 8 additions & 11 deletions src/main/java/com/sedmelluq/discord/jdaction/NoActionPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sedmelluq.discord.jdaction;

import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.FileCollection;
import org.gradle.api.internal.ConventionMapping;
import org.gradle.api.plugins.quality.CodeQualityExtension;
Expand All @@ -21,6 +21,11 @@ protected Class<NoActionVerificationTask> getTaskType() {
return NoActionVerificationTask.class;
}

@Override
protected void configureConfiguration(Configuration configuration) {

}

@Override
protected CodeQualityExtension createExtension() {
extension = project.getExtensions().create("jdaction", Extension.class, project);
Expand All @@ -32,16 +37,8 @@ protected void configureForSourceSet(SourceSet sourceSet, NoActionVerificationTa
task.setSource(sourceSet.getAllJava());

ConventionMapping taskMapping = task.getConventionMapping();
taskMapping.map("classes", new Callable<FileCollection>() {
@Override
public FileCollection call() {
return project.fileTree(sourceSet.getOutput().getClassesDir()).builtBy(sourceSet.getOutput());
}
});

for (Task classesTask : project.getTasksByName(sourceSet.getClassesTaskName(), false)) {
classesTask.finalizedBy(task.getPath());
}
taskMapping.map("classes", (Callable<FileCollection>) () -> project.fileTree(sourceSet.getOutput().getClassesDirs()).builtBy(sourceSet.getOutput()));
project.getTasksByName(sourceSet.getClassesTaskName(), false).forEach(classesTask -> classesTask.finalizedBy(task.getPath()));
}

public static class Extension extends CodeQualityExtension {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class NoActionTargetDetector {
);

public static boolean isRestActionDescriptor(String descriptor) {
if (descriptor.endsWith(")Lnet/dv8tion/jda/core/requests/RestAction;")) {
if (descriptor.endsWith(")Lnet/dv8tion/jda/api/requests/RestAction;")) {
return true;
}

Expand Down