Sha256: 58cea6fd787c302d59f263d132c80d106328617ceef8d8e4b2fd4642de44ddec

Contents?: true

Size: 1.29 KB

Versions: 23

Compression:

Stored size: 1.29 KB

Contents

require 'autoproj/cli/inspection_tool'
require 'autoproj/ops/cache'

module Autoproj
    module CLI
        class Cache < InspectionTool
            def validate_options(argv, options = Hash.new)
                argv, options = super

                if argv.empty?
                    default_cache_dirs = Autobuild::Importer.default_cache_dirs
                    if !default_cache_dirs || default_cache_dirs.empty?
                        raise CLIInvalidArguments, "no cache directory defined with e.g. the AUTOBUILD_CACHE_DIR environment variable, expected one cache directory as argument"
                    end
                    Autoproj.warn "using cache directory #{default_cache_dirs.first} from the autoproj configuration"
                    argv << default_cache_dirs.first
                end

                return File.expand_path(argv.first, ws.root_dir), *argv[1..-1], options
            end

            def run(cache_dir, *package_names, all: true, keep_going: false, checkout_only: false)
                initialize_and_load
                finalize_setup

                cache_op = Autoproj::Ops::Cache.new(cache_dir, ws.manifest)
                cache_op.create_or_update(*package_names, all: all, keep_going: keep_going, checkout_only: checkout_only)
            end
        end
    end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
autoproj-2.11.0 lib/autoproj/cli/cache.rb
autoproj-2.10.2 lib/autoproj/cli/cache.rb
autoproj-2.10.1 lib/autoproj/cli/cache.rb
autoproj-2.10.0 lib/autoproj/cli/cache.rb
autoproj-2.9.0 lib/autoproj/cli/cache.rb
autoproj-2.8.8 lib/autoproj/cli/cache.rb
autoproj-2.8.7 lib/autoproj/cli/cache.rb
autoproj-2.8.6 lib/autoproj/cli/cache.rb
autoproj-2.8.5 lib/autoproj/cli/cache.rb
autoproj-2.8.5.b1 lib/autoproj/cli/cache.rb
autoproj-2.8.4 lib/autoproj/cli/cache.rb
autoproj-2.8.3 lib/autoproj/cli/cache.rb
autoproj-2.8.2 lib/autoproj/cli/cache.rb
autoproj-2.8.1 lib/autoproj/cli/cache.rb
autoproj-2.8.0 lib/autoproj/cli/cache.rb
autoproj-2.7.1 lib/autoproj/cli/cache.rb
autoproj-2.7.0 lib/autoproj/cli/cache.rb
autoproj-2.6.1 lib/autoproj/cli/cache.rb
autoproj-2.6.0 lib/autoproj/cli/cache.rb
autoproj-2.5.1 lib/autoproj/cli/cache.rb