SpongeStart is a gradle plugin for developing Sponge plugins. I coded this plugin because ForgeGradle was just taking to long for me.
Getting Started!
Preparing the build.gradle:
2. Execute the gradle task: gradle setupServer. This command will make servers in the folder “run”. Same like forgegradle does.
3. Refresh Gradle in your IDE. Problems you may encounter
Your IDE can’t find StartServer.
Try to refresh gradle in your IDE.
Todo
Make the plugin more robust
Error messages that make sense
Add eclipse support
How does it work
The plugin itself can basically start any server.jar file. The way it works is by loading the jar in to the systemclassloader (it’s tricky trust me) and invoking it’s startup class. So when Intelij (or another IDE) runs the classfile (StartServer.class) it also loads in the classpath from your project. Something that has to be noticed, is that this won’t work if your SpongeAPI dependencies are set to a compile scope. The way java works is that the parent class loader always gets priority, meaning that possible ASM modifications in the API could be overwritten. That’s why it is important that all SpongeAPI dependencies are set to Provided.
Just one question: Do you need to have the Sponge project preinstalled, or will this plugin download it from GitHub, because if it did it would be 100/10
You don’t need a Sponge Project pre-installed. It will download forge and the mod from http://files.minecraftforge.net/, And than clevery (hackery) wrap arround it to make it work .
To give you an idea here a picture how it looks like:
As long your IDE has it in his classpath, it will work.[quote=“meguy26, post:6, topic:11318”]
Anyway, its already awesome, considering Git wasn’t cooperating when I tried to clone the Sponge project…
[/quote]
Yeah that was also 100% bugging me. I tried to make a plugin 3 days ago, mangled 3 hours with the repo. Gave up and just made this gradle plugin xD.
Ehm, Just did some testing and I figured out that the forge installer doesn’t has a --installClient option :’( . I will see what I can do with it, but atm it has very low priority.
Added support for SpongeVanilla. Folders are now /run/forge and /run/vanilla
Separated download tasks location and proper caching
clearing project and cache tasks
build.gradle changes
The sponge block is now only if you want to change the sponge version. The plugin is now smart enough to figure out what the most recent sponge version is. Although having this in your script can be extremely helpfully
sponge {
eula true
}
Github Repo Changes:
Since I made this plugin for Qixalite we decided to move it to the Qixalite repo’s:
I did some testing and it is way to hacky to get the client working . It almost feels like a cracked client (it is). I think I just stick to the servers, it’s not so hard to just have a client running in the background where you can alt + tab to.