forked from Adrninistrator/java-callgraph2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (93 loc) · 2.38 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
102
103
104
105
106
107
108
109
110
111
112
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'idea'
group 'com.github.adrninistrator'
version = "1.0.17"
def projectName = "java-callgraph2"
description = "${projectName}"
sourceCompatibility = 1.8
targetCompatibility = 1.8
def jar_output_dir = "jar_output_dir"
def defaultEncoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.encoding = defaultEncoding
project.buildDir = 'build'
repositories {
mavenCentral()
}
clean {
delete 'build'
delete "${jar_output_dir}"
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
// 6.7.0版本LDC.getValue()会报错,不使用
List bcel = ['org.apache.bcel:bcel:6.6.0']
List junit = ['junit:junit:4.13.2']
dependencies {
compile bcel
testImplementation junit
}
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
processResources {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
task createProject {
doFirst {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
// 生成可以直接执行的jar包,并拷贝相关文件
task gen_run_jar(type: Jar) {
archiveName 'run_javacg2.jar'
from(sourceSets.main.output) {
into '/'
}
doLast{
copy {
from 'build/libs/run_javacg2.jar'
into "${jar_output_dir}/jar/"
}
copy {
from 'src/main/resources/_javacg_config/'
into "${jar_output_dir}/_javacg_config/"
}
copy {
from 'run.bat'
into "${jar_output_dir}/"
}
copy {
from 'run.sh'
into "${jar_output_dir}/"
}
copy {
from configurations.runtimeClasspath
into "${jar_output_dir}/lib"
}
}
}
idea {
module {
// and some extra dirs that should be excluded by IDEA
excludeDirs += file('.idea')
excludeDirs += file('gradle')
excludeDirs += file('jar_output_dir')
excludeDirs += file('log_javacg')
}
}