-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile.rb
54 lines (47 loc) · 1.57 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
# frozen_string_literal: true
require './scripts/register'
require './scripts/plugin'
require './scripts/versions'
require './scripts/tools'
PLUGINS_DEST_FOLDER = './plugins'
PLUGIN_RELEASE_FOLDER = './releases'
def build(target, hard, ver, pack, vers)
if target.nil?
putsAccent('Please define target to be built like: "rake build[./plugins/plugin.complex]"', true)
end
versions = Versions.new(vers)
plugin = Plugin.new(target, versions, hard, ver, pack)
if plugin.build
puts "Plugin #{plugin.get_plugin_name} is built SUCCESSFULLY"
else
puts "Fail to build plugin #{plugin.get_plugin_name}"
end
# ...
puts "Traget is: #{target}"
end
# Does:
# - build defined plugin
# - pack plugin into chipmunk plugin package
task :pack, [:target, :ver, :vers] do |_t, args|
build(args.target, false, args.ver, true, args.vers)
end
# Does:
# - build defined plugin
task :build, [:target, :ver, :vers] do |_t, args|
build(args.target, false, args.ver, false, args.vers)
end
# Does:
# - rebuild defined plugin (will drop node_modules stuff)
task :rebuild, [:target, :ver, :vers] do |_t, args|
build(args.target, true, args.ver, false, args.vers)
end
# Does (used only for Angular plugins):
# - copy sources from angular/projects folder back to ./plugins/[plugin_name]/render folder
task :synch, [:target, :vers] do |_t, args|
if args.target.nil?
putsAccent('Please define target to be synch like: "rake synch[./plugins/plugin.complex]"', true)
end
versions = Versions.new(args.vers)
plugin = Plugin.new(args.target, versions, false, nil, false)
plugin.synch
end