mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] GSON serialize Record
This commit is contained in:
parent
2d0957f834
commit
f8569f9165
3 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,9 @@
|
|||
maven {
|
||||
url "https://jcenter.bintray.com/"
|
||||
}
|
||||
maven {
|
||||
url "https://jitpack.io/"
|
||||
}
|
||||
}
|
||||
|
||||
sourceCompatibility = '17'
|
||||
|
@ -72,6 +75,7 @@ task cleanjar(type: Jar, dependsOn: jar) {
|
|||
dependencies {
|
||||
pack project(':LauncherAPI')
|
||||
bundle group: 'me.tongfei', name: 'progressbar', version: '0.9.2'
|
||||
bundle group: 'com.github.Marcono1234', name: 'gson-record-type-adapter-factory', version: 'v0.1.0'
|
||||
bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi']
|
||||
bundle group: 'org.jline', name: 'jline', version: rootProject['verJline']
|
||||
bundle group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import marcono1234.gson.recordadapter.RecordTypeAdapterFactory;
|
||||
import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent;
|
||||
import pro.gravit.launcher.managers.GsonManager;
|
||||
import pro.gravit.launcher.modules.events.PreGsonPhase;
|
||||
|
@ -33,6 +34,7 @@ public LaunchServerGsonManager(LaunchServerModulesManager modulesManager) {
|
|||
@Override
|
||||
public void registerAdapters(GsonBuilder builder) {
|
||||
super.registerAdapters(builder);
|
||||
builder.registerTypeAdapterFactory(RecordTypeAdapterFactory.DEFAULT);
|
||||
builder.registerTypeAdapter(TextureProvider.class, new UniversalJsonAdapter<>(TextureProvider.providers));
|
||||
builder.registerTypeAdapter(AuthCoreProvider.class, new UniversalJsonAdapter<>(AuthCoreProvider.providers));
|
||||
builder.registerTypeAdapter(PasswordVerifier.class, new UniversalJsonAdapter<>(PasswordVerifier.providers));
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
maven {
|
||||
url "https://jcenter.bintray.com/"
|
||||
}
|
||||
maven {
|
||||
url "https://jitpack.io/"
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
|
|
Loading…
Reference in a new issue