Giter Site home page Giter Site logo

endlesscodegroup / bukkitgradle Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 3.0 799 KB

Gradle utilities for easier writing Bukkit plugins

Home Page: https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle

License: MIT License

Groovy 30.45% Kotlin 69.55%
bukkit gradle minecraft paper plugin plugin-development spigot

bukkitgradle's People

Contributors

gfiedler avatar osipxd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bukkitgradle's Issues

Does Bukkit Gradle support CraftBukkit?

Hi,

I am trying to use the CraftBukkit API in my project so I can do some stuff with packets.

plugins {
    id "ru.endlesscode.bukkitgradle" version "0.8.1"
}

dependencies {
    compileOnly bukkit()
    compile project(":common")
    testCompile bukkit()
}

jar {
   baseName = 'openstreetcraft-bukkit'
}

I do realise I am that I am using an older version BukkitGradle and Gradle but I sadly under my circumstances able to upgrade, if it is completely necessary, I could try and update but it would be very tedious. If it is not possible on this version then I will have to upgrade, would just like to know your thoughts.

Thanks

plugin.yml do not contain plugin meta and custom content

Hello,

I have plugin meta in my build.gradle and a plugin.yml in src/main/resources/ with a commands section. When I build the project, the plugin.yml in the build folder contains only the custom meta not the meta in the build.gradle.

Thanks

Paper's API has changed package names

Hello again! I figured you might want this to be separate from the bug report that I had previously opened, for the sake of keeping changelogs a bit more organized - apologies if that is not the case though!

It looks like in between 1.16 and 1.17, Paper changed their package name from com.destroystokyo.paper:paper-api to io.papermc.paper:paper-api their "Using the Paper API" page has been updated to reflect this.

However I suspect this may be a bit tricky to work with the fact that the 1.16 still of course use the old package name, whereas 1.17 uses the new one.

I've temporarily resolved this in my project by just manually specifying compileOnly 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT' in my dependencies, but its worth noting that you'll need to add:

compileJava {
    targetCompatibility = JavaVersion.VERSION_16
    sourceCompatibility = JavaVersion.VERSION_16
}

To your project in order for it to resolve properly

PluginMeta default values

Hello, it's me again. I notice that, you're implemented default values for MetaItems in PluginMeta.groovy, but you are set these items as required. When you compile project without bukkit plugin meta, it will not compile and don't throw any error. Wouldn't be better to set required to false?

Support of Kotlin DSL

Now it is hard to use BukkitGradle with Kotlin DSL. We should provide accessors for Kotlin and examples of usage with Kotlin DSL.

Smarter plugin.yml

At the moment your build script will eat any existing plugin.yml changes, even if the variables havn't been defined correctly in build.gradle

It would be useful if the plugin did not modify plugin.yml attributes that had not been defined.

Failed to apply plugin

The following build.gradle

plugins {
    id "ru.endlesscode.bukkitgradle" version "0.8.0"
}
 
dependencies {
    compileOnly bukkit() 
}

failed with

BuildTools not found on path: '***/build/buildtools/BuildTools.jar'
BuildTools directory should contains BuildTools.jar file.

FAILURE: Build failed with an exception.

* Where:
Build file '***/build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'ru.endlesscode.bukkitgradle', version: '0.8.0']
> Failed to apply plugin [id 'ru.endlesscode.bukkitgradle']
   > No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated.ext() is applicable for argument types: (ru.endlesscode.bukkitgradle.util.Dependencies$_addExtensions_closure2) values: [ru.endlesscode.bukkitgradle.util.Dependencies$_addExtensions_closure2@4cb45acd]
     Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), with(groovy.lang.Closure), each(groovy.lang.Closure)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

CONFIGURE FAILED

Gradle version: 3.2

Bungeecord Chat missing for 1.15.2?

repositories {
    mavenCentral()
    spigot()
    md5()
}
dependencies {
    compileOnly spigotApi()
}
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find net.md-5:bungeecord-chat:1.15-SNAPSHOT.
     Searched in the following locations:
       - file:/home/theaifam5/.m2/repository/net/md-5/bungeecord-chat/1.15-SNAPSHOT/maven-metadata.xml
       - file:/home/theaifam5/.m2/repository/net/md-5/bungeecord-chat/1.15-SNAPSHOT/bungeecord-chat-1.15-SNAPSHOT.pom
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.15-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.15-SNAPSHOT/bungeecord-chat-1.15-SNAPSHOT.pom
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.15-SNAPSHOT/maven-metadata.xml
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.15-SNAPSHOT/bungeecord-chat-1.15-SNAPSHOT.pom
       - http://repo.md-5.net/content/groups/public/net/md-5/bungeecord-chat/1.15-SNAPSHOT/maven-metadata.xml
       - http://repo.md-5.net/content/groups/public/net/md-5/bungeecord-chat/1.15-SNAPSHOT/bungeecord-chat-1.15-SNAPSHOT.pom
     Required by:
         project : > org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT:20200509.094510-108

EDIT:
Based on https://www.spigotmc.org/threads/could-not-find-net-md-5-bungeecord-chat-1-15-snapshot.424976/ it requires maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }

Where to add a custom plugin.yml?

Hi!

Quick issue that I'm having, but I'm not sure where to place my custom plugin.yml file, for BukkitGradle to merge in custom attributes (I'm trying to set the api-version in my case).

I've tried putting it at the root of my project, as well as the src/main, and src/resources folder, but no luck. The documentation doesn't specify where to keep it at.

BukkitGradle is fantastic however, I appreciate the work you've put into it!

apiVersion attribute not being respected

Hello,

I seem to be having an issue with having BukkitGradle pull in the 1.17 builds of Spigot/Paper:

Currently, my plugin's build.gradle file looks something like this:

plugins {
    id "ru.endlesscode.bukkitgradle" version "0.10.0"
}

repositories {
    papermc()
}

dependencies {
    compileOnly(paperApi())
}

bukkit {

    apiVersion = "1.17.1"

    meta {
       ....

    }

    server {
        // Core type. It can be 'spigot' or 'paper'
        core = "paper"
        ....
    }
}

The problem appears to be that I cannot get Gradle to pull in the 1.17.1 builds of Spigot or Paper. No matter what I set it to, it seems to utilize 1.16.4 when I analyze it in the dependencies view in IntelliJ

I've tried changing the repo between the papermc and spigot repos, as well as tried changing paperApi() to spigot() - it results in either Spigot or Paper 1.16.4 being resolved/downloaded. The builds that it downloads for the runServer task seems to be correct, but not the dependency used for compiling the code (using Material.COPPER_INGOT for example does not resolve at all, since it's present in 1.17 and above).

Even leaving off the apiVersion attribute, or changing it to something like 1.15.2 doesn't have an effect.

I've also tried invalidating caches via IntelliJ, as well as running gradle --refresh-depedencies, so I'm not sure if the issue is with gradle on my end, or via the BukkitGradle plugin.

Let me know if there's anything else I can provide that might help out with this! πŸ‘πŸΌ

Alternatives section in the README?

Would you be open to adding an "Alternatives" section in the README for this project?

I have a similar plugin with slightly different goals than this one, and I think it could be helpful if we added links to each other's plugin. My plugin might not meet some developer needs like your integrated dev server, while your plugin might be a bit too comprehensive for someone that's looking to just compile a jar without any bells and whistles.

Question: IntelliJ Debugging

How is debugging the Plugin through IntelliJ supposed to work if the "debug" option is ignored?

Thanks in advance.

Rename "meta" to "plugin"

It will be more convenient to use name plugin for plugin.yml configuration.

bukkit {
-   meta {
+   plugin {
        name = "MyPlugin"
    }
}

Out of memory

When i build a project with the gradle plugin it crashes running out of memory.
I tried setting the -Xmx to 1024m in gradle.properties but it still crashes.

Here it is the log with the --debug option: pastebin

When i disable the plugin it runs just fine.

1.17/1.17.1 Support

Apologies if this issue needs to be created upstream and has nothing to do with BukkitGradle, however...

I was wondering if there is anything on my end that I need to do to build my plugin against the 1.17 API? I've tried setting my apiVersion to 1.17 which seems to fail to build with the following error:

Paper v1.17 not found.
Supported paper versions: [1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.15.2, 1.14.4, 1.13.2, 1.12.2, 1.11.2, 1.10.2, 1.9.4, 1.8.8].

Paper 1.17's API is definitely available, along with the JavaDocs being available for 1.17 (and for 1.17.1 of course)

Unfortunately I'm not too familiar with how BukkitGradle's internals work, but if there is something I can try to work for to help include support for 1.17 - I'd love to give it a shot!

Release a snapshot version of this plugin

I uh, wanted to use this gradle plugin but it's currently stuck in 1.13, so I still have to manually copy my compiled plugins to my own Paper plugins folder, as I don't know how to compile a cloned gradle plugin from github and use it locally in the build system, would you like to either release the plugin as a snapshot/RC in your Maven central, or just tell me the instruction how to build the plugin from the cloned source?

Korean language support?

Hello.
I tried to add a command to plugin.yml like:

commands:
  ν€˜μŠ€νŠΈ:
    description: ν€˜μŠ€νŠΈ λͺ…λ Ήμ–΄ μž…λ‹ˆλ‹€.

But when I try to build, It occurs an error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generatePluginMeta'.
> java.nio.charset.UnmappableCharacterException: Input length = 2

Sorry for my bad English :(

Entry plugin.yml duplicate on Gradle 7.1

Execution failed for task ':processResources'.
> Entry plugin.yml is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.1.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.

Build jar includes bukkit and other dependencies

The jar build by this plugin includes the whole org.bukkit package, even though that isn't necessary. I think it also includes Bukkits's dependencies.

In a normal gradle project I'd use compileOnly for bukkit, can you do something similar with this plugin?

I can’t add extra dependencies.

Trying to use Kotlin. In the buildscript dependencies, I have this:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    implementation bukkit()
    implementation spigotApi()
    implementation craftbukkit()
}

I’m confused on how I can include kotlin in the built jar...

Add support for my repo + ACF

Hello,
I built a framework that is spreading through the community pretty fast called ACF (Spigot Thread), as well as other libraries such as TaskChain, IDB, and Minecraft Timings.

So my repo is common for plugins using my libraries, so recommending adding it:

    maven {
        name 'aikar'
        url 'https://repo.aikar.co/content/groups/aikar/'
    }

Might also be useful to add an dependencies { acf-paper 0.5.0 } support too, that auto follows my gradle configuration guide:
https://github.com/aikar/commands/wiki/Gradle-Setup to setup shading and automatic relocation for the user.

Add support of more APIs

Now it supports only Bukkit API. Need to add support of Spigot, CraftBukkit (to use NMS/OBC), Paper.

I plan to add option api to bukkit section.

For example:

bukkit {
    // Possible to set:
    //     spigot, spigot-api, bukkit, craftbukkit, paper, paper-api
    api = 'bukkit'
}

APIs:

  • Spigot, Spigot-API
  • CraftBukkit
  • Paper-API

Relates to: minecraft-dev/MinecraftDev#208

Generated plugin yml does not contains quotes

Hello, when you are converting the groovy format to yml, can you surround the converted values?
There is a problem when there are not quotes. It will throw a following error:

Ambiguous plugin name 'CommandsAPITest' for files 'plugins/CommandsAPITest-1.0-SNAPSHOT.jar' in 'plugins'

This is generated plugin.yml

name: CommandsAPITest
description: Yeah amazing plugin
main: cz.sionzee.commandsapi.test.CommandsAPITest
version: 1.0-SNAPSHOT
website: http://www.sionzee.cz
authors: [sionzee]

And the plugin meta

    // Attributes for plugin.yml
    meta {
        name = "CommandsAPITest"
        description = "Yeah amazing plugin"
        main = "cz.sionzee.commandsapi.test.CommandsAPITest"
        version = "1.0-SNAPSHOT"
        url = "http://www.sionzee.cz" // Attribute website
        authors = ["sionzee"]
    }

runServer runs the build tools

I'm using version BukkitGradle 0.9.2, with IntelliJ as my graphical gradle front-end.

When I run the runServer gradle task, the Spigot BuildTools are executed for no apparent reason (all the time, even after it has already run, even if the spigot jar exists), and the server isn't even started after waiting 3 min for the BuildTools to finish re-doing the same stuff again. The plugin jar is copied to the plugins directory of the server though.

build.gradle:

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.4.10'
    id "ru.endlesscode.bukkitgradle" version "0.9.2"
}

group '...'
description '...'
version '0.1.0'

repositories {
    mavenCentral()
    maven {
        url "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
    }
}

dependencies {
    compileOnly "org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT"
    implementation "org.jetbrains.kotlin:kotlin-stdlib"
}

bukkit {
    apiVersion = '1.16.5'

    server {
        core = 'spigot'
        eula = true
        onlineMode = true
    }
}

(shadow is not setup yet for Kotlin to work, but it shouldn't impact the runServer task in any way, I'd like the server to boot before spending more time fighting with Gradle)

Logs:

Executing task 'runServer'...

> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :parsePluginMetaFile
> Task :mergePluginMeta UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :inspectClassesForKotlinIC UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :copyPlugins UP-TO-DATE

> Task :downloadBuildTools UP-TO-DATE
Download https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar

> Task :buildServerCore UP-TO-DATE
> Task :copyServerCore UP-TO-DATE
> Task :prepareServer UP-TO-DATE

> Task :runServer
Listening for transport dt_socket at address: 5005
Loading BuildTools version: git-BuildTools-36c11e9-126 (#126)
Java Version: Java 8
[...build tools running here...]

Missing MetaItem for dependencies

Hello, can you please add MetaItems for soft-dependencies and dependencies? Thank you.

To me, you just need to update PluginMeta.groovy

Add overriding the dev server version to readme

I used this plugin as is, and it unexpectedly ran 1.15.1 as a dev server, without configuration.

I went to look to see how to configure the dev server version, but I could not see a method of doing so.

papermc() is not recognized in repository DSL block

addRepo('PaperMC', 'https://papermc.io/repo/repository/maven-public/')

Judging by the above LoCs I would think that we can change the repository DSL block to something other than what is outlined in the README:

repositories {
    spigot() // Adds spigot repo
}

(e.g.) to:

repositories {
    papermc() // Adds Paper repo
}

However this results in the error:
> Could not find method papermc() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Am I wrong to assume this is the case?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.