micro-fast-tool 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/micro-fast-tool.gemspec +12 -0
  3. data/rake-compiler-1.3.1/Gemfile +8 -0
  4. data/rake-compiler-1.3.1/History.md +695 -0
  5. data/rake-compiler-1.3.1/LICENSE.txt +20 -0
  6. data/rake-compiler-1.3.1/README.md +476 -0
  7. data/rake-compiler-1.3.1/Rakefile +15 -0
  8. data/rake-compiler-1.3.1/appveyor.yml +22 -0
  9. data/rake-compiler-1.3.1/bin/rake-compiler +24 -0
  10. data/rake-compiler-1.3.1/cucumber.yml +4 -0
  11. data/rake-compiler-1.3.1/features/compile.feature +79 -0
  12. data/rake-compiler-1.3.1/features/cross-compile.feature +23 -0
  13. data/rake-compiler-1.3.1/features/cross-package-multi.feature +15 -0
  14. data/rake-compiler-1.3.1/features/cross-package.feature +14 -0
  15. data/rake-compiler-1.3.1/features/java-compile.feature +22 -0
  16. data/rake-compiler-1.3.1/features/java-no-native-compile.feature +33 -0
  17. data/rake-compiler-1.3.1/features/java-package.feature +24 -0
  18. data/rake-compiler-1.3.1/features/package.feature +40 -0
  19. data/rake-compiler-1.3.1/features/step_definitions/compilation.rb +70 -0
  20. data/rake-compiler-1.3.1/features/step_definitions/cross_compilation.rb +27 -0
  21. data/rake-compiler-1.3.1/features/step_definitions/execution.rb +52 -0
  22. data/rake-compiler-1.3.1/features/step_definitions/folders.rb +32 -0
  23. data/rake-compiler-1.3.1/features/step_definitions/gem.rb +46 -0
  24. data/rake-compiler-1.3.1/features/step_definitions/java_compilation.rb +7 -0
  25. data/rake-compiler-1.3.1/features/support/env.rb +10 -0
  26. data/rake-compiler-1.3.1/features/support/file_template_helpers.rb +137 -0
  27. data/rake-compiler-1.3.1/features/support/generator_helpers.rb +123 -0
  28. data/rake-compiler-1.3.1/features/support/platform_extension_helpers.rb +27 -0
  29. data/rake-compiler-1.3.1/lib/rake/baseextensiontask.rb +90 -0
  30. data/rake-compiler-1.3.1/lib/rake/compiler_config.rb +38 -0
  31. data/rake-compiler-1.3.1/lib/rake/extensioncompiler.rb +51 -0
  32. data/rake-compiler-1.3.1/lib/rake/extensiontask.rb +589 -0
  33. data/rake-compiler-1.3.1/lib/rake/javaextensiontask.rb +321 -0
  34. data/rake-compiler-1.3.1/tasks/bin/cross-ruby.rake +189 -0
  35. data/rake-compiler-1.3.1/tasks/bootstrap.rake +11 -0
  36. data/rake-compiler-1.3.1/tasks/common.rake +10 -0
  37. data/rake-compiler-1.3.1/tasks/cucumber.rake +23 -0
  38. data/rake-compiler-1.3.1/tasks/gem.rake +15 -0
  39. data/rake-compiler-1.3.1/tasks/rspec.rake +9 -0
  40. metadata +79 -0
@@ -0,0 +1,90 @@
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/tasklib'
4
+ require 'rbconfig'
5
+
6
+ require 'pathname'
7
+
8
+ require_relative "compiler_config"
9
+
10
+ module Rake
11
+ class BaseExtensionTask < TaskLib
12
+
13
+ attr_accessor :name
14
+ attr_accessor :gem_spec
15
+ attr_accessor :tmp_dir
16
+ attr_accessor :ext_dir
17
+ attr_accessor :lib_dir
18
+ attr_accessor :config_options
19
+ attr_accessor :source_pattern
20
+ attr_accessor :extra_options
21
+ attr_accessor :extra_sources
22
+ attr_writer :platform
23
+
24
+ def platform
25
+ @platform ||= RUBY_PLATFORM
26
+ end
27
+
28
+ def initialize(name = nil, gem_spec = nil)
29
+ init(name, gem_spec)
30
+ yield self if block_given?
31
+ define
32
+ end
33
+
34
+ def init(name = nil, gem_spec = nil)
35
+ @name = name
36
+ @gem_spec = gem_spec
37
+ @tmp_dir = 'tmp'
38
+ @ext_dir = "ext/#{@name}"
39
+ @lib_dir = 'lib'
40
+ if @name and File.dirname(@name.to_s) != "."
41
+ @lib_dir += "/#{File.dirname(@name.to_s)}"
42
+ end
43
+ @config_options = []
44
+ @extra_options = ARGV.select { |i| i =~ /\A--?/ }
45
+ @extra_sources = FileList[]
46
+ end
47
+
48
+ def define
49
+ fail "Extension name must be provided." if @name.nil?
50
+ @name = @name.to_s
51
+
52
+ define_compile_tasks
53
+ end
54
+
55
+ private
56
+
57
+ def define_compile_tasks
58
+ raise NotImplementedError
59
+ end
60
+
61
+ def binary(platform = nil)
62
+ ext = case platform
63
+ when /darwin/
64
+ 'bundle'
65
+ when /mingw|mswin|linux/
66
+ 'so'
67
+ when /java/
68
+ 'jar'
69
+ else
70
+ RbConfig::CONFIG['DLEXT']
71
+ end
72
+ "#{@name}.#{ext}"
73
+ end
74
+
75
+ def source_files
76
+ FileList["#{@ext_dir}/#{@source_pattern}"] + @extra_sources
77
+ end
78
+
79
+ def warn_once(message)
80
+ @@already_warned ||= false
81
+ return if @@already_warned
82
+ @@already_warned = true
83
+ warn message
84
+ end
85
+
86
+ def windows?
87
+ Rake.application.windows?
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,38 @@
1
+ module Rake
2
+ class CompilerConfig
3
+ def initialize(config_path)
4
+ require "yaml"
5
+ @config = YAML.load_file(config_path)
6
+ end
7
+
8
+ def find(ruby_version, gem_platform)
9
+ gem_platform = Gem::Platform.new(gem_platform)
10
+
11
+ @config.each do |config_name, config_location|
12
+ # There are two variations we might find in the rake-compiler config.yml
13
+ #
14
+ # 1. config_name: rbconfig-x86_64-linux-3.0.0
15
+ # runtime_platform_name: x86_64-linux
16
+ # runtime_version: 3.0.0
17
+ #
18
+ # 2. config_name: rbconfig-x86_64-linux-gnu-3.0.0
19
+ # runtime_platform_name: x86_64-linux-gnu
20
+ # runtime_version: 3.0.0
21
+ #
22
+ # With rubygems < 3.3.21, both variations will be present (two entries pointing at the same
23
+ # installation).
24
+ #
25
+ # With rubygems >= 3.3.21, only the second variation will be present.
26
+ runtime_platform_name = config_name.split("-")[1..-2].join("-")
27
+ runtime_version = config_name.split("-").last
28
+ runtime_platform = Gem::Platform.new(runtime_platform_name)
29
+
30
+ if (ruby_version == runtime_version) && (gem_platform =~ runtime_platform)
31
+ return config_location
32
+ end
33
+ end
34
+
35
+ nil
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,51 @@
1
+ module Rake
2
+
3
+ #
4
+ # HACK: Lousy API design, sue me. At least works ;-)
5
+ #
6
+ # Define a series of helpers to aid in search and usage of MinGW (GCC) Compiler
7
+ # by gem developer/creators.
8
+ #
9
+ module ExtensionCompiler
10
+ # return the host portion from the installed MinGW
11
+ def self.mingw_host
12
+ return @mingw_host if @mingw_host
13
+
14
+ # the mingw_gcc_executable is helpful here
15
+ if target = mingw_gcc_executable then
16
+ # we only care for the filename
17
+ target = File.basename(target)
18
+
19
+ # now strip the extension (if present)
20
+ target.sub!(File.extname(target), '')
21
+
22
+ # get rid of '-gcc' portion too ;-)
23
+ target.sub!('-gcc', '')
24
+ end
25
+
26
+ raise "No MinGW tools or unknown setup platform?" unless target
27
+
28
+ @mingw_host = target
29
+ end
30
+
31
+ # return the first compiler found that includes both mingw and gcc conditions
32
+ # (this assumes you have one installed)
33
+ def self.mingw_gcc_executable
34
+ return @mingw_gcc_executable if @mingw_gcc_executable
35
+
36
+ # grab the paths defined in the environment
37
+ paths = ENV['PATH'].split(File::PATH_SEPARATOR)
38
+
39
+ # the pattern to look into (captures *nix and windows executables)
40
+ pattern = "{mingw32-,i?86*mingw*,x86*mingw*}gcc{,.*}"
41
+
42
+ @mingw_gcc_executable = paths.find do |path|
43
+ # cleanup paths before globbing
44
+ gcc = Dir.glob("#{File.expand_path(path)}/#{pattern}").first
45
+ break gcc if gcc
46
+ end
47
+
48
+ @mingw_gcc_executable
49
+ end
50
+ end
51
+ end