forked from sysart/dtangler
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
107 lines (81 loc) · 3.92 KB
/
Rakefile
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
#####################################################################################################
# Rakefile for dtangler. (www.dtangler.org)
#
# This product is provided under the terms of EPL (Eclipse Public License)
# version 2.0.
#
# The full license text can be read from: https://www.eclipse.org/legal/epl-2.0/
#
#
# Usage:
# - required: JAVA_HOME environment variable must be set to the JDK to build dtangler with
# - optional: BUILDDIR environment variable controls where the build is being performed
# the default is '_build'
# - optional: RELEASEDIR environment variable controls where the build results are published.
# the default is '_release'
#####################################################################################################
require "Rake_incremental_java_build.rb"
RELEASE_FOLDER = env_or_default("RELEASEDIR", "_release")
#####################################################################################################
# Create a DSM text file with dtangler
#####################################################################################################
def create_dsm(core_jar, input, outputFile)
puts "Running dtangler on #{input}"
java_cmd_line = "#{JAVABIN}/java -jar #{core_jar} -input=#{input} > #{outputFile}"
sh java_cmd_line do |ok, res|
if(!ok)
raise "DEPENDENCY CHECK FAILED: There are cycles or illegal dependencies. See #{outputFile}."
end
end
end
#####################################################################################################
# Define subprojects and their dependencies
#####################################################################################################
forms = Library.new "lib-forms"
junit = Library.new "lib-junit-4.4"
uispec4j = Library.new "lib-uispec4j"
bumblebee = Library.new "lib-bumblebee"
core = Project.new "dtangler-core"
core.tests_depend_on junit
core.test.depends_on CompilationUnit.new('dtangler-core', 'testdata-good-deps')
core.test.depends_on CompilationUnit.new('dtangler-core', 'testdata-cyclic-deps')
core.tests_depend_on bumblebee
ui = Project.new "dtangler-ui"
ui.depends_on core
ui.tests_depend_on junit
swingui = Project.new "dtangler-swingui"
swingui.depends_on ui
swingui.depends_on forms
swingui.tests_depend_on uispec4j
swingui.tests_depend_on junit
swingui.tests_depend_on bumblebee
swingui.tests_depend_on bumblebee
testsuites = Project.new "dtangler-testsuites"
testsuites.test.depends_on core.test
testsuites.test.depends_on ui.test
testsuites.test.depends_on swingui.test
testsuites.tests_depend_on bumblebee
testsuites.junit_cmd = "-Ddtangler-root=. org.junit.runner.JUnitCore org.hjug.dtangler.testsuites.docsuites.Dtangler"
# Define the files for release
core_jar = "#{RELEASE_FOLDER}/dtangler-core.jar"
gui_jar = "#{RELEASE_FOLDER}/dtangler-gui.jar"
core_dsm = "#{RELEASE_FOLDER}/dtangler-core-dsm.txt"
gui_dsm = "#{RELEASE_FOLDER}/dtangler-gui-dsm.txt"
documentation_success = "#{BUILD_FOLDER}/documentation_success"
# Publish rake targets
Buildable.init_rake_tasks
file core_jar => [core.test_success] do
create_jar(core_jar, "dtangler-core/MANIFEST.MF", core.prod.classes_folder)
end
file gui_jar => [core.test_success, ui.test_success, swingui.test_success] do
create_jar(gui_jar, "dtangler-swingui/MANIFEST.MF", [core.prod.classes_folder, ui.prod.classes_folder, swingui.prod.classes_folder])
end
# Documentation is generated while running the tests in the testsuites-project
task :documentation => [testsuites.test_success]
file core_dsm => [core_jar] do
create_dsm(core_jar, core_jar, core_dsm)
end
file gui_dsm => [core_jar, gui_jar] do
create_dsm(core_jar, gui_jar, gui_dsm)
end
task :default => [core_jar, gui_jar, core_dsm, gui_dsm, :documentation]