Skip to content

Commit

Permalink
Add .NET 8 SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jan 8, 2024
1 parent 4409202 commit a6780d5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/IKVM.Maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestFeature"
},
"msbuild-sdks": {
Expand Down
40 changes: 24 additions & 16 deletions src/IKVM.Maven.Sdk.Tasks/MavenEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ ProxySelector CreateProxySelector()
{
var selector = new DefaultProxySelector();

foreach (var proxy in settings.getProxies().AsEnumerable<org.apache.maven.settings.Proxy>())
foreach (var proxy in settings.getProxies().AsList<org.apache.maven.settings.Proxy>())
{
// build authentication information from server record
var builder = new AuthenticationBuilder();
Expand All @@ -239,7 +239,7 @@ MirrorSelector CreateMirrorSelector()
{
var selector = new DefaultMirrorSelector();

foreach (var mirror in settings.getMirrors().AsEnumerable<Mirror>())
foreach (var mirror in settings.getMirrors().AsList<Mirror>())
selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, false, mirror.getMirrorOf(), mirror.getMirrorOfLayouts());

return selector;
Expand All @@ -253,7 +253,7 @@ AuthenticationSelector CreateAuthenticationSelector()
{
var selector = new DefaultAuthenticationSelector();

foreach (Server server in (IEnumerable)settings.getServers())
foreach (var server in settings.getServers().AsList<Server>())
{
// build authentication information from server record
var builder = new AuthenticationBuilder();
Expand Down Expand Up @@ -303,26 +303,34 @@ List CreateRemoteRepositories(IList<MavenRepositoryItem> import, TaskLoggingHelp
var activeProfiles = settings.getActiveProfiles().AsList<string>();

// import profile repositories
foreach (var repository in activeProfiles.SelectMany(i => profiles[i].getRepositories().AsList<Repository>()))
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<Repository>())
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<Repository>()))
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<Repository>())
{
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
Expand Down

0 comments on commit a6780d5

Please sign in to comment.