deprecated.rake 2.25 KB
Newer Older
1 2 3

require 'colorize'

4
def deprecated(deprecated, deprecated_by, *args)
5
    task deprecated do
6 7 8 9 10 11 12
        if args.length > 0 then
            args_str = args.join(',')
            new_cmd = "#{deprecated_by}[#{args_str}]"
        else
            new_cmd = deprecated_by
        end
        puts("Task #{deprecated} has been deprecated. Use #{new_cmd} instead. Waiting 5 seconds...".red)
13
        sleep(5)
14
        Rake::Task[deprecated_by].invoke(*args)
15 16 17 18
    end
end

[:lms, :cms].each do |system|
19 20 21 22 23 24 25 26
    deprecated("browse_jasmine_#{system}", "test:js:dev", system)
    deprecated("phantomjs_jasmine_#{system}", "test:js:run", system)
    deprecated("jasmine:#{system}", "test:js:run", system)
    deprecated("jasmine:#{system}:browser", "test:js:dev", system)
    deprecated("jasmine:#{system}:browser:watch", "test:js:dev", system)
    deprecated("jasmine:#{system}:phantomjs", "test:js:run", system)
    deprecated("#{system}:check_settings:jasmine", "")
    deprecated("#{system}:gather_assets:jasmine", "")
27 28
    deprecated("test_acceptance_#{system}", "test:acceptance:#{system}")
    deprecated("fasttest_acceptance_#{system}", "test:acceptance:#{system}:fast")
29 30 31
end

Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
32 33 34 35 36 37 38 39

    if lib == 'common/lib/xmodule' then
        deprecated("browse_jasmine_#{lib}", "test:js:dev", "xmodule")
        deprecated("phantomjs_jasmine_#{lib}", "test:js:run", "xmodule")
    else
        deprecated("browse_jasmine_#{lib}", "test:js:dev")
        deprecated("phantomjs_jasmine_#{lib}", "test:js:run")
    end
40 41
end

42 43 44 45 46 47 48 49 50 51 52 53
deprecated("browse_jasmine_discussion", "test:js:dev", "common")
deprecated("phantomjs_jasmine_discussion", "test:js:run", "common")
deprecated("jasmine:common/lib/xmodule", "test:js:run", "xmodule")
deprecated("jasmine:common/lib/xmodule:browser", "test:js:dev", "xmodule")
deprecated("jasmine:common/lib/xmodule:phantomjs", "test:js:run", "xmodule")
deprecated("jasmine:common/static/coffee", "test:js:run", "common")
deprecated("jasmine:common/static/coffee:browser", "test:js:dev", "common")
deprecated("jasmine:common/static/coffee:phantomjs", "test:js:run", "common")

deprecated("jasmine", "test:js")
deprecated("jasmine:phantomjs", "test:js:run")
deprecated("jasmine:browser", "test:js:dev")
54
deprecated("test_acceptance", "test:acceptance")