Jump to content

Recommended Posts

Posted

So here's my problem.

 

I try to build my workspace for eclipse using the gradlew setupDecompWorkspace command you have to run.

 

I do this and I've done this multiple times, except the first time where it was downloading everything (still same error though) the same thing happens. Here:

 

C:\Users\[user Name]\Desktop\MinecraftForge-1.10.x\MinecraftForge-1.10.x>gradle
w setupDecompWorkspace eclipse --info
Starting Build
Settings evaluated using settings file 'C:\Users\[user Name]\Desktop\MinecraftF
orge-1.10.x\MinecraftForge-1.10.x\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\[user Name]\Desktop\Mi
necraftForge-1.10.x\MinecraftForge-1.10.x\build.gradle'.
Included projects: [root project 'forge']
Evaluating root project 'forge' using build file 'C:\Users\[user Name]\Desktop\
MinecraftForge-1.10.x\MinecraftForge-1.10.x\build.gradle'.
This mapping 'snapshot_nodoc_20160518' was designed for MC 1.9.4! Use at your ow
n peril.
#################################################
         ForgeGradle 2.2-SNAPSHOT-0447b4e
  https://github.com/MinecraftForge/ForgeGradle
#################################################
               Powered by MCP unknown
             http://modcoderpack.com
         by: Searge, ProfMobius, Fesh0r,
         R4wk, ZeuX, IngisKahn, bspkrs
#################################################
All projects evaluated.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'setupDecompWorkspace' not found in root project 'forge'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option
to get the stack trace. Run with                                              -
-debug
option to get more log output.

BUILD FAILED

Total time: 5.24 secs

Posted

Here it is:

 

#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        ( set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

Posted

Sorry! I meant to open the build.gradle but instead I opened the gradle file! xD. Here:

 

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
    }
}

repositories {
        maven {
            name = "local"
            url = "file:///home/cpw/projects/repo"
        }
}

apply plugin: "maven"
apply plugin: "net.minecraftforge.gradle.patcher"
apply plugin: "net.minecraftforge.gradle.launch4j"

minecraft.version = "1.10.2"

minecraft {
    mappings = 'snapshot_nodoc_20160518'
    workspaceDir = "projects"
    versionJson = "jsons/${minecraft.version}-dev.json"
    buildUserdev = true
    buildInstaller = true
    installerVersion = "1.4"

    def common = {
        patchPrefixOriginal "../src-base/minecraft"
        patchPrefixChanged "../src-work/minecraft"
        mainClassClient "net.minecraft.launchwrapper.Launch"
        tweakClassClient "net.minecraftforge.fml.common.launcher.FMLTweaker"
        mainClassServer "net.minecraft.launchwrapper.Launch"
        tweakClassServer "net.minecraftforge.fml.common.launcher.FMLServerTweaker"
    }

    projects {
        forge {
            rootDir "."
            patchDir "patches/minecraft"
            patchAfter "clean"
            genPatchesFrom "clean"
            genMcpPatches = false
            applyMcpPatches = false
            s2sKeepImports = true
            with common
        }
    }
}

group = 'net.minecraftforge'
version = getVersionFromJava(file("src/main/java/net/minecraftforge/common/ForgeVersion.java"))

extractForgeSources { exclude "**/SideOnly.java", "**/Side.java" }
extractForgeResources { exclude "**/log4j2.xml" }

genGradleProjects { addTestCompileDep "junit:junit:4.12" }

processJson {
    releaseJson = "jsons/${minecraft.version}-rel.json"
    addReplacements([
        "@minecraft_version@": project.minecraft.version,
        "@version@": project.version,
        "@project@": "forge",
        "@artifact@": "net.minecraftforge:forge:${project.version}",
        "@universal_jar@": { outputJar.archiveName },
        "@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
    ])
}

task changelog(type: JenkinsChangelog) {

    // skip if there is no forge jenkins pass
    onlyIf {
        project.hasProperty('forgeJenkinsPass')
        // Not sure what abrar was trying to do here...
        //project.file("build/distributions/${project.name}-${project.version}-changelog.txt").text = ""
    }

    outputs.upToDateWhen { false } // never up to date
    serverRoot = "http://ci.jenkins.minecraftforge.net/"
    jobName = "minecraftforge"
    targetBuild = System.env['BUILD_NUMBER'] ?: project.ext.properties.buildNumber ?:0;
    authName = "console_script"
    authPassword = project.hasProperty('forgeJenkinsPass') ? project.getProperty('forgeJenkinsPass') : "";
    output = "build/distributions/${project.name}-${project.version}-changelog.txt"
}

task crowdin(type: CrowdinDownload) {
    output = "build/crowdin.zip"
    projectId = 'minecraft-forge'
    extract = false // we wanna keep it as a zip. not extract it to a folder named "crowdin.zip"
    
    // task auomatically skips if this is null
    if (project.hasProperty('crowdinKey'))
        apiKey = project.crowdinKey
}

def extraTxts = [
    changelog, // yeah we can do thi, because gradle and groovy are awesome
    "CREDITS-fml.txt",
    "LICENSE-new.txt",
    "MinecraftForge-Credits.txt",
    "Paulscode SoundSystem CodecIBXM License.txt",
    "Paulscode IBXM Library License.txt"
]

outputJar {
    classifier = 'universal'
    from extraTxts

    // add crowdin locales
    from { crowdin.getDidWork() ? zipTree(crowdin.output) : null}
    dependsOn 'crowdin'

    manifest.attributes([
        "Main-Class": "net.minecraftforge.fml.relauncher.ServerLaunchWrapper",
        "TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
        "Class-Path": getServerClasspath(file("jsons/${minecraft.version}-rel.json"))
    ])
}

installer {
    classifier = 'installer'
    from extraTxts
    from "src/main/resources/forge_logo.png"
    rename "forge_logo\\.png", "big_logo.png"
}

task signUniversal(type: SignJar, dependsOn: 'outputJar') {
    onlyIf {
        project.hasProperty('jarsigner')
    }

    def jarsigner = [:];

    if (project.hasProperty('jarsigner'))
        jarsigner = project.jarsigner;

    alias = 'forge'
    exclude "paulscode/**"
    storePass = jarsigner.storepass
    keyPass = jarsigner.keypass
    keyStore = jarsigner.keystore
    inputFile = outputJar.archivePath
    outputFile = outputJar.archivePath
}
uploadArchives.dependsOn signUniversal
build.dependsOn signUniversal
installer.dependsOn signUniversal

// MDK package

import org.apache.tools.ant.filters.ReplaceTokens
task makeMdk(type: Zip) {
    baseName = project.name
    classifier = "mdk"
    version = project.version
    destinationDir = file('build/distributions')

    from 'gradlew'
    from 'gradlew.bat'
    into ('gradle') {
        from 'gradle'
    }
    into ('eclipse') {
        from 'mdk/eclipse'
    }
    from changelog.output
    from ('mdk') {
        filter(ReplaceTokens, tokens: [
        VERSION: project.version,
        MAPPINGS: minecraft.mappings.replace('nodoc_', '')
        ])
        exclude 'eclipse'
        rename 'gitignore\\.txt', '.gitignore'
        from 'MinecraftForge-Credits.txt'
        from 'LICENSE-new.txt'
        from 'Paulscode IBXM Library License.txt'
        from 'Paulscode SoundSystem CodecIBXM License.txt'
        from 'CREDITS-fml.txt'
    }
}
tasks.build.dependsOn makeMdk

// launch4j

launch4j {
    jar = installer.archivePath.canonicalPath
    outfile = file("build/distributions/${project.name}-${project.version}-installer-win.exe").canonicalPath
    icon = file('icon.ico').canonicalPath
    manifest = file('l4jManifest.xml').canonicalPath
    jreMinVersion = '1.6.0'
    initialHeapPercent = 5;
    maxHeapPercent = 100;
}
tasks.generateXmlConfig.dependsOn installer
tasks.build.dependsOn 'launch4j'

// MAVEN

artifacts {
    archives changelog.output
    archives file("build/distributions/${project.name}-${project.version}-installer-win.exe")
    archives makeMdk
}

task ciWriteBuildNumber << {
    def file = file("src/main/java/net/minecraftforge/common/ForgeVersion.java");
    def bn = System.getenv("BUILD_NUMBER")?:project.ext.properties.buildNumber?:0;
    def outfile = "";
    def ln = "\n"; //Linux line endings because we're on git!

    file.eachLine{ String s ->
        if (s.matches("^    public static final int buildVersion    = [\\d]+;\$"))
            s = "    public static final int buildVersion    = ${bn};";
        if (s.matches('^    public static final String mcVersion = "[^\\"]+";'))
            s = "    public static final String mcVersion = \"${minecraft.version}\";";
        outfile += (s+ln);
    }
    file.write(outfile);
}

uploadArchives {
    repositories.mavenDeployer {

        dependsOn 'build'

        if (project.hasProperty('forgeMavenPass'))
        {
            repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
                authentication(userName: "forge", password: project.getProperty('forgeMavenPass')) // the elvis operator. look it up.
            }
        }
        else
        {
            // local repo folder. Might wanna juset use  gradle install   if you wanans end it to maven-local
            repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
        }

        pom {
            groupId = project.group
            version = project.version
            artifactId = project.archivesBaseName
            project {
                name project.archivesBaseName
                packaging 'jar'
                description 'Minecraft Forge API'
                url 'https://github.com/MinecraftForge/MinecraftForge'

                scm {
                    url 'https://github.com/MinecraftForge/MinecraftForge'
                    connection 'scm:git:git://github.com/MinecraftForge/MinecraftForge.git'
                    developerConnection 'scm:git:git@github.com:MinecraftForge/MinecraftForge.git'
                }

                issueManagement {
                    system 'github'
                    url 'https://github.com/MinecraftForge/MinecraftForge/issues'
                }

                licenses {
                    license {
                        name 'Forge Public License'
                        url 'https://raw.github.com/MinecraftForge/MinecraftForge/master/MinecraftForge-License.txt'
                        distribution 'repo'
                    }
                }

                developers {
                    developer {
                        id 'cpw'
                        name 'cpw'
                        roles { role 'developer' }
                    }
                    developer {
                        id 'LexManos'
                        name 'Lex Manos'
                        roles { role 'developer' }
                    }
                    developer {
                        id 'AbrarSyed'
                        name 'Abrar Syed'
                        roles { role 'contributor' }
                    }
                }
            }
        }
    }
}

// HELPER METHODS

import groovy.json.JsonSlurper;

String getServerClasspath(File file)
{
    def node = new JsonSlurper().parse(file);
    def out = new StringBuilder()
    node.versionInfo.libraries.each { lib ->
        if (lib.serverreq)
        {
            // group : artifact : version
            def split = lib.name.split(':')
            def group = split[0].replace('.', '/')
            def artifact = split[1]
            def version = split[2]
            out += "libraries/$group/$artifact/$version/$artifact-${version}.jar "
        }
    }
    out += "minecraft_server.${minecraft.version}.jar"

    return out.toString();
}

String getVersionFromJava(File file)
{
    String major = "0";
    String minor = "0";
    String revision = "0";
    String build = "0";

    String prefix = "public static final int";
    file.eachLine{ String s ->
        s = s.trim();
        if (s.startsWith(prefix))
        {
            s = s.substring(prefix.length(), s.length() - 1);
            s = s.replace('=', ' ').replace("Version", "").replaceAll(" +", " ").trim();
            String[] pts = s.split(" ");

            if (pts[0].equals("major")) major = pts[pts.length - 1];
            else if (pts[0] == "minor") minor = pts[pts.length - 1];
            else if (pts[0] == "revision") revision = pts[pts.length - 1];
        }
    }

    build = System.getenv("BUILD_NUMBER") ?: project.ext.properties.buildNumber ?: 0


    String branch = null;
    if (!System.getenv().containsKey("GIT_BRANCH"))
    {
        // TODO: use grgit - Tried to switch 07/07/16 - jgit broken on windows?
        branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
    }
    else
    {
        branch = System.getenv("GIT_BRANCH");
        branch = branch.substring(branch.lastIndexOf('/') + 1);
    }

    def out = "${minecraft.version.replace('-', '_')}-$major.$minor.$revision.$build"

    if (branch && branch != 'master' && branch != 'HEAD' && branch != minecraft.version && branch != minecraft.version + '.0')
    {
        if (!(branch.endsWith('.x') && minecraft.version.startsWith(branch.substring(0, branch.length() -1))))
            out += "-$branch"
    }

    return out;
}

task resetBuildNumber << {
    project.ext.properties.buildNumber = 0;
    ciWriteBuildNumber.execute()
}
// re-add old tasks for jenkins compat
// should be remvoed, and the jenkisn fixed when no longer building with FG 1.2
task setupForge { dependsOn 'setup', 'ciWriteBuildNumber' }
task buildPackages { dependsOn 'build' }

//Temporary hack to fix compile errors caused by mappings shading in Bootstrap
/*
task fixParams << {
    logger.lifecycle('Fixing param names!')
    def params = new File(extractMcpMappings.destinationDir, 'params.csv')
    def text = params.text
    text = text.replaceAll('p_180276_1_,biome,', 'p_180276_1_,biomeIn,')
    params.write(text)
}
fixParams.dependsOn('extractMcpMappings')
extractMcpMappings.finalizedBy('fixParams')
*/

 

Sorry!

  • 2 years later...
Posted

Hello, I had both SanaRinomi's issue and made the same mistake of downloading the GitHub gradle rather than following the download for the MDK link diesieben07 provided via the step by step modding guide. But unfortunately I have encountered the exact same error despite my efforts to follow diesieben07's advice. This may be due to command prompt telling me my gradle version 4.9 was not compatible with gradle 5.0. Specifically:

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

But if so I'd like to know the correct forgeGradle download to build in IntelliJ (or Eclipse as I have that installed if it is easier) or even another methodical solution to my dilemma. Any and all help will be appreciated, thank you in advance!

Posted

Please don't necro old threads, if you have an issue make your own thread.

  • Thanks 1

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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