How do I build my sponge plugin out

Hi i have made a sponge plugin do build it out exactly the same as bucket ones or is it a different process?

If you’re using gradle (Which you should be IMO) it’s easy
Run gradlew build
Your plugin will be in build/lib

awesome you’ve saved my life

wait sorry just realised i don’t seem to have grade in my plugin is there another way?

Well, what do you use?

Gradle, Maven, Ant… Eclipse/IntelliJ’s green ‘build’ button?

well apparently its a grade project however when i do ./gradlew build it comes out with: ./gradlew: No such file or directory

You’re on a Mac (or Linux), based on that error message, right?

If so, run chmod +x gradlew in a terminal (from the same folder as gradlew) then try again.

comes out with chmod: gradlew: No such file or directory

Well I guess we found the issue then. Copy the gradlew scripts from SpongeAPI as well as the gradle folder.

ok will do that now

Oops, sorry. Only copy gradle/wrapper, just remembered that the API buildscript is in that folder now…

FAILURE: Build failed with an exception.

  • Where:
    Script ‘/Users/sambolton/Documents/GIthub1/SpongePlugin/gradle/java.gradle’ line: 47

  • What went wrong:
    A problem occurred evaluating script.

Could not find property ‘url’ on root project ‘SpongePlugin’.

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

BUILD FAILED

Total time: 10.331 secs

Remove deploy.gradle and java.gradle from the gradle folder

FAILURE: Build failed with an exception.

  • What went wrong:
    Task ‘build’ not found in root project ‘SpongePlugin’.

  • Try:
    Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Stick your build.gradle and settings.gradle file on pastebin or gist, something must be weird if you don’t have the build task.

ok so turns out i didn’t have the settings.gradle or build.gradle in the it so when i put them in it gives me this error: FAILURE: Build failed with an exception.

  • Where:
    Settings file ‘/Users/sambolton/Documents/GIthub1/SpongePlugin/settings.gradle’ line: 1

  • What went wrong:
    A problem occurred evaluating settings ‘SpongePlugin’.

Could not find property ‘name’ on settings ‘SpongePlugin’.

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

BUILD FAILED

Total time: 4.801 secs

You don’t have either of those files?

i didn’t but i do now and then when i run it now it gives me this error: FAILURE: Build failed with an exception.

  • Where:
    Settings file ‘/Users/sambolton/Documents/GIthub1/SpongePlugin/settings.gradle’ line: 1

  • What went wrong:
    A problem occurred evaluating settings ‘SpongePlugin’.

Could not find property ‘name’ on settings ‘SpongePlugin’.

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

BUILD FAILED

Total time: 4.801 secs

i was making the plugin based of GitHub - MrMysteri0us/SpongePlugin

That plugin is old. Take a look at these instead: GitHub - SpongePowered/Cookbook: SpongeAPI munchy crunchy delicious recipes

1 Like