Lembas-Modding-Team / pvp-mode

A Minecraft mod offering various options to manage availability for and ability to PvP.
GNU Lesser General Public License v3.0
5 stars 3 forks source link

Gradle improvements v2 #330

Closed mahtaran closed 8 months ago

mahtaran commented 5 years ago

Organised the .gitignore file and added directories which should be ignored. Updated to Gradle 4.4 from 2.0. Changed several things in accordance with this. Moved all configurable settings from the build.gradle file to build.properties. Increased the maximum amount of RAM Gradle can use while compiling for faster builds. Added all required libs (and some not required at this moment but they might be in the future (SuffixForge)) to build the mod. Added an automated system which replaces placeholders like the modid, version and Minecraft version.

After it is reviewed, it should be tested if the newly compiled JAR doesn't break everything.

CraftedMods commented 5 years ago

I'm still checking the changes...

mahtaran commented 5 years ago

The rest will be addressed tomorrow when I have access to a PC again.

mahtaran commented 5 years ago

Wrapper is the first task executed in the build, haven’t tested if it’s executed in other tasks, but that doesn’t really matter in my opinion, as all executed tasks have to do with the project.

On Thu, 14 Feb 2019 at 10:40, CraftedMods notifications@github.com wrote:

@CraftedMods commented on this pull request.

In build.gradle https://github.com/Lembas-Modding-Team/pvp-mode/pull/330#discussion_r256755221 :

  • for (String line : lines)
  • maxLength = Math.max(line.length(), maxLength)
  • for (def i = 0; i < maxLength; i++) {
  • border += i % 2 == 0 ? "=" : "-"
  • }
  • println """ +${border}
  • +${message}

  • +${border} +"""

  • } +}
  • +tasks.wrapper.dependsOn buildInformation

When is that executed?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Lembas-Modding-Team/pvp-mode/pull/330#pullrequestreview-203646024, or mute the thread https://github.com/notifications/unsubscribe-auth/AVrKm4QpezzSOb-qWU7tnintIY5EinjCks5vNS8XgaJpZM4aNG4a .

CraftedMods commented 5 years ago

The task isn't executed. I tried using both build and clean build.

mahtaran commented 5 years ago

The task isn't executed. I tried using both build and clean build.

You are using the gradlew command instead of the gradle command right?

CraftedMods commented 5 years ago

Yes. gradle doesn't work, using the Forge Dev Environment.

CraftedMods commented 5 years ago

Also, I noticed, that I cannot use the Hot Code replacement eclipse has, because I've to start the program via gradle now. That's bad and makes development hard, for some things, because then I've to restart the program with every change. It's probably still possible somehow, but not as easy as it was.

CraftedMods commented 5 years ago

If you don't know a better solution, I would recommend to remove these lines:

replaceIn "src/main/java/pvpmode/PvPMode.java"
    replace "@version@", config.version
    replace "@modid@", config.modid
    replace "@mcversion@", project.minecraft.version
    replace "@name@", config.name

This is not ideal, but honestly I rather want to change the mod version at one place more before an update, than not having the hotswapping. Starting the program without gradle is also more convenient and more easy, for me in eclipse, because the Forge workspace layout creates some problems with the eclipse gradle plugin.

mahtaran commented 5 years ago

I guess we could work around

Yes. gradle doesn't work, using the Forge Dev Environment.

Ah, problem confirmed. Weird, it worked before. Resolved, replaced tasks.wrapper with tasks.compileApiJava. Going to be in the next commit, after I look into the hot swapping.