Jump to content

[SOLVED]Setting up Git correctly / Gradle Problems


Busti

Recommended Posts

I've been working with Forge for a long Time know. But I have never taken a step into git simply because I never needed it.

Don't get me wrong here I know what git is and I know how to use it. I also used in the past to create some sort of online Backup for my mod.

 

But I don't know how to use it with forge.

 

Recently a Friend of mine joined me and I tried to make git work for both of us by uploading my mod files using Intellij Ideas git integration.

So here is my question:

Which files do I have to upload and how to make it work in a simple (clone repo to folder and open project) manner?

 

Thanks in Advance,

Busti

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

I tried it.

I added every necessary file to git and cloned the repo to another pc.

Afterwards I used the command "gradlew setupDecompWorkspace idea" to set everything up. It completed without any errors.

I proceeded by opening the .ipr project file using the latest version of Intellij Idea.

And thats where the problems started.

 

For some reason all Libraries had to be added by hand to the module using File/Project Structure/Libraries/addToModule

Which I did and it turned out to have worked even though it was a bit annoying to add over 50 libraries by hand.

 

And everything seemed to be working.

But now for some odd reason textures don't work.

 

This may not be a git problem since copying the necessary files to a Stick and pasting them to the other pc would have done the same but I never did it before and cant quite understand the process yet.

Where did I go wrong?

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

Nice,

now I just have one minor problem.

Librarys such as Not Enough Items dont seem to work. I use CodeChickenLib sometimes and the Code seems to work and compile but NEI, which I placed in the /libs folder wont show up. It worked before though.

Yes I linked the libraries in my IDE.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

No there are no log problems. There are no logs from CCC and NEI at all. Normally both announce their presence during launch.

Shouldn't files in /libs be added as mods anyways, even if you don't link them as Libraries?

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

If a mod provides a maven repo, I highly suggest using that! for CCC and CCL, here's what I do:

https://github.com/SanAndreasP/SAPManagerPack/blob/master/build.gradle#L50-L60

(Please note those versions are quitte outdated, but they work for testing)

 

I don't depend on those in this mod, if you do, you'll need to declare CCC, CCL and NEI inside the buildscript area:

https://github.com/SanAndreasP/VarietyChests/blob/master/build.gradle#L1-L28

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

The difference is that the first doesn't actively reference CCC or NEI classes. Thus I don't need those when I compile the mod.

The second one does reference NEI (for a compatibility thing), thus I need those classes to compile the mod.

 

And the CCL reference may be an old one I didn't remove, now that I think about it. Since it's not in the maven repo (anymore), you don't need it.

 

Also  please note the first code is always needed, but the second one only if you actively reference a class from the mods.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

It has been on files.minecraftforge.net for  some time now. But the (possible) maven repo 404's for me.

Is there any method to download it from a link?

 

 

 

PS:

I think I am at the point where I should apologize for this thread. I am not very experienced with gradle and ignored it to this point.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

Adding the Libraries in the build.gradle file downloaded them but they are not added as mods.

 

Then show me your build.gradle.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

buildscript {
    repositories {
        jcenter()
        maven {
            name = "forge"
            url  = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = 'CodeChicken'
            url  = 'http://chickenbones.net/maven/'
        }
    }

    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.0-SNAPSHOT'
        classpath 'codechicken:CodeChickenCore:1.8-1.0.5.36:dev'
        classpath 'codechicken:NotEnoughItems:1.8-1.0.5.104:dev'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'

version = "0.3.5.1"
group= "com.mlb.technica"
archivesBaseName = "technica"

minecraft {
    version = "1.8-11.14.3.1503"
    runDir = "eclipse"
    mappings = "snapshot_20141130"
}

task downloadCCLDev(type:LibDownloader) {
    sourceUrl = 'http://files.minecraftforge.net/maven/codechicken/CodeChickenLib/1.8-1.1.2.139/CodeChickenLib-1.8-1.1.2.139-dev.jar'
    target    = file('libs/CodeChickenLib-dev.jar')
}

task downloadCCLSrc(type:LibDownloader) {
    sourceUrl = 'http://files.minecraftforge.net/maven/codechicken/CodeChickenLib/1.8-1.1.2.139/CodeChickenLib-1.8-1.1.2.139-src.jar'
    target    = file('libs/CodeChickenLib-src.jar')
}

repositories {
    maven {
        name = 'CodeChicken'
        url  = 'http://chickenbones.net/maven/'
    }
    maven {
        name = 'forge'
        url  = 'http://files.minecraftforge.net/maven'
    }

}

dependencies {
    compile 'codechicken:CodeChickenCore:1.8-1.0.5.36:dev'
    compile 'codechicken:CodeChickenCore:1.8-1.0.5.36:src'
    compile 'codechicken:NotEnoughItems:1.8-1.0.5.104:dev'
    compile 'codechicken:NotEnoughItems:1.8-1.0.5.104:src'
}

processResources {
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

idea { module { inheritOutputDirs = true } }

class LibDownloader extends DefaultTask {
    @Input
    String sourceUrl

    @OutputFile
    File target

    @TaskAction
    void download() {
        ant.get(src: sourceUrl, dest: target)
    }
}

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

CCC and NEI are added as libraries for me. The only thing that isn't is CCL. That is because you try to download it via the LibDownloader, but don't actually tell it do download anything, see here:

https://github.com/SanAndreasP/VarietyChests/blob/master/build.gradle#L64-L65

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I already updated it but didn't push the updated yet. It has not been in in the posted file either.

The libraries have successfully been downloaded to the libs folder but they are neither linked in the IDE (I have to do it manually) nor are they being compiled.

Even adding this to the build.gradle file does not help.

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}

 

The maven repos are not being compiled as well. Thus NEI wont start.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

A Summary

 

Have you tried turning it off and on again?

Now I have...

After deleting everything it is working like a charm.

 

And I have learned many things about gradle...

 

Also SanAndreasP and Diesieben07 I owe the tow of you a Beer. Please remind me if we ever meet.

 

Thank you for all the help.

Thus:

giphy.gif

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

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.