gcewing / SGCraft

Stargates mod for Minecraft
http://www.cosc.canterbury.ac.nz/greg.ewing/minecraft/mods/SGCraft/
MIT License
11 stars 50 forks source link

build.gradle out dated in each verson #36

Open Tsoccerguy3 opened 7 years ago

Tsoccerguy3 commented 7 years ago

The build.gradle does not build anything . Each versions mappings , Forge version and Java is out dated . The build.gradle should run and build the project from the GIT command window , it does not

Example for 1.10.2 build.gradle

buildscript {
    repositories {
    mavenLocal()
        mavenCentral()
        jcenter()
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = 'sponge'
            url = 'http://repo.spongepowered.org/maven'
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup.

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

//version = "1.0"
//group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = jarName

minecraft {
    version = "1.10.2-12.18.2.2099"
    runDir = "run"

    // the mappings can be changed at any time, and must be in the following format.
    // snapshot_YYYYMMDD   snapshot are built nightly.
    // stable_#            stables are built at the discretion of the MCP team.
    // Use non-default mappings at your own risk. they may not allways work.
    // simply re-run your setup task after changing the mappings to update your workspace.
    mappings = 'stable_29'
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

sourceSets.main {
    compileClasspath += files("lib")
    java.srcDirs "src/base", "src/mod"
    resources.srcDirs "src/resources"
}

//jar {
//  exclude "ic2"
//}

processResources {

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

    // 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, 'modid':project.jarName
    }

    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}
Tsoccerguy3 commented 7 years ago

You can also declare the url of any dependencies and store in maven local .

StargateMC commented 7 years ago

Random one, but if you compile using gradle against a newer version of forge, your mod will not work in lower ones yes? @Tsoccerguy3

gcewing commented 7 years ago

The included build.gradle reflects the version of Forge that I used to build it, If you want to use a different one, you'll have to update it accordingly.

It's a while since I tested doing a full gradle-only build, though (my workflow only uses gradle for reobfuscation), so there might be something else stopping it from working. I'll look into it.