Ejemplo n.º 1
0
        public int Execute(Execution execution)
        {
            var module = ModuleInfo.Load(Path.Combine(execution.WorkingDirectory, "Build", "Module.xml"));

            if (module.Packages == null)
            {
                throw new InvalidOperationException("No such package has been added");
            }

            var package = _packageUrlParser.Parse(execution.PackageUrl);

            var packageRef = _packageNameLookup.LookupPackageByName(module, package.Uri);

            _packageManager.Resolve(
                execution.WorkingDirectory,
                module,
                packageRef,
                execution.Platform ?? _hostPlatformDetector.DetectPlatform(),
                null,
                null,
                true,
                execution.SafePackageResolution);

            return(0);
        }
Ejemplo n.º 2
0
        public int Execute(Execution execution)
        {
            var url    = execution.PackageUrl;
            var module = ModuleInfo.Load(Path.Combine("Build", "Module.xml"));

            if (module.Packages == null)
            {
                throw new InvalidOperationException("No such package has been added");
            }

            var branch = "master";

            if (url.LastIndexOf('@') > url.LastIndexOf('/'))
            {
                // A branch / commit ref is specified.
                branch = url.Substring(url.LastIndexOf('@') + 1);
                url    = url.Substring(0, url.LastIndexOf('@'));
            }

            var packageRef = _packageNameLookup.LookupPackageByName(module, url);

            _packageManager.Resolve(
                module,
                packageRef,
                execution.Platform ?? _hostPlatformDetector.DetectPlatform(),
                null,
                null,
                true);

            return(0);
        }