Jump to content

Recommended Posts

Posted

Hey

I'm working on an Mod that depends on an jar

i can compile it succesfully in intellij

but how do i need to change the gradle.build for this to work?

 

i tried it with compile files("FilePath")

but the respond i get is

> No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.Def
aultDependencyHandler.compile() is applicable for argument types: (org.gradle.ap
i.internal.file.collections.DefaultConfigurableFileCollection) values: [file col
lection]
Possible solutions: module(java.lang.Object)

Posted

build.gradle

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
runtime files('Libaries/WolframAlpha-1.1.jar')
    }
}

apply plugin: 'forge'

version = "1.0"
group= "co.uk.sfgaming.SimpleCommands" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Simple Commands"

minecraft {
version = "1.6.4-9.11.1.964"
}

processResources
{
    // 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'
    }
}

Posted

I've also ran into the same issue, changing runtime/compile to classpath makes the script valid, but does NOT work as the compiler fails on symbols from those jars.

 

Link to build script (post editor doesn't seem to work in chromium) https://gist.github.com/tehbeard/a909499f99dbb77c6e7a

 

Edit: fixed it with a little help from irc, main points are:

 

Have to declare them in the project dependencies (toplevel dependencies{} object, not the one in buildscript)

 

Have to declare it after? the apply plugin forge.

 

Link to my fixed build.gradle, lines 19-21 are how to declare adding all jars under the deps folder as needed for compiling.

https://gist.github.com/tehbeard/0b11df8c8f8f6b7ffb24

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.