Browse Source

Enables running the GUI via gradle

* adds run   - to run it as JVM Application
* adds runIt - to run it as executable Jar
Andreas T. Meyer-Berg 5 years ago
parent
commit
353e2ff9dd
2 changed files with 23 additions and 4 deletions
  1. 20 1
      build.gradle
  2. 3 3
      gradle.properties

+ 20 - 1
build.gradle

@@ -7,18 +7,37 @@
 
 apply plugin: 'java'
 apply plugin: 'eclipse'
+apply plugin: 'application'
 
 group = groupName
 version = versionNumber
 
+//application allows the Task 'run' which runs the main class
+mainClassName = "de.tu_darmstadt.tk.SmartHomeNetworkSim.Main"
+
 repositories {
 	jcenter()
 }
 
+//Creates the Jar
+jar {
+    manifest {
+        attributes 'Main-Class': 'de.tu_darmstadt.tk.SmartHomeNetworkSim.Main'
+    }
+}
+
+//Runs the created Jar
+task runIt(dependsOn:jar) {
+    doLast {
+        javaexec { 
+            main="-jar"; args jar.archivePath
+        }
+    }
+}
+
 dependencies {
 	compile 'org.pcap4j:pcap4j-core:1.+'
 	compile 'org.pcap4j:pcap4j-packetfactory-static:1.+'
 
 	testCompile 'junit:junit:4.12'
 }
-

+ 3 - 3
gradle.properties

@@ -1,3 +1,3 @@
-groupName = 'Andreas T. Meyer-Berg'
-projectName = 'SmartHomeNetworkSim'
-versionNumber = 0.0
+groupName = Andreas T. Meyer-Berg
+projectName = SmartHomeNetworkSim
+versionNumber = 0.0