Jump to content

FatJar including Minecraft libraries 1.7.10


fernthedev

Recommended Posts

So a few weeks/months ago I made a forum post asking for help with making fatJars. The help I received was fast. But then I decided to make my mod work below 1.12.2 and 1.8, to 1.7.10 for me and my friend with our love of mod packs. I did accomplish doing all of I've done before. Except, the file size was 66 MB when 1.8 and 1.12.2 were not close to being any bigger than 3 MB. The problem, the fat jar included ALL of the Minecraft libraries. The first one I noticed was the twitch.tv package in my jar. I haven't added anything to my build.gradle file to add all the library packages. This issue is very odd and I haven't found any other posts regarding it.  Anything I can do to shrink the file size?

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        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.2-SNAPSHOT"
        classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
    }
}
/*plugins {
    // id 'com.github.johnrengelman.shadow' version "1.2.4"
    id "com.github.johnrengelman.shadow" version "1.2.4"
}*/
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: "forge"


configurations {
    shade
    compile.extendsFrom shade
}

reobf.reobf(shadowJar) { spec ->
    spec.classpath = sourceSets.main.compileClasspath;
}

shadowJar {
    relocate 'org.apache', 'shadow.org.apache'
    exclude 'GradleStart**'
    exclude '.cache'
    exclude 'tv.twitch:twitch'
}

//build.dependsOn(shadowJar)

version = "1.3.2"
group = "com.github.fernthedev" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "DiscordMod1.7.10"

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "run"
}

sourceCompatibility = targetCompatibility = '1.6' // Need this here so eclipse task generates correctly.
compileJava {
    sourceCompatibility = targetCompatibility = '1.6'
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"

    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
    compile 'org.json:json:20171018'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // 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

1.7.10 is fucking ancient and no longer supported.

Update.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Not here.

 

We stopped providing help with 1.7 about a year and a half ago. We can't support every version forever and the decision was made that only the current version and the next oldest would be supported here. And that means 1.12 and 1.10, although we still do regularly help with 1.8.9, but that support typically comes with a "you should still update" message.

  • Thanks 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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