-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbee-java.rb
107 lines (99 loc) · 2.46 KB
/
bee-java.rb
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
# a script example to build Java project
project =jdsd
"build_directory" = ${~cwd~}${~/~}lib
source_directory ="${~cwd~}${~/~}src${~/~}java"
doc_directory=${~cwd~}${~/~}doc
build_file ="${project}.jar"
domain ="org"
resources ="${domain}.${project}.resources"
manifest ="manifest.mf"
main_class= "${domain}.justcodecs.dsd.Player"
version=8
include(../rusthub/src/script/common-java.7b)
CUSTOM CP=${~cwd~}${~/~}..${~/~}tiny-codec${~/~}tools${~/~}ID3V2${~/~}bin${~/~}id3v2.jar
target clean {
dependency {true}
rm (
${build_directory}${~/~}${domain},
${build_directory}${~/~}${build_file}
)
}
target compile:. {
dependency {
or {
newerthan(${source_directory}/.java,${build_directory}/.class)
}
}
{
display(Compiling Java src ...)
newerthan(${source_directory}/.java,${build_directory}/.class)
assign(main src,~~)
exec javac (
-d,
${build_directory},
-cp,
${build_directory}${~path_separator~}${CUSTOM CP},
-source,
version,
-target,
version,
main src
)
if {
neq(${~~}, 0)
then {
panic("Compilation error(s)")
}
}
}
}
target jar {
dependency {
anynewer(${build_directory}${~/~}${domain}${~/~}*,${build_directory}${~/~}${build_file})
}
dependency {
target(compile)
}
{ display(Jarring ${build_file} ...)
exec jar (
-cmf, ${~cwd~}${~/~}${manifest},
${build_directory}${~/~}${build_file},
-C,
${build_directory},
${domain}
)
if {
neq(${~~}, 0)
then {
panic("Error(s) at jarring")
}
}
}
}
target run :.: {
dependency {
target(jar)
}
dependency {true}
{
ask(Would you like to run dff extractor of ${project}? [N|y] , N)
assign(answer, ${~~})
if {
eq(${answer},N)
then {
exec java (
-cp,
${build_directory}${~/~}${build_file}${~path_separator~}${CUSTOM CP},
${main_class},
~args~
)
} else {
exec java (
-jar,
${build_directory}${~/~}${build_file},
~args~
)
}
}
}
}