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

Make Annotation Processing cleaner for IDEs #2619

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -30,6 +30,10 @@ If you open ForgeEssentials in your IDE, you must turn on annotation processing,
- Under `Annotation Processors`, add this fully qualified name: `org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor`
- Run `Build > Rebuild Project`
- Right click `.apt_generated` directory and select `Mark as > Source directory`

### FALLBACK
- If none of the above options work for your IDEs, you can use do the following.
- Add `/misc/forgeessentials-1.7.10-annonations.jar` to your build path.

# Notes
1. Please consider squashing all commits before initially submitting pull requests
Expand Down
37 changes: 37 additions & 0 deletions build.gradle
Expand Up @@ -410,6 +410,42 @@ reobf {
}
}

/************************************************************
* Configure Annotations for IDEs Jar
*/

// util.jar
task Annotations(type: Jar) {
classifier = "annotations"
appendix = project.minecraft.version

from(sourceSets.utils.output) {
include "com/forgeessentials/playerlogger/entity/**"
exclude "com/forgeessentials/playerlogger/entity/Action.class"
exclude "com/forgeessentials/playerlogger/entity/Action01Block\$ActionBlockType.class"
exclude "com/forgeessentials/playerlogger/entity/Action01Block.class"
exclude "com/forgeessentials/playerlogger/entity/Action02Command.class"
exclude "com/forgeessentials/playerlogger/entity/Action03PlayerEvent\$PlayerEventType.class"
exclude "com/forgeessentials/playerlogger/entity/Action03PlayerEvent.class"
exclude "com/forgeessentials/playerlogger/entity/Action04PlayerPosition.class"
exclude "com/forgeessentials/playerlogger/entity/BlockData.class"
exclude "com/forgeessentials/playerlogger/entity/PlayerData.class"
exclude "com/forgeessentials/playerlogger/entity/WorldData.class"

doLast {
delete fileTree(dir:'misc', include: '**annotations.jar')
copy {
from files("build/libs/") {
include "**annotations.jar"
}
into "misc"
rename 'forgeessentials-'+project.minecraft.version+"-"+project.version+'-annotations.jar', 'forgeessentials-'+project.minecraft.version+'-annotations.jar'
}
delete fileTree(dir:'build/libs/', include: '**annotations.jar')
}
}
}

/************************************************************
* Others
*/
Expand All @@ -418,6 +454,7 @@ reobf {
artifacts {
archives deobfJar
archives clientJar
archives Annotations
}

task wrapper(type: Wrapper) {
Expand Down
Binary file added misc/forgeessentials-1.7.10-annotations.jar
Binary file not shown.
Expand Up @@ -95,15 +95,15 @@ public void parse(CommandParserArgs arguments)
if (arguments.isEmpty())
{
arguments.confirm("/tm add <message>: Add a message");
arguments.confirm("/tm list: Delete a message");
arguments.confirm("/tm list: List all messages");
arguments.confirm("/tm delete <id>: Delete a message");
arguments.confirm("/tm send <id>: Send a message");
arguments.confirm("/tm interval <sec>: Set message interval");
arguments.confirm("/tm shuffle <true|false>: Enable/disable shuffling of messages");
return;
}

arguments.tabComplete("add", "list", "delete", "interval", "random");
arguments.tabComplete("add", "list", "delete", "send", "interval", "shuffle");
String sumCmd = arguments.remove().toLowerCase();
switch (sumCmd)
{
Expand Down