Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Integrate Headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed Oct 31, 2021
1 parent 114028e commit 65137e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 62 deletions.
10 changes: 3 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
jacoco
application
distribution
kotlin("jvm") version "1.5.20"
id("com.github.spotbugs") version "4.7.9"
id("com.diffplug.spotless") version "5.17.1"
id("com.github.kt3k.coveralls") version "2.12.0"
Expand All @@ -26,9 +27,6 @@ fun getProps(f: File): Properties {
return props
}

// load local.properties when exist.
val localProperties = getProps(File(rootDir, "local.properties"))

// we handle cases without .git directory
val props = project.file("src/main/resources/version.properties")
val dotgit = project.file(".git")
Expand Down Expand Up @@ -62,7 +60,7 @@ tasks.getByName("jar") {
group = "io.github.eb4j"

application {
mainClass.set("io.github.eb4j.ebview.HeadlessEBViewer")
mainClass.set("io.github.eb4j.ebview.EBViewer")
}

application.applicationDistribution.into("") {
Expand All @@ -78,9 +76,7 @@ dependencies {
implementation("io.github.eb4j:eb4j:2.3.0")
implementation("org.slf4j:slf4j-simple:1.7.30")

if (localProperties["useLocalProjectorServer"] == "true") {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))

implementation("commons-io:commons-io:2.11.0")
implementation("org.apache.commons:commons-lang3:3.12.0")
Expand Down
8 changes: 0 additions & 8 deletions local.properties

This file was deleted.

7 changes: 7 additions & 0 deletions src/main/java/io/github/eb4j/ebview/EBViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import io.github.eb4j.ebview.dictionary.DictionariesManager;
import io.github.eb4j.ebview.gui.MainWindow;
import io.github.eb4j.ebview.gui.MainWindowMenu;
import org.jetbrains.projector.server.ProjectorLauncher;
import org.jetbrains.projector.server.ProjectorServer;
import tokyo.northside.protocol.URLProtocolHandler;

import javax.swing.JFrame;
Expand Down Expand Up @@ -36,6 +38,11 @@ public JFrame getApplicationFrame() {
* @param args command line arguments.
*/
public static void main(final String... args) {
// if (ProjectorServer.isEnabled()) {
if (!ProjectorLauncher.runProjectorServer()) {
throw new RuntimeException("Fail to start projector server");
}
// }
URLProtocolHandler.install();
FlatLightLaf.setup();
File dictionaryDirectory = null;
Expand Down
47 changes: 0 additions & 47 deletions src/main/java/io/github/eb4j/ebview/HeadlessEBViewer.java

This file was deleted.

0 comments on commit 65137e2

Please sign in to comment.