Sebastian Stenzel пре 3 година
родитељ
комит
b47beabc2f
2 измењених фајлова са 8 додато и 3 уклоњено
  1. 4 0
      pom.xml
  2. 4 3
      src/main/java/org/cryptomator/launcher/Cryptomator.java

+ 4 - 0
pom.xml

@@ -258,6 +258,10 @@
 							<version>${dagger.version}</version>
 						</path>
 					</annotationProcessorPaths>
+					<compilerArgs>
+						<arg>-Adagger.fastInit=enabled</arg>
+						<arg>-Adagger.formatGeneratedSource=enabled</arg>
+					</compilerArgs>
 				</configuration>
 			</plugin>
 			<plugin>

+ 4 - 3
src/main/java/org/cryptomator/launcher/Cryptomator.java

@@ -5,6 +5,7 @@
  *******************************************************************************/
 package org.cryptomator.launcher;
 
+import dagger.Lazy;
 import org.apache.commons.lang3.SystemUtils;
 import org.cryptomator.logging.DebugMode;
 import org.cryptomator.logging.LoggerConfiguration;
@@ -32,10 +33,10 @@ public class Cryptomator {
 	private final IpcFactory ipcFactory;
 	private final Optional<String> applicationVersion;
 	private final CountDownLatch shutdownLatch;
-	private final UiLauncher uiLauncher;
+	private final Lazy<UiLauncher> uiLauncher;
 
 	@Inject
-	Cryptomator(LoggerConfiguration logConfig, DebugMode debugMode, IpcFactory ipcFactory, @Named("applicationVersion") Optional<String> applicationVersion, @Named("shutdownLatch") CountDownLatch shutdownLatch, UiLauncher uiLauncher) {
+	Cryptomator(LoggerConfiguration logConfig, DebugMode debugMode, IpcFactory ipcFactory, @Named("applicationVersion") Optional<String> applicationVersion, @Named("shutdownLatch") CountDownLatch shutdownLatch, Lazy<UiLauncher> uiLauncher) {
 		this.logConfig = logConfig;
 		this.debugMode = debugMode;
 		this.ipcFactory = ipcFactory;
@@ -89,7 +90,7 @@ public class Cryptomator {
 	 */
 	private int runGuiApplication() {
 		try {
-			uiLauncher.launch();
+			uiLauncher.get().launch();
 			shutdownLatch.await();
 			LOG.info("UI shut down");
 			return 0;