Translating Ivy dep version syntax to Maven in POM generation

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Translating Ivy dep version syntax to Maven in POM generation

WonderCsabo
I see, but now what is not clear for me is the role the proposed VersionSelector class. In this POM generation, it will be called with an Ivy version string as an input, as well as all other parts of the Gradle codebase. So VersionSelector only has to know the Ivy syntax for parsing.

But if you use it for POMs and Maven version string as input, we have to add Maven version syntax support too.
Reply | Threaded
Open this post in threaded view
|

Re: Translating Ivy dep version syntax to Maven in POM generation

Daz DeBoer-2
The production and consumption of maven-specific version strings should live entirely with the maven-specific code:
- POM generation should translate our 'Gradle' version string to maven version string
- POM parsing should translate maven version strings to the 'Gradle' format 

This is the first change I would make, and it would solve the actual problem at hand.

Ideally, we'd do something similar when translating to/from Ivy descriptor files, but for now the 'Gradle' format and the 'Ivy' format are the same. To start to address this, we'd start using a class to represent a parsed version string, and use that everywhere internally. Then, we'd only need to parse the version strings once when resolving (with POM, Ivy, and Gradle-specific parsing), and render the version strings when publishing.

But since this is a much bigger change, I'd start with just working on the POM parsing/production code.

Daz



On Thu, Aug 28, 2014 at 1:47 AM, WonderCsabo <[hidden email]> wrote:
I see, but now what is not clear for me is the role the proposed
VersionSelector class. In this POM generation, it will be called with an Ivy
version string as an input, as well as all other parts of the Gradle
codebase. So VersionSelector only has to know the Ivy syntax for parsing.

But if you use it for POMs and Maven version string as input, we have to add
Maven version syntax support too.



--
View this message in context: http://gradle.1045684.n5.nabble.com/Translating-Ivy-dep-version-syntax-to-Maven-in-POM-generation-tp5712755p5713072.html
Sent from the gradle-dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Darrell (Daz) DeBoer
Reply | Threaded
Open this post in threaded view
|

Re: Translating Ivy dep version syntax to Maven in POM generation

WonderCsabo
So, for now, this is the task:

* a class which represents an abstract dependency version
* a class which parses POM dependency syntax to that abstract version
* a class which parses 'Gradle' dependency syntax to that abstract version
* a class which renders that abstract version to POM dependency version string
* a class which renders that abstract version to 'Gradle' dependency version string
* use these to convert 'Gradle' string to POM string in POM publication
* use these to convert POM string to 'Gradle' string in POM consumption
Reply | Threaded
Open this post in threaded view
|

Re: Translating Ivy dep version syntax to Maven in POM generation

Adam Murdoch

On 29 Aug 2014, at 6:37 am, WonderCsabo <[hidden email]> wrote:

So, for now, this is the task:

* a class which represents an abstract dependency version
* a class which parses POM dependency syntax to that abstract version
* a class which parses 'Gradle' dependency syntax to that abstract version
* a class which renders that abstract version to POM dependency version
string
* a class which renders that abstract version to 'Gradle' dependency version
string
* use these to convert 'Gradle' string to POM string in POM publication
* use these to convert POM string to 'Gradle' string in POM consumption


This is eventually where we want to get to, but this is a lot of work and we don’t need to do all or even any of this to fix the pom generation problem. Even if we did do all of this, we’d chop it up into small pieces.

So, I’d suggest you start with one of these options:

Option 1. As Daz suggested, just stick with strings for now. Pom generation translates gradle strings to maven strings, and pom parsing translates maven strings to gradle strings.

or 

Option 2. Very basic VersionSelector implementation:

1. Add VersionSelector and change VersionMatcher to be able to produce these (without changing anything else)
2. Change Pom generation to take the gradle string and use VersionMatcher to parse the gradle string into a VersionSelector and then generate the maven string from this.
3. Change Pom parsing to produce a VersionSelector from a maven string and then generate the gradle string from this.

This way, we can introduce the concept and start using it, and then gradually decouple dependency declarations from the different formats internally.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
CTO Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply | Threaded
Open this post in threaded view
|

Re: Translating Ivy dep version syntax to Maven in POM generation

WonderCsabo

Hi guys! Sorry for the late answer. Unfortunetaly, as you already guessed i won't have time to implement this. I heard on a Maven forum this issue is being actively worked on. I hope this is true, so this will be finally resolved.

12