-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
45 lines (38 loc) · 1.24 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
defaultTasks 'globalreplace_jar'
def dir_src = "src/globalreplace"
def dir_build = "ant_build"
def dir_libs = "libs"
def dir_dist = "ant_dist"
def dir_launch4j = "launch4j"
apply plugin:'java'
repositories {
jcenter()
}
dependencies {
compile 'fastily:jwiki:1.2.1'
}
task copy_deps_for_ant(type: Copy) {
from configurations.compile
into dir_libs
}
task compile(dependsOn: copy_deps_for_ant) << {
delete dir_build
mkdir dir_build
ant.javac(srcdir: dir_src, classpath: dir_libs + "/jwiki-1.2.1.jar", destdir: dir_build)
}
task globalreplace_jar(dependsOn: compile) << {
ant.jar(destfile: dir_dist + "/globalreplace.jar", filesetmanifest: "mergewithoutmain"){
manifest {
delegate.attribute(name: "Main-Class", value: "globalreplace.GlobalReplace")
delegate.attribute(name: "Class-Path", value: ".")
}
fileset(dir: dir_build)
fileset(dir: dir_libs)
}
ant.echo("Jar file created.")
}
task dist(dependsOn: globalreplace_jar) << {
ant.taskdef( name: "launch4j", classname: "net.sf.launch4j.ant.Launch4jTask", classpath: dir_launch4j + "/launch4j.jar:" + dir_launch4j + "/lib/xstream.jar")
ant.launch4j(configFile: dir_dist + "/launch4jconfig.xml")
ant.echo("Windows executable created.")
}