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

Unable to compile #189

Open
zeng-github01 opened this issue May 4, 2024 · 6 comments
Open

Unable to compile #189

zeng-github01 opened this issue May 4, 2024 · 6 comments
Assignees
Labels
[Attribute] Bug Report [Status] Requires Testing A fix is in progress and requires testing before determined suitable [Status] Resolved / Fixed In Dev A fix is present in the repository code but has yet to be included in a released version

Comments

@zeng-github01
Copy link

Forge Version

14.23.5.2860

Galacticraft Version

github source

Log or Crash Report

Cause: dev.galacticraft.gradle.commons.plugin.TeamConstants$Repositories$Hosted.legacyCommon()Lorg/gradle/api/Action;

dev.galacticraft.gradle.commons.plugin.TeamConstants$Repositories$Hosted.legacyCommon()Lorg/gradle/api/Action;

Reproduction steps

1.Fork this repo
2.clone it to local

@zeng-github01 zeng-github01 added [Attribute] Bug Report [Status] Triage Requires review for validity and severity if the issue is valid labels May 4, 2024
@zeng-github01 zeng-github01 changed the title Unable to compile[Bug]: Unable to compile May 4, 2024
@xJon
Copy link

xJon commented May 5, 2024

Removing the CurseForge/Modrinth publishing and changelog generation parts of the build script should resolve this.

@zeng-github01
Copy link
Author

zeng-github01 commented May 5, 2024

Removing the CurseForge/Modrinth publishing and changelog generation parts of the build script should resolve this.

This doesn't work. New error: 'org.gradle.api.Action dev.galacticraft.gradle.commons.plugin.TeamConstants$Repositories$Hosted.legacyCommon()'

my changes: //changelog {
// fromTag('4.0.5')
//}

maven {
excludeDependencies('forge', 'jei')
artifacts(mavenJar, deobfJar, sourcesJar)
}

//modpublishing {
//
// changelogPath(changelog.changelogFile)
//
// curseforge('564236') {
// if (System.getenv().CI)
// apiKey = 'none'
// relations {
// optional(
// 'mekanism',
// 'jei',
// 'journeymap',
// 'playerapi',
// 'actually-additions',
// 'redstone-flux',
// 'applied-energistics-2',
// 'biomes-o-plenty',
// 'buildcraft',
// 'industrial-craft'
// )
// incompatible(
// 'betterportals' ,
// 'vics-modern-warfare-mod'
// )
// }
// }
//
// modrinth('ZnmdXAk2') {
// if (System.getenv().CI)
// token('none')
// dependencies {
// // Mekanism
// optional.version 'KIzASRO5'
// // JourneyMap
// optional.version 'vacvhRKp'
// }
// }
//}

@xJon
Copy link

xJon commented May 5, 2024

@zeng-github01 Try this (by @Rishum-P):

build.gradle

plugins {
    id 'java'
    id 'eclipse'
    id 'org.cadixdev.licenser' version '0.6.1'
    id 'com.diffplug.spotless' version '6.13.0'
    id 'net.minecraftforge.gradle' version '6.+'
    id 'net.galacticraft.internal.legacy' version '1.0.5'
    id 'nexus-publishing' version '2.1'
}

group = "dev.galacticraft"
archivesBaseName = "Galacticraft"
version = "${mod_version}${version_suffix}"

java.toolchain.languageVersion = JavaLanguageVersion.of(8)

repositories {
    mavenCentral()
    maven {
        name 'galacticraft'
        url 'https://maven.galacticraft.net/repository/legacy-common/'
    }
}

dependencies {
    minecraft "net.minecraftforge:forge:${MC_VERSION}-${forge_version}"

    compileRequired fg.deobf('mod.dependency:mekanism:9.8.3.390')
    compileRequired fg.deobf('mod.dependency:industrialcraft-2:2.8.222-ex112')
    compileRequired fg.deobf('mod.dependency:buildcraft-api:7.99.24.8')
    compileOnly fg.deobf('mod.dependency:biomes-o-plenty:7.0.1.2445')
    compileOnly fg.deobf('mod.dependency:appliedenergistics2:rv6-stable-7')
    compileOnly fg.deobf('mod.dependency:redstoneflux:2.1.1.1')
    compileOnly fg.deobf('mod.dependency:actuallyadditions:r152')
    compileOnly fg.deobf('mod.dependency:playerapi:1.1')
    compileOnly fg.deobf('mod.dependency:journeymap:5.7.1')
    compileOnly fg.deobf('mod.dependency:jei:4.16.1.302:api')
    runtimeOnly fg.deobf('mod.dependency:jei:4.16.1.302')
    
    // Project lombok
    compileOnly 'org.projectlombok:lombok:1.18.24'
    annotationProcessor 'org.projectlombok:lombok:1.18.24'
    testCompileOnly 'org.projectlombok:lombok:1.18.24'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
}

spotless {
	enforceCheck false
    java {
        target 'src/*/java/micdoodle8/mods/**/*.java'
        endWithNewline()
        trimTrailingWhitespace()
        removeUnusedImports()
        indentWithSpaces()
    }
}

license {
    header = project.file('etc/HEADER')
    properties {
        company = 'Team Galacticraft'
        year = Calendar.getInstance().get(Calendar.YEAR);
    }
    ignoreFailures = true
    include '**/*.java'
}

clean {
    def filteredDelete = new HashSet<>()
    for (def toDelete : getDelete()) {
        for (def f : file(toDelete).listFiles()) {
            if (f.getName() != "fg_cache") {
                filteredDelete.add(f)
            }
        }
    }
    setDelete(filteredDelete)
}

tokens {
    replace('version', version)
}

maven {
	excludeDependencies('forge', 'jei')
	artifacts(mavenJar, deobfJar, sourcesJar)
}


tasks.withType(GenerateModuleMetadata).configureEach {
    enabled = false
}

@zeng-github01
Copy link
Author

zeng-github01 commented May 5, 2024

@xJon
image

build java: official java 1.8 latest

@ROMVoid95 ROMVoid95 added [Status] Requires Testing A fix is in progress and requires testing before determined suitable [Status] Resolved / Fixed In Dev A fix is present in the repository code but has yet to be included in a released version and removed [Status] Triage Requires review for validity and severity if the issue is valid labels May 6, 2024
@ACGaming
Copy link

ACGaming commented May 6, 2024

Removing id 'net.galacticraft.changelog' version '1.0.4' along with the changelog and modpublishing block fixed it for me.

@zeng-github01
Copy link
Author

Removing id 'net.galacticraft.changelog' version '1.0.4' along with the changelog and modpublishing block fixed it for me.

This works, but for me it needed a little change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Attribute] Bug Report [Status] Requires Testing A fix is in progress and requires testing before determined suitable [Status] Resolved / Fixed In Dev A fix is present in the repository code but has yet to be included in a released version
Projects
None yet
Development

No branches or pull requests

4 participants