Sha256: 82c593d8676c97398e94713d2658681aff9c814aefcdea14693ffbf626599449

Contents?: true

Size: 1.02 KB

Versions: 56

Compression:

Stored size: 1.02 KB

Contents

module Vx
  module Builder
    class ScriptBuilder

      class Rust < Base

        DEFAULT_RUST = '0.11.0'

        def call(env)
          if enabled?(env)

            vxvm_install(env, 'rust', rust_version(env))

            do_cache_key(env) do |i|
              i << "rust-#{rust_version env}"
            end

            do_install(env) do |i|
              i << trace_sh_command("git submodule init")
              i << trace_sh_command("git submodule update")
            end

            do_announce(env) do |i|
              i << trace_sh_command("rustc --version")
            end

            do_script(env) do |i|
              i << trace_sh_command("if [ -f Makefile ] ; then make ; fi", trace: "make")
            end
          end

          app.call(env)
        end

        private

          def enabled?(env)
            env.source.rust.first || env.source.language == 'rust'
          end

          def rust_version(env)
            env.source.rust.first || DEFAULT_RUST
          end

      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
vx-builder-0.5.41 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.38 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.37 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.36 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.35 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.34 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.33 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.32 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.31 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.30 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.29 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.28 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.27 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.26 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.25 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.24 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.23 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.22 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.21 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.20 lib/vx/builder/script_builder/rust.rb