예제 #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);
        }
예제 #2
0
        public async Task Test_Refresh_URL()
        {
            var repo = MavenRepository.FromUrl(ANDROID_THINGS_URL_REPO);
            await repo.Refresh();

            Assert.True(repo.Groups.Any());
        }
예제 #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);
        }
예제 #4
0
        public async Task Test_GroupIds_Project_URL()
        {
            var repo = MavenRepository.FromUrl(ANDROID_THINGS_URL_REPO);
            await repo.Refresh("com.google.android.things");

            var project = await repo.GetProjectAsync("com.google.android.things", "androidthings", "0.2-devpreview");

            Assert.True(project != null);
        }
예제 #5
0
        public async Task Test_GroupIds_Project_URL()
        {
            var repo = MavenRepository.FromUrl(JCENTER_URL_REPO);
            await repo.Refresh("io.kommunicate.sdk");

            var project = await repo.GetProjectAsync("io.kommunicate.sdk", "kommunicateui", "2.0.5");

            Assert.True(project != null);
        }