// -Dhttps.protocols=TLSv1.2
//org.gradle.jvmargs="-Dhttps.protocols=TLSv1.2"
buildscript {
    repositories {
        jcenter()
        maven {
            name = "forge"
            url = "https://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
    }
}
repositories {
    maven {
        name = "primal"
        url "https://maven.nmd.so"
    }

    maven {
        name = "jei"
        url "https://dvs1.progwml6.com/files/maven"
    }

    maven {
        name "CraftTweaker"
        url "http://maven.blamejared.com/"
    }
}

apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'java'
compileJava {
    sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
group = "${mod_group}"
version = "${mod_version}"
archivesBaseName = "${mod_name}"

idea { module { inheritOutputDirs = true } }
minecraft {
    version = "${mc_version}" + "-" + "${forge_version}"
    runDir = "run"
    mappings = "${mcp_mappings}"

    // JEI
    useDepAts = true

    // Replace
    replace "@VERSION@", project.mod_version
}

dependencies {
    // PrimalCore
    deobfCompile "nmd.primal.core:PrimalCore:${mc_version}-${primal_version}:dev"

    // JEI
    //runtime "mezz.jei:jei_${mc_version}:${jei_version}"
    deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}:api"

    // CraftTweaker
    //compile "CraftTweaker2:CraftTweaker2-MC1120-Main:${craftweaker_version}"
    //compile "CraftTweaker2:CraftTweaker2-API:${craftweaker_version}"
    //compile "CraftTweaker2:CraftTweaker2-MC1120-Main:${mc_major_version}-${craftweaker_version}"
    //compile "CraftTweaker2:CraftTweaker2-API:${craftweaker_version}"
}

processResources {
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", "${mod_version}"
    inputs.property "mcversion", "${mc_version}"
    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
        // replace version and mcversion
        expand 'version':"${mod_version}", 'mcversion':"${mc_version}"
    }
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}



// end //