diff --git a/.github/workflows/IKVM.Maven.yml b/.github/workflows/IKVM.Maven.yml index 7e724c9..df1d5c2 100644 --- a/.github/workflows/IKVM.Maven.yml +++ b/.github/workflows/IKVM.Maven.yml @@ -48,6 +48,10 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0 with: @@ -199,6 +203,10 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x - name: Set up Java 8 uses: actions/setup-java@v4 with: diff --git a/global.json b/global.json index 423ec2b..7ae75c3 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestFeature" }, "msbuild-sdks": { diff --git a/src/IKVM.Maven.Sdk.Tasks/MavenEnvironment.cs b/src/IKVM.Maven.Sdk.Tasks/MavenEnvironment.cs index 0c76d5e..478d438 100644 --- a/src/IKVM.Maven.Sdk.Tasks/MavenEnvironment.cs +++ b/src/IKVM.Maven.Sdk.Tasks/MavenEnvironment.cs @@ -216,7 +216,7 @@ ProxySelector CreateProxySelector() { var selector = new DefaultProxySelector(); - foreach (var proxy in settings.getProxies().AsEnumerable()) + foreach (var proxy in settings.getProxies().AsList()) { // build authentication information from server record var builder = new AuthenticationBuilder(); @@ -239,7 +239,7 @@ MirrorSelector CreateMirrorSelector() { var selector = new DefaultMirrorSelector(); - foreach (var mirror in settings.getMirrors().AsEnumerable()) + foreach (var mirror in settings.getMirrors().AsList()) selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, false, mirror.getMirrorOf(), mirror.getMirrorOfLayouts()); return selector; @@ -253,7 +253,7 @@ AuthenticationSelector CreateAuthenticationSelector() { var selector = new DefaultAuthenticationSelector(); - foreach (Server server in (IEnumerable)settings.getServers()) + foreach (var server in settings.getServers().AsList()) { // build authentication information from server record var builder = new AuthenticationBuilder(); @@ -303,26 +303,34 @@ List CreateRemoteRepositories(IList import, TaskLoggingHelp var activeProfiles = settings.getActiveProfiles().AsList(); // import profile repositories - foreach (var repository in activeProfiles.SelectMany(i => profiles[i].getRepositories().AsList())) - map[repository.getId()] = new RemoteRepository.Builder(repository.getId(), DefaultRepositoryType, repository.getUrl()); + foreach (var profileId in activeProfiles) + if (profiles.TryGetValue(profileId, out var profile)) + foreach (var repository in profile.getRepositories().AsList()) + map[repository.getId()] = new RemoteRepository.Builder(repository.getId(), DefaultRepositoryType, repository.getUrl()); // override repository with imports foreach (var repository in import) map[repository.Id] = new RemoteRepository.Builder(repository.Id, DefaultRepositoryType, repository.Url); // merge profile settings - foreach (var repository in activeProfiles.SelectMany(i => profiles[i].getRepositories().AsList())) + foreach (var profileId in activeProfiles) { - if (map.TryGetValue(repository.getId(), out var r) == false) - continue; - - var releases = repository.getReleases(); - if (releases != null) - r.setPolicy(new org.eclipse.aether.repository.RepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(), releases.getChecksumPolicy())); - - var snapshots = repository.getSnapshots(); - if (snapshots != null) - r.setSnapshotPolicy(new org.eclipse.aether.repository.RepositoryPolicy(snapshots.isEnabled(), snapshots.getUpdatePolicy(), snapshots.getChecksumPolicy())); + if (profiles.TryGetValue(profileId, out var profile)) + { + foreach (var repository in profile.getRepositories().AsList()) + { + if (map.TryGetValue(repository.getId(), out var builder) == false) + continue; + + var releases = repository.getReleases(); + if (releases != null) + builder.setPolicy(new org.eclipse.aether.repository.RepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(), releases.getChecksumPolicy())); + + var snapshots = repository.getSnapshots(); + if (snapshots != null) + builder.setSnapshotPolicy(new org.eclipse.aether.repository.RepositoryPolicy(snapshots.isEnabled(), snapshots.getUpdatePolicy(), snapshots.getChecksumPolicy())); + } + } } // merge server settings