Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.gradle out dated in each verson #36

Open
Tsoccerguy3 opened this issue Jan 7, 2017 · 3 comments
Open

build.gradle out dated in each verson #36

Tsoccerguy3 opened this issue Jan 7, 2017 · 3 comments

Comments

@Tsoccerguy3
Copy link

Tsoccerguy3 commented Jan 7, 2017

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
Copy link
Author

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

@StargateMC
Copy link

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
Copy link
Owner

gcewing commented May 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants