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 apply multiple AWs from different Subprojects #235

Open
Charismara opened this issue Aug 31, 2024 · 0 comments
Open

Unable to apply multiple AWs from different Subprojects #235

Charismara opened this issue Aug 31, 2024 · 0 comments

Comments

@Charismara
Copy link

Charismara commented Aug 31, 2024

Arch loom seems to only apply one AWs from a different subproject instead of all. I ran into this issue while working on my Lib Mod which is split in multiple small modules.

My Setup

I got multiple modules and each module as their own common, fabric and neoforge gradle subprojects. There is one testing module which includes all other modules. The the common testing project defines those inclusions using the following code:

ext {
    includedProjects = [
            ":network",
            ":storage",
            ":inventory"
    ]
}

loom {
    mods {
        includedProjects.forEach {
            def moduleProject = project("$it-common")
            register(moduleProject.name) {
                sourceSet("main", moduleProject)
            }
        }
    }
}

dependencies {
    includedProjects.forEach {
        implementation(project(path: "$it-common", configuration: 'namedElements')) { transitive false }
    }
}

the testing fabric and neoforge subprojects use the includedProjects prob to include the correct module subproject to the runtime

loom {
    mods {
        project(":testing-common").includedProjects.forEach {
            def moduleProject = project("$it-neoforge")
            register(moduleProject.name) {
                sourceSet("main", moduleProject)
            }
        }
    }
}

dependencies {
    project(":testing-common").includedProjects.forEach {
        common(project(path: "$it-common", configuration: 'namedElements')) { transitive false }
        implementation(project(path: "$it-fabric", configuration: 'namedElements')) // For fabric only
        implementation(project(path: "$it-neoforge", configuration: 'namedElements')) { transitive false } // For neoforge only
    }
}

This setup work when only the first included module (in this case network) contains an AW and no other project. The AWs of the other modules won't get applied. When removing network from the includedProjects the next existing AW in that list will get applied (in my case storage has an empty AW which causes the inventory AW to get applied).

Expected Behavior

I would expect that all AWs would get applied to the testing project

Actual Behavior

Only the fist AW (with atleast one entry) in the includedProjects array gets applied. Every other AW gets ignored which leads to java.lang.IllegalAccessError

Note

I understand that this is an edge case caused by my project structure but i would be grateful if the behavior would be changed to resolve this issue.

Env Information

Architect Plugin: 3.4.159
Architectury Loom: 1.7.412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant