-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
101 lines (87 loc) · 3.44 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
apply plugin: 'java'
defaultTasks 'makeOneJar'
version = "1.0.1"
ext {
buildName = "SolrCoprocessor"
}
//repositories {
//mavenCentral()
//flatDir(dirs: file('jarsDerectory'))
//}
dependencies {
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/commons-codec-1.7.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/commons-configuration-1.6.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/commons-lang-2.6.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/commons-logging-1.1.1.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/guava-12.0.1.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/hadoop-auth-2.2.0.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/hadoop-common-2.2.0.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/hbase-client-0.98.8-hadoop2.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/hbase-common-0.98.8-hadoop2.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/hbase-protocol-0.98.8-hadoop2.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/htrace-core-2.04.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/log4j-1.2.17.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/netty-3.6.6.Final.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/protobuf-java-2.5.0.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/slf4j-api-1.6.4.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/slf4j-log4j12-1.6.4.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/java_jars/zookeeper-3.4.6.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/lib/hbase-server-0.98.8-hadoop2.jar")
compile files("lib/BigQueue-0.70.jar")
compile files("E:/WJW_DATA/OpenSource/HBase/lib/log4j-1.2.17.jar")
compile files("lib/EasyFastJson-2.7.2.jar")
}
sourceSets {
sourceCompatibility = 1.6
targetCompatibility = 1.6
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
}
jar { //禁止执行jar Task
onlyIf { Task task ->
return false
}
}
javadoc { //禁止执行javadoc Task
onlyIf { Task task ->
return false
}
}
task makeOneJar(dependsOn: compileJava) << {
def basedir="${projectDir}"
def oneJarName="${project.buildName}-${project.version}.jar"
ant.echo("Ant Build OneJar:${oneJarName} Start...")
ant.taskdef(name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: "jarjar/jarjar-1.4.jar")
ant.jarjar(jarfile: "${basedir}/${oneJarName}") {
fileset(dir: "${sourceSets['main'].output.classesDir}") {
include(name: "wjw/hbase/solr/**")
}
zipfileset(src: "lib/BigQueue-0.70.jar")
zipfileset(src: "lib/EasyFastJson-2.7.2.jar")
rule(pattern: "org.wjw.efjson.**",result: "wjw.hbase.solr.deps.org.wjw.efjson.@1")
rule(pattern: "com.leansoft.**",result: "wjw.hbase.solr.deps.com.leansoft.@1")
}
ant.delete(dir: "${basedir}/tmp", quiet: "true")
ant.mkdir(dir: "${basedir}/tmp")
ant.unzip(src: "${basedir}/${oneJarName}", dest: "${basedir}/tmp")
ant.delete(file: "${basedir}/${oneJarName}")
ant.jar(destfile: "${basedir}/${oneJarName}") {
fileset(dir: "${basedir}/tmp") {
include(name: "wjw/hbase/solr/**")
}
delegate.manifest {
attribute(name: "Built-By", value: "[email protected]")
attribute(name: "Build-Name", value: "${project.buildName}")
attribute(name: "Build-Version", value: "${project.version}")
}
}
ant.delete(dir: "${basedir}/tmp", quiet: "true")
ant.echo("Ant Build OneJar:${oneJarName} End!")
clean.execute()
}