diff --git a/global.json b/global.json index 2d2fcbc..5544bc3 100644 --- a/global.json +++ b/global.json @@ -4,6 +4,6 @@ "rollForward": "latestFeature" }, "msbuild-sdks": { - "IKVM.NET.Sdk": "8.7.5-pre.3" + "IKVM.NET.Sdk": "8.7.5" } } diff --git a/src/IKVM.Maven.Sdk.Tasks.Tests/MavenReferenceItemResolveTests.cs b/src/IKVM.Maven.Sdk.Tasks.Tests/MavenReferenceItemResolveTests.cs index b779d88..edf6e7f 100644 --- a/src/IKVM.Maven.Sdk.Tasks.Tests/MavenReferenceItemResolveTests.cs +++ b/src/IKVM.Maven.Sdk.Tasks.Tests/MavenReferenceItemResolveTests.cs @@ -601,6 +601,36 @@ public void ExclusionsShouldExcludeSystemDependency() t.ResolvedReferences.Should().NotContain(i => i.ItemSpec == "maven$com.sun:tools:jar:1.8.0"); } + [TestMethod] + public void CanResolveClassifiers() + { + var cacheFile = Path.GetTempFileName(); + + var engine = new Mock(); + var errors = new List(); + engine.Setup(x => x.LogErrorEvent(It.IsAny())).Callback((BuildErrorEventArgs e) => { errors.Add(e); TestContext.WriteLine("ERROR: " + e.Message); }); + engine.Setup(x => x.LogWarningEvent(It.IsAny())).Callback((BuildWarningEventArgs e) => TestContext.WriteLine("WARNING: " + e.Message)); + engine.Setup(x => x.LogMessageEvent(It.IsAny())).Callback((BuildMessageEventArgs e) => TestContext.WriteLine(e.Message)); + var t = new MavenReferenceItemResolve(); + t.BuildEngine = engine.Object; + t.CacheFile = cacheFile; + t.Repositories = new[] { GetCentralRepositoryItem() }; + + var i1 = new TaskItem("edu.stanford.nlp:stanford-corenlp:4.5.5"); + i1.SetMetadata(MavenReferenceItemMetadata.GroupId, "edu.stanford.nlp"); + i1.SetMetadata(MavenReferenceItemMetadata.ArtifactId, "stanford-corenlp"); + i1.SetMetadata(MavenReferenceItemMetadata.Version, "4.5.5"); + i1.SetMetadata(MavenReferenceItemMetadata.Classifier, "models"); + i1.SetMetadata(MavenReferenceItemMetadata.Scope, "compile"); + + t.References = new[] { i1 }; + + t.Execute().Should().BeTrue(); + errors.Should().BeEmpty(); + + t.ResolvedReferences.Should().NotContain(i => i.ItemSpec == "maven$edu.stanford.nlp:stanford-corenlp:models:4.5.5"); + } + } } diff --git a/src/IKVM.Maven.Sdk.Tasks/IKVM.Maven.Sdk.Tasks.csproj b/src/IKVM.Maven.Sdk.Tasks/IKVM.Maven.Sdk.Tasks.csproj index a2737e3..54b65d5 100644 --- a/src/IKVM.Maven.Sdk.Tasks/IKVM.Maven.Sdk.Tasks.csproj +++ b/src/IKVM.Maven.Sdk.Tasks/IKVM.Maven.Sdk.Tasks.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/IKVM.Maven.Sdk/IKVM.Maven.Sdk.csproj b/src/IKVM.Maven.Sdk/IKVM.Maven.Sdk.csproj index b75f8e0..de536e9 100644 --- a/src/IKVM.Maven.Sdk/IKVM.Maven.Sdk.csproj +++ b/src/IKVM.Maven.Sdk/IKVM.Maven.Sdk.csproj @@ -20,7 +20,7 @@ - +