Commit Graph

31 Commits

Author SHA1 Message Date
Zachary Scott 98285e6b16 This patch changes git gem behavior to never pull gems unless specified.
Since mgem's function almost the same as git gems, but you can see they already
avoid pulling from source after the gem has already been cloned.

 You can see from the `load_special_path_gem` method found in the file
`mruby_build_gem.rake`, or extracted here:

```ruby
if File.exist? mgem_list_dir
  git.run_pull mgem_list_dir, mgem_list_url if $pull_gems
else
  FileUtils.mkdir_p mgem_list_dir
  git.run_clone mgem_list_dir, mgem_list_url, "--depth 1"
end
```

Also, later in this same method; mgem will set the `git` params.
Doing this will trigger the following block:

```ruby
if File.exist?(gemdir)
  if $pull_gems
    git.run_pull gemdir, url
  else
    gemdir
  end
else
  # ... clone
end
```

You can see here, this checks if `$pull_gems` is enabled before pulling.

Lastly, the final condition for this method is here:

```ruby
if params[:checksum_hash]
  # Jump to the specified commit
  git.run_checkout gemdir, params[:checksum_hash]
else
  # Jump to the top of the branch
  git.run_checkout gemdir, branch if $pull_gems
end
```

What we changed was the `else` condition of this block to follow the same
behavior as the aforementioned code. In doing so, we can avoid two things:

* Excess `clone` calls can slow down builds (times number of gems used)
* We _don't_ want our code to _update_ during build

To explain, if during build time there are some changes in the gem we are
depending upon: updating during compile time could actually break our
application.

This is what we're trying to avoid.
2015-11-16 11:43:56 +09:00
Terence Lee 5c055d670a be able to source with :path for mrbgems 2015-08-02 15:03:12 +02:00
Zachary Scott 923e04cf50 Shallow clone mgem source 2015-07-27 17:16:37 -04:00
Yukihiro "Matz" Matsumoto a41a649e83 Merge pull request #2862 from scalone/recursive_clone
Add —-recursive option to automatically update submodules from git mgems
2015-06-29 10:21:07 +09:00
Thiago Scalone fa4b88b893 Fix quotes use during load special path gem of gem. 2015-06-26 14:35:34 -03:00
Thiago Scalone 449ec101f6 Add —-recursive option to automatically update submodules from git mgems. 2015-06-26 14:22:09 -03:00
take_cheeze 8d54977d25 Add :mgem gem loader to load mrbgem from mgem-list ( https://github.com/mruby/mgem-list ). 2015-06-22 02:23:11 +09:00
Julian Aron Prenner 959a5cff60 Don't use Build.current if possible 2015-01-18 15:45:48 +01:00
Masaki Muranaka 2c144425d9 Find c++ files in tools/.
Some tools may be written in C++.
2014-06-09 22:55:02 +09:00
take_cheeze 9ac23ae214 Support extension '.cc' in globbing. 2014-05-20 22:52:08 +09:00
Daniel Bovensiepen 874bec2af5 Implement :checksum_hash mrbgem option.
This allows to use a mgem with a specific checksum hash.
The following modification were necessary to implement this
function:
  - add run_checkout build command to use 'git checkout'
  - skip shallow copy in case checksum_hash is used
  - make 'master' the default branch if branch isn't defined
2014-04-20 05:39:40 +08:00
take_cheeze 66e0df34e0 Fix C++ files detection for automatic C++ ABI enabling. 2014-04-07 17:38:30 +09:00
Masaki Muranaka b58e6b9146 Add ssh protocol support for bitbucket. 2014-03-02 12:08:09 +09:00
take_cheeze 78915f9601 support c++ exception 2014-03-01 20:05:29 +09:00
cremno 4804b3f7dd fix some warnings emitted by 'ruby -w'
- File.exists? is deprecated since 2.1.0
- tasks/mruby_build_commands.rake:268: ambiguous argument
2014-01-02 01:09:03 +01:00
William Light 72d6db8bc4 Fix for caller_dir relative gems 2013-10-01 21:27:34 +02:00
William Light 7c3f06ddd8 Implement gembox-relative gemdir paths
In the case where a relative path is specified to a gembox from
build_config.rb, it was previously tricky to specify relative gem paths
from inside that gembox.

For example, consider a project in which mruby is checked out as a
submodule in the project root:

	+- project_root
	   |
	   +- mruby/
	   |  |
	   |  +- build_config.rb
	   |  |
	   |  +- ...
	   |
	   +- my_gembox/
	      |
	      +- my_gembox.gembox
	      |
	      +- my_gem/
	         |
	         +- mrbgem.rake
	         |
	         +- ...

If build_config.rb refers to my_gembox with a relative path, it's
difficult for my_gembox to then refer to my_gem. With this proposed
change, my_gembox.gembox can look like this:

	MRuby::GemBox.new do |conf|
	  conf.gem "my_gem"
	end
2013-10-01 20:21:46 +02:00
Ryan Scott 981b408e01 Added support for custom gem clone directories when using git 2013-08-04 00:33:49 +10:00
Xuejie "Rafael" Xiao 122770d17f Allow programmers to specify build path manually 2013-07-15 11:43:19 +08:00
kyab 8eab806da8 Add --pull_gems option to minirake 2013-07-04 22:09:05 +09:00
Nihad Abbasov 1d049e0864 fix regexp warning: character class has duplicated range 2013-05-09 16:49:39 +05:00
Daniel Bovensiepen 045db9e528 Implement :core parameter for conf.gem 2013-05-02 02:53:47 +08:00
Yukihiro "Matz" Matsumoto 160eb71338 fix gembox rake tasks to support Ruby 1.8 2013-04-27 23:28:17 +09:00
Daniel Bovensiepen 3875140afe IMPROVE: Move GemBox to more logical source location 2013-04-27 16:59:02 +08:00
Daniel Bovensiepen 607811c0dc Add gembox feature 2013-04-27 16:48:52 +08:00
Masaki Muranaka 34dd4525c5 Add bitbucket git support. 2013-03-23 12:39:12 +09:00
Yuichiro MASUI ab8a5aa572 Change default gem path. 2013-03-10 14:51:59 +09:00
masahino f210480652 fix handling of :branch option of gem.conf 2013-03-07 22:43:50 +09:00
mattn c7031d8527 Ignore empty gem 2013-02-07 16:35:26 +09:00
Yuichiro MASUI a9064dce15 Added "Unknown toolchain/gem" error message 2013-01-21 23:52:39 +09:00
Yuichiro MASUI ced80d2b4b Improved build scripts and config files 2013-01-20 22:48:42 +09:00