unity-jar-resolver icon indicating copy to clipboard operation
unity-jar-resolver copied to clipboard

POM classifier support

Open martino2k6 opened this issue 7 years ago • 2 comments

The Android resolver currently supports the groupId:artifactId:version@packaging format for defining Android dependencies, however as per Maven's specification the POM can also have a classifier property. For example:

    <dependency>
      <groupId>com.pollfish</groupId>
      <artifactId>pollfish</artifactId>
      <version>4.4.0</version>
      <type>aar</type>
      <classifier>googleplayRelease</classifier>
      <scope>compile</scope>
    </dependency>

The above example is requested in Gradle by using com.pollfish:pollfish:4.4.0:googleplayRelease@aar (note the colon-delimited part before the type). It seems however that the resolver ignores the classifier when the dependency is being declared directly in an XML or when it is a transitive dependency.

Would it be possible to add support for it?

Thank you.

martino2k6 avatar Sep 19 '18 16:09 martino2k6

@martino2k6 we're happy to take pull requests for this sort of thing.

If you or anyone else is game, there is quite a bit of code to touch to add this functionality.

In the C# component (though you could pack this into the version string):

  • https://github.com/googlesamples/unity-jar-resolver/blob/36ada374c8557f8237a6d5b01964b91cdebf4c01/source/JarResolverLib/src/Google.JarResolver/PlayServicesSupport.cs#L264
  • https://github.com/googlesamples/unity-jar-resolver/blob/master/source/JarResolverLib/src/Google.JarResolver/Dependency.cs
  • https://github.com/googlesamples/unity-jar-resolver/blob/5575166b6910c7d3845c1fd2da920b805a7d876d/source/PlayServicesResolver/src/ResolverVer1_1.cs#L713

Also, in the Gradle download script:

  • https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/scripts/download_artifacts.gradle this would need support for parsing & sorting classifiers which shouldn't be that tricky to add.

stewartmiles avatar Sep 19 '18 16:09 stewartmiles

Thank you for pointing out the relevant classes. I'll see if I can get some time dedicated to work on this, however for the moment we have de-prioritised this issue internally. Will let you know if I start on it though.

martino2k6 avatar Sep 20 '18 16:09 martino2k6