forked from Open-Systems-Pharmacology/MoBi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile.rb
146 lines (120 loc) · 3.72 KB
/
rakefile.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
require_relative 'scripts/setup'
require_relative 'scripts/copy-dependencies'
require_relative 'scripts/utils'
require_relative 'scripts/coverage'
task :cover do
filter = []
filter << "+[MoBi.Core]*"
filter << "+[MoBi.Assets]*"
filter << "+[MoBi.Presentation]*"
Coverage.cover(filter , "MoBi.Tests.csproj")
end
task :create_setup, [:product_version, :configuration, :smart_xls_package, :smart_xls_version] do |t, args|
update_smart_xls args
#Ignore files from automatic harvesting that will be installed specifically
harvest_ignored_files = [
'MoBi.exe',
'Standard Molecule.pkml'
]
#Files required for setup creation only
setup_files = [
'packages/**/OSPSuite.Core/**/*.xml',
'packages/**/OSPSuite.Presentation/**/*.{wxs,xml}',
'packages/**/OSPSuite.TeXReporting/**/*.*',
'examples/**/*.{wxs,pkml,mbp3}',
'src/Data/**/*.*',
'src/MoBi.Assets/Resources/*.ico',
'documentation/*.pdf',
'dimensions/*.xml',
'pkparameters/*.xml',
'setup/setup.wxs',
'log4net.config.xml',
'setup/**/*.{msm,rtf,bmp}'
]
Rake::Task['setup:create'].execute(OpenStruct.new(
solution_dir: solution_dir,
src_dir: src_dir_for(args.configuration),
setup_dir: setup_dir,
product_name: product_name,
product_version: args.product_version,
harvest_ignored_files: harvest_ignored_files,
suite_name: suite_name,
setup_files: setup_files,
manufacturer: manufacturer
))
end
task :create_portable_setup, [:product_version, :configuration, :package_name] do |t, args|
#Files required for setup creation only and that will not be harvested automatically
setup_files = [
'Open Systems Pharmacology Suite License.pdf',
'documentation/*.pdf',
'dimensions/*.xml',
'pkparameters/*.xml',
'src/Data/*.xml',
'setup/**/*.{rtf}',
'log4net.config.xml',
]
setup_folders = [
'examples/**/*.{pkml,mbp3}',
'packages/**/OSPSuite.Presentation/**/*.{xml}',
'packages/**/OSPSuite.TeXReporting/**/*.{json,sty,tex}',
]
Rake::Task['setup:create_portable'].execute(OpenStruct.new(
solution_dir: solution_dir,
src_dir: src_dir_for(args.configuration),
setup_dir: setup_dir,
product_name: product_name,
product_version: args.product_version,
suite_name: suite_name,
setup_files: setup_files,
setup_folders: setup_folders,
package_name: args.package_name
))
end
task :update_go_license, [:file_path, :license] do |t, args|
Utils.update_go_diagram_license args.file_path, args.license
end
def src_dir_for(configuration)
File.join(solution_dir, 'src', 'MoBi', 'bin', configuration)
end
def update_smart_xls(args)
require_relative 'scripts/smartxls'
src_dir = src_dir_for(args.configuration)
SmartXls.update_smart_xls src_dir, args.smart_xls_package, args.smart_xls_version
end
task :postclean do |t, args|
packages_dir = File.join(solution_dir, 'packages')
all_users_dir = ENV['ALLUSERSPROFILE']
all_users_application_dir = File.join(all_users_dir, manufacturer, product_name, '7.2')
copy_depdencies solution_dir, all_users_application_dir do
copy_files 'Data', ['xml', 'mbdt']
copy_file 'src/Data/AllCalculationMethods.pkml'
copy_dimensions_xml
copy_pkparameters_xml
end
copy_depdencies solution_dir, File.join(all_users_application_dir, 'Templates') do
copy_templates_pkml
end
copy_depdencies packages_dir, File.join(all_users_application_dir, 'ChartLayouts') do
copy_files 'OSPSuite.Presentation', 'xml'
end
copy_depdencies packages_dir, File.join(all_users_application_dir, 'TeXTemplates', 'StandardTemplate') do
copy_files 'StandardTemplate', '*'
end
end
private
def solution_dir
File.dirname(__FILE__)
end
def manufacturer
'Open Systems Pharmacology'
end
def product_name
'MoBi'
end
def suite_name
'Open Systems Pharmacology Suite'
end
def setup_dir
File.join(solution_dir, 'setup')
end