-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathroot.rb
68 lines (58 loc) · 2.17 KB
/
root.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
module Travis::Yaml
module Nodes
class Root < Mapping
include LanguageSpecific
map :language, required: true
map :sudo, to: Scalar[:bool], required: false
map :bundler_args, to: BundlerArgs
map :deploy, :ruby, :os, :compiler, :git, :jdk, :virtualenv, :matrix, :env, :notifications, :branches, :cache, :addons, :android
map :lein, :otp_release, :go, :ghc, :haxe, :xcode_sdk, :xcode_scheme, :perl, :php, :python, :services, :gemfile,
:dart, :scala, :d, :crystal, :smalltalk, to: VersionList
map :podfile, to: Version
map :node_js, to: VersionList[/^((iojs)|(iojs\-v\d+\.\d+(\.\d+)?)|(\d+(\.\d+(\.\d+)?)?)|stable|node)$/]
map :rvm, to: :ruby
map :otp, to: :otp_release
map :node, to: :node_js
map :virtual_env, to: :virtualenv
map :osx_image, to: Version, experimental: true
map :gobuild_args, :xcode_project, :xcode_workspace, :xctool_args, :composer_args, :npm_args, to: Scalar[:str]
map :source_key, to: Scalar[:str, :secure]
map :before_install, :install, :before_script, :script, :after_result, :before_cache,
:after_script, :after_success, :after_failure, :before_deploy, :after_deploy, to: Stage
map :dist, to: Dist
map :group, to: Group
FEATURE_KEYS = [:group]
def initialize
super(nil)
end
def verify
super
verify_os
verify_language(language)
FEATURE_KEYS.each {|feature| warn_on_feature feature}
end
def verify_os
self.os = language.default_os unless include? :os
if os.include? 'osx' and jdk
# https://github.com/travis-ci/travis-ci/issues/2317
warning 'dropping "jdk" section: currently not supported on "osx"'
@mapping.delete('jdk')
end
end
def warn_on_feature(feature)
if include? feature
warning 'your repository must be feature flagged for the "%s" setting to be used', feature
end
end
def nested_warnings(*)
super.uniq
end
def inspect
"#<Travis::Yaml:#{super}>"
end
def to_matrix
Travis::Yaml.matrix(self)
end
end
end
end