This repository was archived by the owner on Feb 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile-linux.rb
More file actions
128 lines (99 loc) · 3.36 KB
/
Copy pathRakefile-linux.rb
File metadata and controls
128 lines (99 loc) · 3.36 KB
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
scribbleapp_src = "ScribbleAppQt"
lib_dir = "#{BUILD_DIR}/Libs/C++/lib"
deps_src = FileList.new(
"#{CSI_LIB}/CSI.Standard/lib/*",
"#{CSI_LIB}/CSI.Typeless/lib/*",
"#{CSI_LIB}/libjpeg-turbo/lib/*",
"#{CSI_LIB}/ICU/lib/*.so*")
deps_src.exclude(/test/)
SERVICE_MGR_CFG = "#{STAGINGDIR}/services/service-manager-cfg"
#### Helper Functions
def install_qmake()
case
when OS.aptget?
sh("#{SUDO} apt-get -y install qt4-qmake")
when OS.yum?
sh("sudo yum -y install qt5-qtbase-devel")
else
abort("Can't find qmake!")
end
end
#### Task definitions
desc "Setup the Linux build environment"
task :setup do
puts("Checking for qmake...")
sh("qmake-qt5 --version") { |ok, res| install_qmake() unless ok }
abort("JAVA_HOME is not set!") unless ENV["JAVA_HOME"]
abort("PUREWEB_LIBS is not set!") unless ENV["PUREWEB_LIBS"]
end
#### Lib Dependencies
directory lib_dir
task :copy_deps => [lib_dir] do
deps_src.each do |src|
dst = src.pathmap("#{lib_dir}/%f")
sh("cp -a #{src} #{dst}") if !File.exists?(dst) || File.mtime(src) > File.mtime(dst)
end
end
desc "Build the ScribbleAppQt sample"
task :build_scribbleqt => [:setup, :copy_deps] do
puts("Building Scribble example...")
sh("cd #{scribbleapp_src} && qmake-qt5 -makefile scribble.pro && make")
end
desc "Build the ScribbleAppQt solo sample"
task :build_scribbleqt_solo => [:setup] do
puts("Building Scribble example...")
sh("cd #{scribbleapp_src} && qmake-qt5 -makefile scribble_solo.pro && make")
end
desc "Clean the ScribbleAppQt sample"
task :clean_scribbleqt do
puts("Building Scribble example...")
sh("cd #{scribbleapp_src} && make clean")
end
desc "Test C++ Samples"
task :test do |t|
end
desc "Build all C++ samples"
task :build do |t|
if ENV["PUREWEB_BUILD_SUBREPO"] == "true"
t.invoke_in_scope('build_scribbleqt_solo')
else
t.invoke_in_scope('build_scribbleqt')
end
end
desc "Clean all C++ samples"
task :clean => [:clean_scribbleqt]
desc "Deploy Samples"
task :deploy do |t|
if ENV["PUREWEB_BUILD_SUBREPO"] == "true"
t.invoke_in_scope('deploy_scribbleqt_solo')
else
t.invoke_in_scope('deploy_scribbleqt')
end
end
desc "Stage the C++ samples"
task :stage do |t|
t.invoke_in_scope('build')
t.invoke_in_scope('deploy')
end
task :stageclean do
FileUtils.rm_r "#{STAGINGDIR}/apps/ScribbleAppQt", :force => true
end
desc "Deploy Qt example"
task :deploy_scribbleqt do
puts("Deploying Scribble example")
FileUtils.touch("#{STAGINGDIR}/services/service_config.json")
FileUtils.mkdir_p "#{STAGINGDIR}/apps/ScribbleAppQt"
FileUtils.cp "#{scribbleapp_src}/release/scribble", "#{STAGINGDIR}/apps/ScribbleAppQt"
FileUtils.cp "#{scribbleapp_src}/service.json", "#{STAGINGDIR}/apps/ScribbleAppQt"
if File.file?("#{SERVICE_MGR_CFG}")
puts("Writing out config file")
sh("#{SERVICE_MGR_CFG} -configFile #{STAGINGDIR}/services/service_config.json -action add -changeFile #{scribbleapp_src}/service.json")
end
end
desc "Deploy Qt example"
task :deploy_scribbleqt_solo do
puts("Deploying Scribble solo example")
FileUtils.mkdir_p "#{STAGINGDIR}/apps/ScribbleAppQt"
FileUtils.cp "#{scribbleapp_src}/release/scribble_solo", "#{STAGINGDIR}/apps/ScribbleAppQt/scribble"
FileUtils.cp "#{scribbleapp_src}/service.json", "#{STAGINGDIR}/apps/ScribbleAppQt"
end