WurstPlus/wurst-plus-three

not building

master7720 opened this issue · 14 comments

  • What went wrong:
    A problem occurred evaluating root project 'wurst-plus-three-0.7.0'.

A problem occurred starting process 'command 'git''

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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

I have seen this issue before and know the fix, but I can't remember it at the moment. I think it required removing a few things from the build.gradle for it to build, but I cannot guarantee that was the right fix. I'll look later.

I have a fix for your issue. It is a temporary fix. To first start, download the latest code and run it.

When you get the error, scroll up to the top of the stacktrace and click the line in the build.gradle.

Then you will want to comment this part on lines 22-29:

def getGitHash = { -> def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-parse', 'HEAD' standardOutput = stdout } return stdout.toString().trim() }

Then look in the build.gradle for other mentions of the GitHash. There are 2 locations.

The first is on line 38. Make sure that 0.7.0+ is the only thing inside the quotation marks.

The second instance of the GitHash is on line 145. Simply comment out the entire line. Ex. //'Githash': getGitHash()

I believe that is all. Then you can setupDecompWorkspace and gen your ide runs and run the client.

Thanks! Let me know if this does not work.

EDIT:
In the main class, some commenting is required.

Begin by commenting out line 3. //import me.travis.BuildConfig;

Then comment out the BuildConfig on line 41.

It should look like this: public static final String MODVER = "0.7.0+"; //+ BuildConfig.GitHash;

I think that should be it.

EDIT 2:
The line refrences are for intellij.

TrvsF commented

installing git may also fix the issue

ah ok thanks bro

installing git may also fix the issue

it didnt

I have a fix for your issue. It is a temporary fix. To first start, download the latest code and run it.

When you get the error, scroll up to the top of the stacktrace and click the line in the build.gradle.

Then you will want to comment this part on lines 22-29:

def getGitHash = { -> def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-parse', 'HEAD' standardOutput = stdout } return stdout.toString().trim() }

Then look in the build.gradle for other mentions of the GitHash. There are 2 locations.

The first is on line 38. Make sure that 0.7.0+ is the only thing inside the quotation marks.

The second instance of the GitHash is on line 145. Simply comment out the entire line. Ex. //'Githash': getGitHash()

I believe that is all. Then you can setupDecompWorkspace and gen your ide runs and run the client.

Thanks! Let me know if this does not work.

EDIT: In the main class, some commenting is required.

Begin by commenting out line 3. //import me.travis.BuildConfig;

Then comment out the BuildConfig on line 41.

It should look like this: public static final String MODVER = "0.7.0+"; //+ BuildConfig.GitHash;

I think that should be it.

EDIT 2: The line refrences are for intellij.

so like this?

buildscript {
ext.kotlin_version = '1.3.72'
repositories {
jcenter()
maven {
name = 'SpongePowered'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.4")
}
}

def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
'' exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}

apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'kotlin'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'de.fuerstenau.buildconfig'

version "0.7.0+"
group project.modGroup

buildConfig {
buildConfigField "String", "GitHash", "${getGitHash()}"
}

sourceSets.main.java.srcDirs += "build/gen/buildconfig/src/main"

sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
version = project.forgeVersion
runDir = 'run'
mappings = project.mcpVersion
coreMod = 'me.travis.wurstplusthree.mixin.MixinLoader'
makeObfSourceJar = false
}

repositories {
mavenCentral()
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}

dependencies {
compile group: "com.googlecode.json-simple", name: "json-simple", version: "1.1.1"
compile group: 'club.minnced', name: 'java-discord-rpc', version: '2.0.1'
compile 'com.github.cabaletta:baritone:1.2.14'
compile 'cabaletta:baritone-api:1.2'
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {

    exclude module: 'launchwrapper'
    exclude module: 'guava'
    exclude module: 'gson'
    exclude module: 'commons-io'
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

}

task getDeps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'runtime/'
}

processResources {
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
rename '(.+_at.cfg)', 'META-INF/$1'
}

shadowJar {
dependencies {
include(dependency('com.googlecode.json-simple:json-simple:1.1.1'))
include(dependency('org.spongepowered:mixin'))
include(dependency('club.minnced:java-discord-rpc:2.0.1'))
}
exclude 'dummyThing'
exclude 'LICENSE.txt'
classifier = 'release'
}

mixin {
defaultObfuscationEnv searge
add sourceSets.main, 'mixins.wurstplusthree.refmap.json'

}

reobf {
shadowJar {
mappingType = 'SEARGE'
classpath = sourceSets.main.compileClasspath
}
}

jar {
manifest {
attributes(
'MixinConfigs': 'mixins.wurstplusthree.json',
'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
'FMLCorePluginContainsFMLMod': 'true',
'Githash': getGitHash()
'ForceLoadAsMod': 'true',
'FMLAT': 'wurstplusthree_at.cfg',
'Githash': getGitHash()
)
}
}

build.dependsOn(shadowJar)
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

I can test it later, but as long as the instructions are followed it should work. Travis has a point, to solve the problem open the code with github desktop or VSC.

i did

but still aint building

C:\Users\WhyYouLookingHere>cd C:\Users\YouLookingHere\OneDrive\Desktop\wurst-plus-three-0.7.0

C:\Users\YouLookingHere\OneDrive\Desktop\wurst-plus-three-0.7.0>gradlew setupdecompworkspace
Starting a Gradle Daemon, 2 busy and 1 incompatible Daemons could not be reused, use --status for details

Configure project :
fatal: not a git repository (or any of the parent directories): .git

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\YouLookingHere\OneDrive\Desktop\wurst-plus-three-0.7.0\build.gradle' line: 24

  • What went wrong:
    A problem occurred evaluating root project 'wurst-plus-three-0.7.0'.

Process 'command 'git'' finished with non-zero exit value 128

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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

BUILD FAILED in 12s

even with git doesnt work

In the main repo click code, and then click "open in GitHub Desktop". Download GitHub desktop app and clone the repo from there, then when it's done, Fetch the origin and then go to the branches menu and select 0.7.0. Then open it in Intellij IDEA Community Edition and that will work. Make sure your JDK and Minecraft development plugins are configured correctly.

rip still didnt work

Can you please provide more info, such as a stacktrace? This method does work on my end.