Skip to content

Conversation

@Phoenix-Starlight
Copy link
Contributor

@Phoenix-Starlight Phoenix-Starlight commented Nov 23, 2023

Resolves #297
1 (or 2?) ugly hack since AP output API doesn't have anything for resources
On the positive side, the directory scanning hack is dead.

  • Auto-generate mixin configs
  • Integrate AP
  • Get victims to test whether or not it explodes
  • New: Emit compile-time errors for mixins that target client side classes but are not annotated with @ClientOnlyMixin
  • Fix remaining compile-time errors

@embeddedt
Copy link
Owner

I can test it easily by checking that it generates the same JSON as the previous approach. No victims required.

@Phoenix-Starlight
Copy link
Contributor Author

RemapJar task originally didn't take the JSON. (Hence the hack into resource sourceset)

@Phoenix-Starlight Phoenix-Starlight force-pushed the dev/1.16/migrate-client-mixins branch 2 times, most recently from dd0a2c0 to a18011f Compare November 25, 2023 21:04
@Phoenix-Starlight Phoenix-Starlight force-pushed the dev/1.16/migrate-client-mixins branch 3 times, most recently from 8a47f47 to 43dc5b7 Compare December 6, 2023 02:48
@Phoenix-Starlight Phoenix-Starlight force-pushed the dev/1.16/migrate-client-mixins branch 3 times, most recently from a9d2017 to dab2570 Compare December 17, 2023 06:15
@Phoenix-Starlight
Copy link
Contributor Author

Ready. (Merge conflicts incoming for later branches...)

@Phoenix-Starlight Phoenix-Starlight force-pushed the dev/1.16/migrate-client-mixins branch from 8894482 to 9770d55 Compare December 19, 2023 18:55
Phoenix-Starlight and others added 17 commits December 24, 2023 14:04
- Takes two compiler arguments: -ArootProject.name and an optional -Aproject.name
Use fabric mixin dependency
Enable preview features for annotation processor only
Apparently class retained annotations are not available in AnnotatedConstruct#getAnnotation
- Prefer TypeElements over TypeMirrors
- Add debug option to log classes that couldn't be loaded
- Reorganize exception logging
Halt AP on exception
@Phoenix-Starlight Phoenix-Starlight force-pushed the dev/1.16/migrate-client-mixins branch from 1b5fd4b to cfae648 Compare December 24, 2023 22:07
Copy link
Owner

@embeddedt embeddedt left a comment

Choose a reason for hiding this comment

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

Very good work; I'm very happy with this. Tested locally and the generated mixin list is identical to my original hack, except it properly splits client mixins into the client list.

I just have one last question before merging.

(At some point, we might consider moving this into a standalone plugin so that it can be used by other projects.)

@embeddedt embeddedt merged commit 06bfd71 into embeddedt:1.16 Dec 28, 2023
@Phoenix-Starlight Phoenix-Starlight deleted the dev/1.16/migrate-client-mixins branch December 29, 2023 02:55
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.

Don't initialize client mixins in a server environment

2 participants