Class: Xing::Tasks::Frontend

Inherits:
Tasklib
  • Object
show all
Defined in:
lib/xing/tasks/frontend.rb

Instance Method Summary collapse

Methods inherited from Tasklib

#edict_task

Instance Method Details

#defineObject



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
# File 'lib/xing/tasks/frontend.rb', line 11

def define
  in_namespace do
    edict_task :npm_install, Edicts::CleanRun do |ni|
      ni.shell_cmd = %w{npm install}
    end

    edict_task :bundle_install, Edicts::CleanRun do |bi|
      bi.shell_cmd = %w{bundle check || bundle install}
    end

    task :check_dependencies => :npm_install

    task :setup => [:npm_install, :bundle_install]

    namespace :code_structure do
      edict_task :app, Edicts::StructureChecker do |app|
        app.dir = 'frontend/src/app'
      end
      edict_task :common, Edicts::StructureChecker do |common|
        common.dir = 'frontend/src/common'
      end
      edict_task :framework, Edicts::StructureChecker do |fw|
        fw.dir = 'frontend/src/framework'
        fw.context_hash = { :escapes => %w{framework} }
      end
    end

    desc "Apply code structure rules to frontend"
    task :code_structure => %w[code_structure:app code_structure:common code_structure:framework]
  end
end