-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MavenReference Design Proposal #50
Comments
I just uploaded a proof-of-concept for how this could work, using only the There are 3 stages to this task:
This only completes the first stage. However, currently this is resolving dependencies at the project level only. It would be better to aggregate all of the Per our discussion on Discord, re-packaging the IKVM converted assemblies is not in the cards (at least not for
The second stage should be fairly straightforward at this point - run Plus there are some more things to handle:
Unfortunately, the Anyway, I just wanted to put something together to get some feedback to see what is missing and whether there are more ideas that can be added to the mix. I think much of what is currently in |
So this has been mostly completed in the
Yup that's it. Each member of the
MavenReferences are collected from three locations: MavenReference item group, ProjectReferences, and PackageReferences. All three of these lists of dependencies are merged together, and run through Maven's resolution logic, to produce a single set of JAR files to be compiled. This set is then emitted within the project as IkvmReference's. And the IkvmReference logic takes over from there. Since MavenReferences are collected from ProjectReferences, this makes them transitive through projects. If project A depends on project B which depends on MavneReference A, then both Project B and Project A will end up attempting to resolve Maven Reference A. And each may in fact arrive at different conclusion (different version limitations, etc). PackageReferences are already transitive. So, MavenReferences are collected by all PackageReferences of the current project (which includes those of child projects). Each PackageReferences is examined for a special file in it's nuget package. These files are TFM specific, and located like So, the idea here is each NuGet package that depends on something in Maven declares that it depends on something in Maven in a POM file in itself. The IkvmReference's produced by Maven reference are all set to Private. However, only COMPILE assets are set to ReferenceTargetAssembly true. A project that contains non-transitive MavenReference items has a POM file produced in it's package output describing those. Thus completing the circle. |
This was completed in the ikvm-maven repository. |
It would be useful if users could include packages from Maven repositories within a project in a manner similar to PackageReferences.
I envision the feature being used similar to how PackageReference is within a MSBuild project file:
To consume, a user would have to add a
PackageReference
to a NuGet package we build that sets up the necessary targets. The package name could be something likeIKVM.Build.Maven
.Behind the scenes, we would hook into the Restore pipeline. During restore, we search the configured Maven repositories for the proper artifact, and download it to Maven cache (~/.m2), much as NuGet downloads packages into the cache. We would likely consume the existing Maven libraries to accomplish this (we can!) These files would be downloaded the same place as regular Maven.
However, after that, we would run ikvmc on these artifacts, to generate .NET assemblies. These would be output into a similar cache as above, and care would have to be taken to ensure that we deal with versioning properly. The same user may reference Maven packages in projects that use a different version of IKVM (and thus ikvmc). Perhaps IKVM should grow an IkvmAssemblyVersion attribute of some kind, which we can decorate assemblies with, and increment each time a relevent change occurs. The cache folder can then be indexed by these values.
#54 May serve as the basis for this proposal, accomplishing the local JAR -> assembly conversion and maintenance, while this proposal simply fronts that.
The build system can then augment the Reference set pointing to these produced assemblies.
The text was updated successfully, but these errors were encountered: