Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Creating a target platform file during the build

Hi,

I tried a different approach now.

If the project does not end in "-SNAPSHOT", it should be done already.
Otherwise I try to use "qualifiedVersion", which should be available in
tycho 0.22.0, if that fails I simply merge the unqualified versiona and
the build qualifier.

Right now it works, as long as the project has a dependency to the
projects it needs to use. In order for the BuildQualifierMojo to run first.

What do you think?

-------------- CODE ---------------------
 protected String getVersion ( final MavenProject project )
    {
        getLog ().debug ( "Properties: " + project.getProperties () );

        if ( !project.getVersion ().endsWith ( "-SNAPSHOT" ) )
        {
            // project version is already qualified
            return project.getVersion ();
        }

        final String version = project.getProperties ().getProperty (
"qualifiedVersion" );
        if ( version != null )
        {
            // we do have a direct qualified version
            return version;
        }

        final String q = project.getProperties ().getProperty (
"buildQualifier" );
        final String v = project.getProperties ().getProperty (
"unqualifiedVersion" );

        if ( q == null || v == null )
        {
            throw new IllegalStateException ( String.format ( "Unable to
find qualified version for: %s", project.getArtifactId () ) );
        }

        // just stick it together
        return v + "." + q;
    }
-------------- CODE ---------------------

On 10/24/2014 03:05 PM, Oberlies, Tobias wrote:
> This is in fact hard at the moment. There are two bugs which also require the same information, i.e. the qualifier of a different reactor project:
>
> * https://bugs.eclipse.org/bugs/show_bug.cgi?id=373817
> * https://bugs.eclipse.org/bugs/show_bug.cgi?id=352081
>
> Unfortunately these are not fixed yet. These bugs were the ones I wanted to fix next in my journey towards the eclipse-repository aggregation bug [3], but I'm not making any progress at the moment.
>
> Regards
> Tobias
>
>
> [3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=372780 



Back to the top