Jump to content

A problem about my gradle


JerryLy086

Recommended Posts

I'm new at coding and I got a problem when I was building my gradle.

Here's the error code:

Build file 'build.gradle' line: 37

 

A problem occurred evaluating root project 'RoseGold'.
	> No signature of method: java.lang.String.mods() is applicable for argument types: (build_aylkspmrctt1hitxfh2fvq7es$_run_closure2$_closure8$_closure9$_closure12) values: [build_aylkspmrctt1hitxfh2fvq7es$_run_closure2$_closure8$_closure9$_closure12@7c9fab72]
	Possible solutions: plus(java.lang.Object), minus(java.util.regex.Pattern), plus(java.lang.CharSequence), is(java.lang.Object), minus(java.lang.Object), wait()

Code in my gradle:

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}

repositories {
	maven {
		url "https://www.cursemaven.com"
	}
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = 'b0.1'
group = 'com.jerryly086.rosegold' 
archivesBaseName = 'rosegold'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' 

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
	
	mappings channel: 'snapshot', version: '20201028-1.16.3'
	
    runs {
        client {
            workingDirectory project.file('run')
			
            property 'forge.logging.markers', 'REGISTRIES'.

            mods {
                rosegold {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            mods {
                rosegold {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                rosegold {
                    source sourceSets.main
                }
            }
        }
    }
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

dependencies {
    
	minecraft 'net.minecraftforge:forge:1.16.5-36.0.42'
	
	implementation fg.deobf("curse.maven:farmers-delight-398521:3249879")

}

jar {
    manifest {
        attributes([
            "Specification-Title": project.name,
            "Specification-Vendor": "JerryLu086",
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" :"JerryLu086",
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

jar.finalizedBy('reobfJar') 

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact jar
        }
    }
    repositories {
        maven {
            url "file:///${project.projectDir}/mcmodsrepo"
        }
    }
}
Edited by JerryLy086
Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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