Beispiel #1
0
        public static async Task BinderateAsync(BindingConfig config)
        {
            MavenRepository maven;

            if (config.MavenRepositoryType == MavenRepoType.Directory)
            {
                maven = MavenRepository.FromDirectory(config.MavenRepositoryLocation);
            }
            else if (config.MavenRepositoryType == MavenRepoType.Url)
            {
                maven = MavenRepository.FromUrl(config.MavenRepositoryLocation);
            }
            else if (config.MavenRepositoryType == MavenRepoType.MavenCentral)
            {
                maven = MavenRepository.FromMavenCentral();
            }
            else
            {
                maven = MavenRepository.FromGoogle();
            }

            await maven.Refresh(config.MavenArtifacts.Where(ma => !ma.DependencyOnly).Select(ma => ma.GroupId).Distinct().ToArray());

            if (config.DownloadExternals)
            {
                var artifactDir = Path.Combine(config.BasePath, config.ExternalsDir);
                if (!Directory.Exists(artifactDir))
                {
                    Directory.CreateDirectory(artifactDir);
                }
            }

            await ProcessConfig(maven, config);
        }
Beispiel #2
0
        public async Task Test_Refresh_GOOGLE()
        {
            var repo = MavenRepository.FromGoogle();
            await repo.Refresh();

            Assert.True(repo.Groups.Any());
        }
Beispiel #3
0
        static MavenRepository GetOrCreateRepository(MavenRepoType type, string location)
        {
            var key = $"{type}|{location}";

            if (repositories.TryGetValue(key, out MavenRepository repository))
            {
                return(repository);
            }

            MavenRepository maven;

            if (type == MavenRepoType.Directory)
            {
                maven = MavenRepository.FromDirectory(location);
            }
            else if (type == MavenRepoType.Url)
            {
                maven = MavenRepository.FromUrl(location);
            }
            else if (type == MavenRepoType.MavenCentral)
            {
                maven = MavenRepository.FromMavenCentral();
            }
            else
            {
                maven = MavenRepository.FromGoogle();
            }

            repositories.Add(key, maven);

            return(maven);
        }
Beispiel #4
0
        public async Task Test_GroupIds_Project_GOOGLE()
        {
            var repo = MavenRepository.FromGoogle();
            await repo.Refresh("com.google.android.gms");

            var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0");

            Assert.True(project != null);

            Assert.True(project.Dependencies?.Any());
        }
        public void Test_Maven_Google()
        {
            MavenRepository repo = MavenRepository.FromGoogle();

            repo.Refresh("androidx.car");

            global::MavenNet.Models.Project project;
            project = repo.GetProjectAsync("androidx.car", "car").Result;

            #if MSTEST
            Assert.IsNotNull(repo);
            #elif NUNIT
            Assert.NotNull(repo);
            #elif XUNIT
            Assert.NotNull(repo);
            #endif

            return;
        }