Different source directory for build.gradle

I’m a newbie to gradle.

Tried changing the the source directory of a Gradle project to a different directory as:

sourceSets {
    main {
        java {
            srcDir 'mobycraft/src/src/main/java'
        }
        resources {
            srcDir 'mobycraft/src/src/main/resources'
        }
    }
}

as opposed to the default

src/main/java

This allows me to download the Minecraft Mod Development Kit (MDK) from http://files.minecraftforge.net/ and use the source code from a GitHub project at https://github.com/AdityaGupta1/mobycraft/.

Existing workflow (with default src directory) is:

  • Unzip MDK
  • git clone mobycraft
  • Overwrite src from GitHub
  • Make changes
  • Copy the src back to GitHub (painful)
  • git push

The new setup would allow:

  • Unzip MDK
  • git clone mobycraft
  • Make changes and git push

But the new directory is getting recognized. I also tried removing the default src directory that comes with MDK but no luck.

Complete build.gradle is at: https://gist.github.com/arun-gupta/1230d8180ae2a54e32b4641ec6793473

Any idea what might be wrong?

Arun

Never mind, figured out a solution that works now.

Updated flow at: