mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Double ProGuard task
This commit is contained in:
parent
7724c904e5
commit
8ab1dda430
1 changed files with 8 additions and 2 deletions
|
@ -28,16 +28,22 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon
|
||||||
public boolean enabled = true;
|
public boolean enabled = true;
|
||||||
public boolean mappings = true;
|
public boolean mappings = true;
|
||||||
public transient ProguardConf proguardConf;
|
public transient ProguardConf proguardConf;
|
||||||
|
private transient LaunchServer launchServer;
|
||||||
|
private transient ProGuardBuildTask buildTask;
|
||||||
private transient static final Logger logger = LogManager.getLogger();
|
private transient static final Logger logger = LogManager.getLogger();
|
||||||
@Override
|
@Override
|
||||||
public void init(LaunchServer launchServer) {
|
public void init(LaunchServer launchServer) {
|
||||||
|
this.launchServer = launchServer;
|
||||||
proguardConf = new ProguardConf(launchServer, this);
|
proguardConf = new ProguardConf(launchServer, this);
|
||||||
launchServer.launcherBinary.addAfter((v) -> v.getName().startsWith(modeAfter), new ProGuardBuildTask(launchServer, proguardConf, this));
|
this.buildTask = new ProGuardBuildTask(launchServer, proguardConf, this);
|
||||||
|
launchServer.launcherBinary.addAfter((v) -> v.getName().startsWith(modeAfter), buildTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws Exception {
|
public void close() throws Exception {
|
||||||
|
if(launchServer != null && buildTask != null) {
|
||||||
|
launchServer.launcherBinary.tasks.remove(buildTask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue