-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
53 lines (38 loc) · 1.19 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
def jarName = "NetBlocker"
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
compile group: 'org.pcap4j', name: 'pcap4j-packetfactory-static', version: '1.7.2'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
jar {
baseName jarName
manifest {
attributes "Main-Class": "NetBlocker.Main"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task CopyJar(type: Copy) {
dependsOn "jar"
from "build/libs"
into "download"
}
clean.mustRunAfter CopyJar
task MainJar {
dependsOn "CopyJar", "clean"
def runFile = new File("download/run.bat")
runFile.createNewFile()
runFile.setText "java -jar $jarName-${version}.jar -h"
def readmeFile = new File("download/readme.txt")
readmeFile.createNewFile()
readmeFile.setText "start the run batch file in cmd with admin privileges \n" +
"install wincap and add wpcap.dll and Packet.dll location to system environment variable in PATH \n" +
"they are placed in system32 folder"
}