Browse Source

Version Fonctionnelle : possibilité d'exproter en .jar

Paul Faure 3 years ago
parent
commit
5088d95af7

+ 25
- 0
.idea/artifacts/Clavardage.xml View File

@@ -0,0 +1,25 @@
1
+<component name="ArtifactManager">
2
+  <artifact type="jar" name="Clavardage">
3
+    <output-path>$PROJECT_DIR$/out/artifacts/Clavardage</output-path>
4
+    <root id="archive" name="Clavardage.jar">
5
+      <element id="directory" name="META-INF">
6
+        <element id="file-copy" path="$PROJECT_DIR$/src/main/resources/META-INF/MANIFEST.MF" />
7
+      </element>
8
+      <element id="library" level="project" name="Gradle: com.jfoenix:jfoenix:9.0.9" />
9
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:linux:11.0.2" />
10
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-graphics:11.0.2" />
11
+      <element id="library" level="project" name="Gradle: org.kordamp.ikonli:ikonli-core:11.5.0" />
12
+      <element id="library" level="project" name="Gradle: org.hamcrest:hamcrest-core:1.3" />
13
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-fxml:linux:11.0.2" />
14
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-base:11.0.2" />
15
+      <element id="library" level="project" name="Gradle: mysql:mysql-connector-java:5.1.44" />
16
+      <element id="library" level="project" name="Gradle: org.kordamp.ikonli:ikonli-javafx:11.5.0" />
17
+      <element id="library" level="project" name="Gradle: org.kordamp.ikonli:ikonli-fontawesome-pack:11.5.0" />
18
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-controls:11.0.2" />
19
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-base:linux:11.0.2" />
20
+      <element id="library" level="project" name="Gradle: org.openjfx:javafx-controls:linux:11.0.2" />
21
+      <element id="library" level="project" name="Gradle: junit:junit:4.12" />
22
+      <element id="module-output" name="Clavardage.main" />
23
+    </root>
24
+  </artifact>
25
+</component>

+ 23
- 26
build.gradle View File

@@ -3,6 +3,7 @@ plugins {
3 3
     id 'application'
4 4
     id 'org.openjfx.javafxplugin' version '0.0.9'
5 5
     id 'org.beryx.jlink' version '2.15.1'
6
+    id 'com.github.johnrengelman.shadow' version '6.1.0'
6 7
 }
7 8
 
8 9
 group 'app.insa.clav'
@@ -17,7 +18,7 @@ repositories {
17 18
 
18 19
 javafx {
19 20
     version = "11.0.2"
20
-    modules = [ 'javafx.controls', 'javafx.fxml','javafx.graphics','javafx.base' ]
21
+    modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.base']
21 22
 }
22 23
 
23 24
 
@@ -28,40 +29,36 @@ dependencies {
28 29
     compile group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '11.5.0'
29 30
     compile group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '11.5.0'
30 31
     compile group: 'org.kordamp.ikonli', name: 'ikonli-fontawesome-pack', version: '11.5.0'
32
+    runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:win"
33
+    runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:linux"
34
+    runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:mac"
31 35
 }
32 36
 
33
-application {
34
-    mainClassName = 'app.insa.clav.Main'
35
-    applicationDefaultJvmArgs = [
36
-            "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
37
-            "--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
38
-            "--add-exports=javafx.base/com.sun.javafx.binding=ALL-UNNAMED",
39
-            "--add-exports=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
40
-            "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED"
41
-    ]
42
-    applicationName = "JigglypuffMessenger"
43
-}
44
-
45
-run {
46
-    jvmArgs = [
47
-        "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
48
-        "--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
49
-        "--add-exports=javafx.base/com.sun.javafx.binding=ALL-UNNAMED",
50
-        "--add-exports=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
51
-        "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED"
52
-]
53
-}
54
-
37
+mainClassName = 'app.insa.clav.Launcher'
55 38
 
56 39
 jar {
57 40
     manifest {
58
-        attributes("Implementation-Title": "Gradle",
59
-                "Implementation-Version": archiveVersion)
41
+        attributes 'Main-Class': 'app.insa.clav.Launcher'
60 42
     }
61
-}
62 43
 
44
+    from {
45
+        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
46
+    }
47
+}
63 48
 
49
+shadowJar {
50
+    mergeServiceFiles()
51
+}
64 52
 
53
+run {
54
+    jvmArgs = [
55
+            "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
56
+            "--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
57
+            "--add-exports=javafx.base/com.sun.javafx.binding=ALL-UNNAMED",
58
+            "--add-exports=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
59
+            "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED"
60
+    ]
61
+}
65 62
 
66 63
 jlink {
67 64
     launcher {

+ 7
- 0
src/main/java/app/insa/clav/Launcher.java View File

@@ -0,0 +1,7 @@
1
+package app.insa.clav;
2
+
3
+public class Launcher {
4
+    public static void main(String[] args) {
5
+        Main.main(args);
6
+    }
7
+}

+ 4
- 4
src/main/java/app/insa/clav/Main.java View File

@@ -13,10 +13,10 @@ public class Main extends Application{
13 13
 
14 14
     @Override
15 15
     public void start(Stage primaryStage) throws Exception{
16
-        String[] args = this.getParameters().getUnnamed().toArray(new String[0]);
17
-        int inputPort = Integer.parseInt(args[0]);
18
-        int outPutPort = Integer.parseInt(args[1]);
19
-        int tcpListenerPort = Integer.parseInt(args[2]);
16
+        //String[] args = this.getParameters().getUnnamed().toArray(new String[0]);
17
+        int inputPort = 5000;//Integer.parseInt(args[0]);
18
+        int outPutPort = 6000; //Integer.parseInt(args[1]);
19
+        int tcpListenerPort = 7000; //Integer.parseInt(args[2]);
20 20
 
21 21
         Model model = Model.getInstance(inputPort, outPutPort,tcpListenerPort);
22 22
 

+ 0
- 4
src/main/java/app/insa/clav/UIControllers/ChatWindowController.java View File

@@ -3,13 +3,10 @@ package app.insa.clav.UIControllers;
3 3
 import app.insa.clav.Core.Model;
4 4
 import app.insa.clav.Core.Utilisateurs;
5 5
 import app.insa.clav.Messages.MessageChatTxt;
6
-import app.insa.clav.Messages.MessageInit;
7 6
 import app.insa.clav.Reseau.TCPChatConnection;
8 7
 import com.jfoenix.controls.JFXButton;
9
-import com.sun.javafx.collections.ImmutableObservableList;
10 8
 import javafx.application.Platform;
11 9
 import javafx.collections.FXCollections;
12
-import javafx.collections.ObservableArray;
13 10
 import javafx.collections.ObservableList;
14 11
 import javafx.event.ActionEvent;
15 12
 import javafx.fxml.FXML;
@@ -17,7 +14,6 @@ import javafx.fxml.Initializable;
17 14
 import javafx.scene.control.ListView;
18 15
 import javafx.scene.control.TextField;
19 16
 import javafx.scene.layout.AnchorPane;
20
-import javafx.stage.Stage;
21 17
 
22 18
 import java.beans.PropertyChangeEvent;
23 19
 import java.beans.PropertyChangeListener;

Loading…
Cancel
Save