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

Backend: Add unimined build system #1456

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Conversation

nea89o
Copy link
Contributor

@nea89o nea89o commented Apr 15, 2024

What

This changes the build system from architectury loom to unimined.

This has some advantages and disadvantages.

For Loom

  • Dependency configurations and tasks get generated during plugin initialization
    • This means you can directly refer to configurations and (most) tasks using type safe accessors
  • Logging is set up automatically (including minecrell)
  • A decent amount of launching is handled after handing off to the runtime. The build system writes all the config to a shared config file, meaning new run configurations are created quite easily.

For Unimined

  • Non-main source sets can receive minecraft dependencies.
    • This means that configurations for that (and the main source set) are not available as type safe accessors
    • You can create new segregated source sets to limit which parts of the code can access certain dependencies
  • Remapping in theory is faster for mixins, but not really. Benchmarks roughly the same.
  • We have more control over logging.
  • You can create new run configs only via custom source sets. This does mean that it is slightly more effort to do this, but you also have more capabilities to configure those runs.

Migration

In theory the only migration that is needed is to delete the Minecraft Client run configuration. It will then regenerate as needed by unimined. It will also allow you to directly use the runClient gradle task.

Motive

The main motive behind this is the individual source set support. This allows us to easier export a public (stable) API to allow other mods to interact with us. Another thing is to limit NEU to only a certain subset of the code. Yet another thing would be to potentially allow breaking out parts of the code into another source set for a sort of "libskyhanni" library that other mods can shade and relocate to jumpstart their mod with rich libraries.

Changelog Technical Details

  • Switched build system to unimined. - !nea
  • Changed auto mixins to be gathered at compile time, rather than runtime. - !nea

exclude_from_changelog
since this pr gets reverted with e76b356

@github-actions github-actions bot added the Merge Conflicts There are open merge conflicts with the beta branch. label Apr 16, 2024
Copy link

This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes.

@github-actions github-actions bot removed the Merge Conflicts There are open merge conflicts with the beta branch. label Apr 16, 2024
Copy link

Conflicts have been resolved! 🎉

@nea89o nea89o force-pushed the feat/unimined branch 4 times, most recently from 85fe85b to 7bff381 Compare April 16, 2024 17:17
@nea89o nea89o marked this pull request as ready for review April 16, 2024 17:30
@nea89o nea89o changed the title Add unimined p1 Add unimined build system Apr 16, 2024
@hannibal002 hannibal002 added the Soon This Pull Request will be merged within the next couple of betas label Apr 16, 2024
@hannibal002 hannibal002 added this to the Version 0.25 milestone Apr 16, 2024
@nea89o nea89o force-pushed the feat/unimined branch 2 times, most recently from 6053b19 to 940a768 Compare April 18, 2024 10:35
@hannibal002 hannibal002 changed the title Add unimined build system Backend: Add unimined build system Apr 19, 2024
Copy link
Owner

@hannibal002 hannibal002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces build process after one class changed from ~1m5s to 45s for me

@hannibal002 hannibal002 merged commit 40309bc into hannibal002:beta Apr 19, 2024
3 checks passed
@github-actions github-actions bot removed the Soon This Pull Request will be merged within the next couple of betas label Apr 19, 2024
hannibal002 added a commit that referenced this pull request Apr 22, 2024
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

Successfully merging this pull request may close these issues.

2 participants