Jump to content

MultiProject dependencies


Country_Gamer

Recommended Posts

Hi! After following LexManos's (LexManos' ?) tutorial on setting up the workspace with multiple mods, (which I have successfully done, thank you Lex!) I am wondering how to add it so that all my mods except 1 of them is dependent on that one. This is meant to be so that I can modify my core mod and then its code is directly usable from each of my other mods. Here is what the setup looks like, and two sample build.gradle files. Hope someone can help me out on this! (Note, all the errors are because the sub mods cannot find the core mod)

 

Setup image:

BuildSetup.png

 

Core build.gradle:

 

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.7.2-2.0.0"
group= "com.countrygamer.core" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Core"

minecraft {
    version = "1.7.2-10.12.0.1034"
    assetDir = "eclipse/assets"
    if (file('../run').exists()) {
        assetDir = "../run/assets"
    } else {
        assetDir = "assets"
    }
}
processResources
{
    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

 

SubMod build.gradle:

 

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.7.2-2.0.0"
group= "com.countrygamer.weepingangels" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Angel"

minecraft {
    version = "1.7.2-10.12.0.1034"
    assetDir = "eclipse/assets"
    if (file('../run').exists()) {
        assetDir = "../run/assets"
    } else {
        assetDir = "assets"
    }
}
processResources
{
    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

Link to comment
Share on other sites

The folder layout is like so:

/Workspace/

/Workspace/Core/src/main/java/

/Workspace/Angel/src/main/java/

/Workspace/CAPO/src/main/java/

/Workspace/PvZ/src/main/java/

 

I added a file named "settings.gradle" to /Workspace/Core/ with text:

includeFlat ‘Angel’,’CAPO’, ‘PvZ’

 

I then ran the "bash gradlew setupDevWorkspace --refresh-dependencies" and "bash eclipse --refresh-dependencies" on each mod directory (Core, Angel, CAPO, PvZ).

 

Opened the workspace in eclipse (path /Workspace/) and it still does not work.

 

EDIT: I have also tried putting a "settings.gradle" into the Angel CAPO and PvZ directories, including the Core project. This injects the data, but does not allow for a successful workspace run nor build

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.