Skip to content

Commit

Permalink
Configured JLink. Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BMagnu committed Jan 7, 2020
1 parent c6c22bf commit 69ec15f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 110 deletions.
Binary file added jlinkImageContent/Client.exe
Binary file not shown.
Binary file added jlinkImageContent/Server.exe
Binary file not shown.
1 change: 1 addition & 0 deletions jlinkImageContent/Start_Client.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.\bin\java.exe --module pixit/net.bmagnu.pixit.client.Client
1 change: 1 addition & 0 deletions jlinkImageContent/Start_Server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.\bin\java.exe --module pixit/net.bmagnu.pixit.server.Server "%~1"
2 changes: 1 addition & 1 deletion config.json → jlinkImageContent/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allowEmptyTheme" : true,
"portServer" : 53415,
"numPlayers" : 2,
"numPlayers" : 4,
"pointsCorrectGuess" : 3,
"pointsGoodCzar" : 2,
"pointsGotGuessed" : 1,
Expand Down
109 changes: 9 additions & 100 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,89 +35,18 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/bin/java</executable>
<arguments>
<argument>--module-path</argument>
<argument>
${project.build.directory}/modules
</argument>
<argument>--module</argument>
<argument>${moduleName}/${mainClass}</argument>
</arguments>
</configuration>
</execution>
</executions>

</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.3</version>
<configuration>
<outputDirectory>
${project.build.directory}/modules
</outputDirectory>
<stripDebug>true</stripDebug>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<noManPages>true</noManPages>
<jlinkImageName>pixit</jlinkImageName>
<mainClass>pixit/net.bmagnu.pixit.client.Client</mainClass>
</configuration>
</plugin>


<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Beta1</version>
<executions>
<execution>
<id>create-runtime-image</id>
<phase>package</phase>
<goals>
<goal>create-runtime-image</goal>
</goals>
<configuration>
<modulePath>
<path>${project.build.directory}/modules</path>
</modulePath>
<modules>
<module>${moduleName}</module>
<!-- <module>javafx.controls</module> <module>javafx.graphics</module> -->
</modules>
<launcher>
<name>PiXit</name>
<module>${moduleName}/${mainClass}</module>
</launcher>
<compression>2</compression>
<stripDebug>true</stripDebug>
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/modules</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
Expand All @@ -127,30 +56,10 @@
<version>2.8.6</version>
</dependency>

<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>${javafx.version}</version>
</dependency>
</dependencies>
</project>
Binary file added res/net/bmagnu/pixit/client/icon.ico
Binary file not shown.
8 changes: 3 additions & 5 deletions src/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
exports net.bmagnu.pixit.client;

exports net.bmagnu.pixit.client.handlers;

requires activation;

requires javafx.base;


requires javafx.controls;

requires javafx.fxml;

requires transitive javafx.graphics;

requires javafx.base;

requires transitive com.google.gson;

opens net.bmagnu.pixit.client to javafx.fxml;
Expand Down
12 changes: 8 additions & 4 deletions src/net/bmagnu/pixit/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;

import javax.activation.MimetypesFileTypeMap;

import net.bmagnu.pixit.common.Settings;

public class Server {
Expand Down Expand Up @@ -67,8 +65,14 @@ public void run(String imgPath) throws InterruptedException, IOException {
private void initImages(String path) throws IOException {

Files.walk(Paths.get(path)).filter((file) -> {
String mime = new MimetypesFileTypeMap().getContentType(file.toFile());
return mime.split("/")[0].equals("image");
String mime;
try {
mime = Files.probeContentType(file);
return mime != null && mime.split("/")[0].equals("image");
} catch (IOException e) {
e.printStackTrace();
}
return false;
}).forEachOrdered((file) -> {
int imageCount = server.images.size();
server.freeImages.add(imageCount);
Expand Down

0 comments on commit 69ec15f

Please sign in to comment.