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.61 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.60 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.59 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.58 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.57 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.56 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.55 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.54 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.53 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.52 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.51 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.50 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.49 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.48 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.47 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.46 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.45 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.44 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.43 lib/vx/builder/script_builder/rust.rb
vx-builder-0.5.42 lib/vx/builder/script_builder/rust.rb