308 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
Yukihiro "Matz" Matsumoto 622e68e535 Merge branch 'fix_androidndk_rake' of https://github.com/crimsonwoods/mruby into crimsonwoods-fix_androidndk_rake 2015-10-15 23:08:38 +09:00
Seba Gamboa 1e2381f870 Rename androidndk tolchain to just android 2015-10-12 13:41:46 -03:00
Yukihiro "Matz" Matsumoto e48596e9e6 delete tasks/toolchains/androideabi.rake; ref #2983 #2988
use androidndk.rake which is better and 64bit aware
2015-10-13 00:03:58 +09:00
crimsonwoods 6b58d58a64 Fix issue: LDFLAGS is not applied correctly. 2015-10-12 23:15:32 +09:00
crimsonwoods 1a59721c69 Accoding to the implementation of 'cflags', '-no-canonical-prefixes' is isolated. 2015-10-11 17:40:26 +09:00
crimsonwoods 7b65f394e6 Remove unnecessary cases.
'mips64' can integrate into 'mips'.
'x86_64' is the same as 'mips64'.
2015-10-11 17:35:36 +09:00
crimsonwoods 61e4d1e6f0 Integrate common flag '-no-canonical-prefixes'. 2015-10-11 17:34:01 +09:00
crimsonwoods a2a5c34c56 Integrate common flag. 2015-10-11 17:25:48 +09:00
crimsonwoods ad8a895af5 Implement 'ldflags' for 'x86' architecture. 2015-10-11 17:24:47 +09:00
crimsonwoods 210f86f95c Implement 'ldflags' for 'x86_64' architecture. 2015-10-11 17:23:39 +09:00
crimsonwoods a106e5dc5a Implement 'ldflags' for 'mips' architecture. 2015-10-11 17:22:39 +09:00
crimsonwoods 2482642e09 Implement 'ldflags' for 'mips64' architecture. 2015-10-11 17:21:48 +09:00
crimsonwoods f5bc0cea20 Implement 'ldflags' for 'armeabi-v7a-hard' and 'armeabi-v7a'. 2015-10-11 17:17:32 +09:00
crimsonwoods 4a07b84d2c Implement 'ldflags' for 'armeabi' architecture. 2015-10-11 17:13:35 +09:00
crimsonwoods c0d30ab6cd Implement 'ldflags' for 'arm64' architecture. 2015-10-11 17:11:38 +09:00
crimsonwoods 07c35de3a6 Implement 'ldflags'.
This is the first step of implementing 'ldflags'.
2015-10-11 17:08:46 +09:00
crimsonwoods c38a27185e Add a missing required flag '-fstack-protector-strong'. 2015-10-11 16:46:53 +09:00
crimsonwoods ad89fe63ae Add support for 'x86_64' architecture. 2015-10-11 16:45:34 +09:00
crimsonwoods 1ac5d35753 Remove duplicated compiler options. 2015-10-11 16:40:59 +09:00
crimsonwoods 3458a83e89 Some flags (-ffunction-sections and etc.) should be set by default for 'x86' architecture. 2015-10-11 16:37:38 +09:00
crimsonwoods b493c6bfde Add support for 'armeabi-v7a-hard' architecture. 2015-10-11 16:34:42 +09:00
crimsonwoods abaad5c0d6 Some flags (-fpic and etc.) should be set by default for 'armeabi-v7a' and 'armeabi' architecture. 2015-10-11 16:32:50 +09:00
crimsonwoods 61a188a38a Some flags (-fpic and etc.) should be set by default for 'arm64' architecture. 2015-10-11 16:26:58 +09:00
crimsonwoods 86f710cf0c Replace tab by white-spaces. 2015-10-11 16:24:30 +09:00
crimsonwoods c022357ed5 Add support for 'mips64' architecture. 2015-10-11 16:22:45 +09:00
crimsonwoods 3ae425e3f0 Fix build error for 'x86' architecture. 2015-10-11 16:14:00 +09:00
crimsonwoods a2966734aa Fix build error for 'mips' architecture. 2015-10-11 16:06:21 +09:00
crimsonwoods cd9733933e Add support for 'arm64' architecture. 2015-10-11 15:58:28 +09:00
Seba Gamboa 2bec248a19 Change some constants names 2015-10-07 21:18:28 -03:00
Seba Gamboa deb349d729 Refactoring Android NDK toolchain 2015-10-07 21:04:30 -03:00
Seba Gamboa d6665fc402 Add optional params to toolchain configuration 2015-10-06 15:52:19 -03:00
Yukihiro "Matz" Matsumoto 3f508d90da Merge pull request #2946 from sagmor/test-dependencies
Add gem test dependencies
2015-10-03 18:41:22 +09:00
Terence Lee c717bbb77a LinkerConfig is a struct with five params 2015-09-25 23:22:11 -06:00
Seba Gamboa 803f11e001 Add test dependencies 2015-09-09 13:33:42 -03:00
Zachary Scott c6860bc0c4 Allow rbfiles in mrblib and test to have subdirs 2015-09-04 11:01:50 -04:00
Zachary Scott bacb826868 Add build_mrbtest after config block is evaluated
This allows us to add `enable_test` anywhere in a build target,
without having to worry about the order in which they are included.

Previously, there was a bug that occured when adding 'mruby-test' gem
to dependencies before additional gems.

Instead of adding the 'mruby-test' gem dependency manually to a test build,
we now only need to call `enable_test` in the target. This also allows us to
call `test_enabled?` downstream when running mruby tests ourselves.

/cc #2924
2015-09-03 01:02:53 -04:00
Zachary Scott 133d57cb0d Add mruby-test build config and update :test task to use mrbgem binary
Removed old mrbgems_test.rake which was merged into mrbgem spec
2015-08-22 10:21:52 -04:00
Terence Lee 5c055d670a be able to source with :path for mrbgems 2015-08-02 15:03:12 +02:00
Yukihiro "Matz" Matsumoto 0da057d99c Merge pull request #2900 from joans321/enhance-mrbgem-build
mrbgem compile should be depend on mrbgem.rake
2015-07-29 11:44:23 +09:00
Zachary Scott 923e04cf50 Shallow clone mgem source 2015-07-27 17:16:37 -04:00
xuejianqing 578db292fd mrbgem compile should be depend on mrbgem.rake 2015-07-27 12:22:23 +08:00
xuejianqing 007d26f168 fix android compile bug : uninitialized constant GCC_VERSION 2015-07-25 18:43:27 +08:00
Seba Gamboa f01704477f Add ability to change compiler versions for androideabi 2015-07-22 21:57:20 -03:00
take_cheeze 2e4bc2de88 Refactor Build#compile_as_cxx. 2015-07-15 14:46:56 +09:00
xuejianqing 0b50b4a500 fix androideabi cross-compile error : undefined reference to 'frexpl' 2015-07-06 12:51:57 +08: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
mattn a15e99d2b6 add_dependency doesn't work 2015-06-25 00:19:04 +09:00