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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
# File 'lib/lock_jar/bundler.rb', line 102
def to_lock
to_lock = _lockjar_extended_to_lock
if LockJar::Bundler.skip_lock != true
definition = Bundler.definition
gems_with_jars = []
if File.exists?( 'Jarfile' )
dsl = LockJar::Domain::JarfileDsl.create( File.expand_path( 'Jarfile' ) )
gems_with_jars << 'jarfile:Jarfile'
else
dsl = LockJar::Domain::Dsl.new
end
definition.groups.each do |group|
if ENV["DEBUG"]
puts "[LockJar] Group #{group}:"
end
definition.specs_for( [group] ).each do |spec|
gem_dir = spec.gem_dir
jarfile = File.join( gem_dir, "Jarfile" )
if File.exists?( jarfile )
gems_with_jars << "gem:#{spec.name}"
if ENV["DEBUG"]
puts "[LockJar] #{spec.name} has Jarfile"
end
spec_dsl = LockJar::Domain::GemDsl.create( spec, "Jarfile" )
dsl = LockJar::Domain::DslHelper.merge( dsl, spec_dsl, group.to_s )
end
end
end
puts "[LockJar] Locking Jars for: #{gems_with_jars.inspect}"
LockJar.lock( dsl )
end
to_lock
end
|