endlesscodegroup / bukkitgradle Goto Github PK
View Code? Open in Web Editor NEWGradle utilities for easier writing Bukkit plugins
Home Page: https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle
License: MIT License
Gradle utilities for easier writing Bukkit plugins
Home Page: https://plugins.gradle.org/plugin/ru.endlesscode.bukkitgradle
License: MIT License
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
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
Setting of JDK 1.8 should be removed. JDK should be set by developer using JVM Toolchains instead.
BukkitGradle/src/main/kotlin/BukkitGradlePlugin.kt
Lines 39 to 42 in 8ab3db4
Causes #60
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
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?
Now it is hard to use BukkitGradle with Kotlin DSL. We should provide accessors for Kotlin and examples of usage with Kotlin DSL.
Paperclip 1.13 has own URL: https://papermc.io/ci/job/Paper-1.13/
Hello!
Paper 1.18 has been released for a bit now, the builds have progressed a bit. Currently, the latest 1.18 release is Build 58 at https://papermc.io/api/v2/projects/paper/versions/1.18/builds/58/downloads/paper-1.18-58.jar
Just requesting to have paper-versions.json
updated ππΌ
Thanks!
Russ
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.
Version: 0.6.9
Minecraft: 1.12.1-R0.1-SNAPSHOT-b1393
-So it trys to download https://yivesmirror.com/files/spigot/spigot-1.12.1-R0.1-SNAPSHOT.jar
But that link its 1 404
Downloading from Yive's Mirror violates license of Bukkit.
Need to use BuildTools for local building CraftBukkit and Spigot cores.
Relates to: minecraft-dev/MinecraftDev#208
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
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' }
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!
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! ππΌ
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.
How is debugging the Plugin through IntelliJ supposed to work if the "debug" option is ignored?
Thanks in advance.
It will be more convenient to use name plugin
for plugin.yml configuration.
bukkit {
- meta {
+ plugin {
name = "MyPlugin"
}
}
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.
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!
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?
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 :(
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.
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?
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...
The repositories list is outdated. It should be updated.
https://github.com/EndlessCodeGroup/BukkitGradle#repositories
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.
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'
}
Relates to: minecraft-dev/MinecraftDev#208
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"]
}
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...]
Hello, can you please add MetaItems for soft-dependencies and dependencies? Thank you.
To me, you just need to update PluginMeta.groovy
The links for Paperclip 1.8.X are outdated. Please update them.
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.