-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildfile
117 lines (96 loc) · 4.37 KB
/
buildfile
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
113
114
115
116
layout = Layout::Default.new
layout[:target, :generated] = "generated"
desc "Tide"
define('tide', :layout => layout) do
project.version = `git describe --tags --always`.strip
project.group = 'au.com.stocksoftware.tide'
compile.options.source = '1.6'
compile.options.target = '1.6'
compile.options.lint = 'all'
Domgen::GenerateTask.new(:Tide, :ee, [:ee, :jpa_model_catalog], project._(:target, :generated, "domgen/ee"), project)
Domgen::GenerateTask.new(:Tide, :gwt, [:gwt], project._(:target, :generated, "domgen/gwt"), project)
compile.with :javax_ejb,
:javax_persistence,
:javax_servlet,
:javax_validation,
:javax_annotation,
:javax_security_annotations,
:jackson_core,
:jackson_mapper,
:gxt,
:gxt_uibinder,
:google_guice,
:aopalliance,
:google_guice_assistedinject,
:javax_inject,
:gwt_gin,
:replicant,
:replicant_sources,
:gwt_user
test.with :mockito, :guiceyloops, :eclipselink, :jtds
test.using :testng
tide_module = gwt(["au.com.stocksoftware.tide.TideDev"],
:dependencies => [project.compile.dependencies,
project.compile.target,
:gxt,
:gxt_uibinder,
:replicant,
:replicant_sources,
:javax_validation,
:javax_validation_sources],
:java_args => ["-Xms512M", "-Xmx1024M", "-XX:PermSize=128M", "-XX:MaxPermSize=256M"],
:draft_compile => (ENV["FAST_GWT"] == 'true'))
package(:war).tap do |war|
war.include "#{tide_module}/WEB-INF"
war.include "#{tide_module}/tide"
war.with :libs => [:replicant, :gwt_user]
war.enhance([tide_module.name])
end
clean { rm_rf _(:target, :generated) }
clean { rm_rf _("services") }
iml.add_gwt_facet({"au.com.stocksoftware.tide.TideDev" => true, "au.com.stocksoftware.tide.Tide" => false}, :settings => {:compilerMaxHeapSize => "1024"})
iml.add_jpa_facet(:persistence_xml => _(:generated, "main/jpa/resources/META-INF/persistence.xml"),
:provider_enabled => "EclipseLink")
iml.add_ejb_facet
iml.add_web_facet
end
Buildr.project('tide').ipr.add_exploded_war_artifact(project('tide'),
:name => 'tide',
:dependencies => [project('tide'), :gwt_user],
:enable_gwt => true,
:enable_ejb => true,
:enable_jpa => true)
define_dbt_tasks(Buildr.project('tide'))
def define_service_project(classname)
service_name = classname.gsub(/^.*\.([^.]*)BoundaryEJB$/, "\\1")
source_project = Buildr.project('tide')
layout = Layout::Default.new
layout[:target, :generated] = "generated"
desc "#{service_name} client artifacts"
define service_name, :layout => layout, :base_dir => "services/#{service_name}" do
project.version = source_project.version
project.group = source_project.group
project.no_ipr
project.no_iml
t = task("wsgen") do
wsgen('eweb.tide', classname, project, source_project)
end
pkg = package(:jar)
pkg.include(_(:generated, :ws, service_name, "META-INF")).exclude('*.xjb')
pkg.include(_(:generated, :ws, service_name, "classes/au"))
pkg.enhance [t.name]
src_pkg = package(:sources)
src_pkg.include(_(:generated, :ws, service_name, "META-INF")).exclude('*.xjb')
src_pkg.include(_(:generated, :ws, service_name, "src/au"))
src_pkg.enhance [t.name]
wsdl = file("#{_(:generated, :ws, service_name, "META-INF")}/wsdl/#{service_name}.wsdl")
wsdl.enhance [t.name]
task 'upload' do
wsdl_artifact = artifact("#{project.group}:#{project.id}:wsdl:#{project.version}").from("#{_(:generated, :ws, service_name, "META-INF")}/wsdl/#{service_name}.wsdl")
wsdl_artifact.invoke
wsdl_artifact.upload
end
end
end
define_service_project("au.com.stocksoftware.tide.server.service.tide.UserServiceEJB")
define_service_project("au.com.stocksoftware.tide.server.service.tide.ProjectServiceEJB")