Skip to content

Commit

Permalink
Merge pull request #2619 from maximuslotro/1.7.10/develop
Browse files Browse the repository at this point in the history
Make Annotation Processing cleaner for IDEs
  • Loading branch information
spacebuilder2020 committed Jan 29, 2023
2 parents 2c123a4 + f031f86 commit 277a6bf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
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

0 comments on commit 277a6bf

Please sign in to comment.