Add mrbgem version field to lock file
MODIFY
lib/mruby/build.rb
lib/mruby/build.rb
@@ -43,7 +43,7 @@ module MRuby
include Rake::DSL
include LoadGems
attr_accessor :name, :bins, :exts, :file_separator, :build_dir, :gem_clone_dir
- attr_reader :libmruby_objs, :gems, :toolchains
+ attr_reader :libmruby_objs, :gems, :toolchains, :gem_dir_to_repo_url
attr_writer :enable_bintest, :enable_test
alias libmruby libmruby_objs
@@ -90,6 +90,7 @@ module MRuby
@enable_test = false
@enable_lock = true
@toolchains = []
+ @gem_dir_to_repo_url = {}
MRuby.targets[@name] = self
end

MODIFY
lib/mruby/build/load_gems.rb
lib/mruby/build/load_gems.rb
@@ -113,6 +113,7 @@ module MRuby
end
if lock_enabled?
+ @gem_dir_to_repo_url[gemdir] = url unless params[:path]
locks[url] = {
'url' => url,
'branch' => git.current_branch(gemdir),

MODIFY
lib/mruby/gem.rb
lib/mruby/gem.rb
@@ -91,6 +91,9 @@ module MRuby
build.libmruby_objs << @objs
instance_eval(&@build_config_initializer) if @build_config_initializer
+
+ repo_url = build.gem_dir_to_repo_url[dir]
+ build.locks[repo_url]['version'] = version if repo_url
end
def setup_compilers

Add mrbgem version field to lock file