Fix delombok package not exists error with proto generated files (#2083)

Fix javadoc & suppress no comments warning
Fix terminal interaction in IDEA
Update lombok onMethod to JDK8 version
Some code reformat
This commit is contained in:
yzr 2023-03-31 14:16:32 +08:00 committed by GitHub
parent 88d8310e7e
commit cf4cd80010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 67 additions and 53 deletions

View File

@ -93,8 +93,8 @@ dependencies {
implementation group: 'org.luaj', name: 'luaj-jse', version: '3.0.1'
implementation group: 'com.esotericsoftware', name : 'reflectasm', version: '1.11.9'
implementation group: 'com.github.davidmoten', name : 'rtree-multi', version: '0.1'
implementation group: 'com.esotericsoftware', name: 'reflectasm', version: '1.11.9'
implementation group: 'com.github.davidmoten', name: 'rtree-multi', version: '0.1'
implementation group: 'io.javalin', name: 'javalin', version: '4.6.4'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.3'
@ -181,8 +181,8 @@ publishing {
}
repositories {
maven {
if(version.endsWith('-dev')) {
println ("Publishing to 4benj-maven")
if (version.endsWith('-dev')) {
println("Publishing to 4benj-maven")
url 'https://repo.4benj.com/releases'
name '4benj-maven'
credentials {
@ -190,7 +190,7 @@ publishing {
password System.getenv('benj_maven_token')
}
} else {
println ("Publishing to sonatype")
println("Publishing to sonatype")
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
@ -222,7 +222,7 @@ sourceSets {
srcDir 'src/generated'
}
java {
srcDir 'src/java'
srcDir 'src/generated/main/java'
}
}
}
@ -238,23 +238,25 @@ idea {
eclipse {
classpath {
file.whenMerged { cp ->
cp.entries.add( new org.gradle.plugins.ide.eclipse.model.SourceFolder('src/generated/main/java', null) )
file.whenMerged { cp -> cp.entries.add(new org.gradle.plugins.ide.eclipse.model.SourceFolder('src/generated/main/java', null))
}
}
}
signing {
if(!version.endsWith('-dev')) {
if (!version.endsWith('-dev')) {
sign publishing.publications.mavenJava
}
}
javadoc {
options.encoding = 'UTF-8'
if(JavaVersion.current().isJava9Compatible()) {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
// Add this to avoid warning caused by lack of comments in proto generated java files
options.addStringOption('Xdoclint:none', '-quiet')
exclude '**/*.md'
}
task injectGitHash {
@ -266,8 +268,7 @@ task injectGitHash {
}
}
new File(projectDir, "src/main/java/emu/grasscutter/BuildConfig.java").text =
"""package emu.grasscutter;
new File(projectDir, "src/main/java/emu/grasscutter/BuildConfig.java").text = """package emu.grasscutter;
public final class BuildConfig {
public static final String VERSION = \"${version}\";
@ -279,3 +280,16 @@ public final class BuildConfig {
processResources {
dependsOn "generateProto"
}
sourcesJar {
dependsOn "generateProto"
}
delombok {
dependsOn "generateProto"
}
// For terminal interacting in IDEA running
run {
standardInput = System.in
}

View File

@ -13,7 +13,7 @@ import java.util.List;
@Getter
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ActivityWatcherData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
int id;
int rewardID;
int progress;

View File

@ -44,7 +44,7 @@ public class AvatarData extends GameResource {
private float criticalHurt;
private List<PropGrowCurve> propGrowCurves;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
// Transient

View File

@ -9,7 +9,7 @@ import lombok.Getter;
@ResourceType(name = "AvatarSkillExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
@Getter
public class AvatarSkillData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private float cdTime;
private int costElemVal;

View File

@ -20,7 +20,7 @@ import lombok.Getter;
@ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH)
@Getter
public class AvatarSkillDepotData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int energySkill;
private int attackModeSkill;

View File

@ -14,7 +14,7 @@ import lombok.Getter;
@ResourceType(name = {"BattlePassMissionExcelConfigData.json"})
@Getter
public class BattlePassMissionData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int addPoint;
private int scheduleId;

View File

@ -9,7 +9,7 @@ import lombok.Getter;
@ResourceType(name = "BlossomRefreshExcelConfigData.json")
@Getter
public class BlossomRefreshExcelConfigData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
// Map details
private long nameTextMapHash;

View File

@ -15,7 +15,7 @@ import java.util.Map;
@Setter // TODO: remove on next API break
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ChapterData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
int id;
int beginQuestId;
int endQuestId;

View File

@ -9,7 +9,7 @@ import lombok.Getter;
@ResourceType(name = {"AnimalCodexExcelConfigData.json"})
@Getter
public class CodexAnimalData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int Id;
private String type;
private int describeId;

View File

@ -10,7 +10,7 @@ import java.util.List;
@ResourceType(name = {"CompoundExcelConfigData.json"},loadPriority = ResourceType.LoadPriority.LOW)
@Getter
public class CompoundData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int groupID;
private int rankLevel;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
@ResourceType(name = {"CookRecipeExcelConfigData.json"}, loadPriority = LoadPriority.LOW)
@Getter
public class CookRecipeData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int rankLevel;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
@ResourceType(name = "DailyDungeonConfigData.json")
public class DailyDungeonData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int[] monday;
private int[] tuesday;

View File

@ -7,7 +7,7 @@ import lombok.Getter;
@ResourceType(name = "DungeonExcelConfigData.json")
public class DungeonData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
@Getter private int sceneId;
@Getter private int showLevel;

View File

@ -9,7 +9,7 @@ import lombok.Setter;
@Getter
@Setter // TODO: remove this next API break
public class DungeonEntryData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int dungeonEntryId;
private int sceneId;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
@ResourceType(name = {"ForgeExcelConfigData.json"}, loadPriority = LoadPriority.HIGHEST)
@Getter
public class ForgeData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int playerLevel;
private int forgeType;

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@ResourceType(name = "GadgetExcelConfigData.json")
@Getter
public class GadgetData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private EntityType type;

View File

@ -13,7 +13,7 @@ import java.util.List;
@Getter
@FieldDefaults(level = AccessLevel.PRIVATE)
public class InvestigationMonsterData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
int id;
int cityId;
List<Integer> monsterIdList;

View File

@ -25,7 +25,7 @@ import lombok.Getter;
@Getter
public class ItemData extends GameResource {
// Main
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int stackLimit = 1;
private int maxUseCount;

View File

@ -19,7 +19,7 @@ import lombok.Getter;
public class MonsterData extends GameResource {
static public Set<FightProperty> definedFightProperties = Set.of(FightProperty.FIGHT_PROP_BASE_HP, FightProperty.FIGHT_PROP_BASE_ATTACK, FightProperty.FIGHT_PROP_BASE_DEFENSE, FightProperty.FIGHT_PROP_PHYSICAL_SUB_HURT, FightProperty.FIGHT_PROP_FIRE_SUB_HURT, FightProperty.FIGHT_PROP_ELEC_SUB_HURT, FightProperty.FIGHT_PROP_WATER_SUB_HURT, FightProperty.FIGHT_PROP_GRASS_SUB_HURT, FightProperty.FIGHT_PROP_WIND_SUB_HURT, FightProperty.FIGHT_PROP_ROCK_SUB_HURT, FightProperty.FIGHT_PROP_ICE_SUB_HURT);
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private String monsterName;

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@ResourceType(name = "MonsterDescribeExcelConfigData.json", loadPriority = LoadPriority.HIGH)
@Getter
public class MonsterDescribeData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private long nameTextMapHash;
private int titleID;

View File

@ -10,7 +10,7 @@ import lombok.experimental.FieldDefaults;
@Getter
@FieldDefaults(level = AccessLevel.PRIVATE)
public class MusicGameBasicData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
int id;
int musicID;
int musicLevel;

View File

@ -7,7 +7,7 @@ import lombok.Getter;
@ResourceType(name = "NpcExcelConfigData.json")
@Getter
public class NpcData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private String jsonName;

View File

@ -10,7 +10,7 @@ import java.util.List;
@ResourceType(name = "OpenStateConfigData.json", loadPriority = ResourceType.LoadPriority.HIGHEST)
public class OpenStateData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
@Getter private boolean defaultState;
@Getter private boolean allowClientOpen;

View File

@ -14,7 +14,7 @@ import java.util.List;
@Setter // TODO: remove setters next API break
@FieldDefaults(level = AccessLevel.PRIVATE)
public class PersonalLineData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
int id;
int avatarID;
List<Integer> preQuestId;

View File

@ -10,7 +10,7 @@ import lombok.Getter;
@ResourceType(name = "ReliquaryAffixExcelConfigData.json")
@Getter
public class ReliquaryAffixData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int depotId;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
@ResourceType(name = "ReliquaryLevelExcelConfigData.json")
public class ReliquaryLevelData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private Int2FloatMap propMap;

View File

@ -10,7 +10,7 @@ import lombok.Getter;
@ResourceType(name = "ReliquaryMainPropExcelConfigData.json")
@Getter
public class ReliquaryMainPropData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private int propDepotId;

View File

@ -12,7 +12,7 @@ import emu.grasscutter.data.common.ItemParamStringData;
@ResourceType(name = "RewardPreviewExcelConfigData.json", loadPriority = LoadPriority.HIGH)
public class RewardPreviewData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
private ItemParamStringData[] previewItems;
private ItemParamData[] previewItemsArray;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
@ResourceType(name = "SceneExcelConfigData.json")
@Getter
public class SceneData extends GameResource {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int id;
@SerializedName("type")
private SceneType sceneType;

View File

@ -7,9 +7,9 @@ import emu.grasscutter.utils.Position;
import lombok.Getter;
public abstract class EntityBaseGadget extends GameEntity {
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
protected final Position position;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
protected final Position rotation;
public EntityBaseGadget(Scene scene) {

View File

@ -25,7 +25,7 @@ import lombok.Getter;
public class EntityClientGadget extends EntityBaseGadget {
@Getter private final Player owner;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private int gadgetId;
@Getter private int campId;

View File

@ -40,13 +40,13 @@ import javax.annotation.Nullable;
@ToString(callSuper = true)
public class EntityGadget extends EntityBaseGadget {
@Getter private final GadgetData gadgetData;
@Getter(onMethod = @__(@Override)) @Setter
@Getter(onMethod_ = @Override) @Setter
private int gadgetId;
@Getter @Setter private int state;
@Getter @Setter private int pointType;
@Getter private GadgetContent content;
@Getter(onMethod = @__(@Override), lazy = true)
@Getter(onMethod_ = @Override, lazy = true)
private final Int2FloatMap fightProperties = new Int2FloatOpenHashMap();
@Getter @Setter private SceneGadget metaGadget;
@Nullable @Getter

View File

@ -37,12 +37,12 @@ import lombok.Setter;
public class EntityMonster extends GameEntity {
@Getter private final MonsterData monsterData;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Int2FloatOpenHashMap fightProperties;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Position position;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Position rotation;
@Getter private final Position bornPos;
@Getter private final int level;

View File

@ -9,9 +9,9 @@ import it.unimi.dsi.fastutil.ints.Int2FloatMap;
import lombok.Getter;
public class EntityNPC extends GameEntity{
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Position position;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Position rotation;
private final SceneNPC metaNpc;
@Getter private final int suiteId;

View File

@ -35,7 +35,7 @@ import java.util.List;
public class EntityVehicle extends EntityBaseGadget {
@Getter private final Player owner;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Int2FloatMap fightProperties;
@Getter private final int pointId;

View File

@ -20,11 +20,11 @@ import javax.annotation.Nullable;
public class EntityPlatform extends EntityBaseGadget {
@Getter
private final Player owner;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final int gadgetId;
@Getter
private final EntityClientGadget gadget;
@Getter(onMethod = @__(@Override))
@Getter(onMethod_ = @Override)
private final Int2FloatMap fightProperties;
@Nullable
@Getter