Source bundle creation

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Source bundle creation

Beat Strasser
Hello everyone

I need tycho to create an eclipse source bundle for each of my
eclipse-plugin (built with tycho).

https://issues.sonatype.org/browse/TYCHO-136 tells me that this feature
is broken at the moment... :(

I'd like to test it with my tycho installation (I'm using
tycho-0.4.0-DEV-2408). How would I use this? I cannot find any
information on source bundles with tycho.

Thanks,
--
Beat Strasser

phone +41 43 343 21 55 | fax +41 43 343 20 21
Inventage AG | CH-8005 Z├╝rich | http://www.inventage.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Source bundle creation

Igor Fedorenko-2
I am not sure I understand the question. Tycho is not currently able to
generate source bundles and features, so you can not test this.

If you want to help adding this functionality to Tycho, there is
(somewhat outdated) information about Tycho development environment
setup in [1] and you can of course ask questions here.

[1]
https://docs.sonatype.org/display/M2ECLIPSE/Tycho+development+environment

--
Regards,
Igor.

Beat Strasser wrote:

> Hello everyone  
>
> I need tycho to create an eclipse source bundle for each of my
> eclipse-plugin (built with tycho).
>
> https://issues.sonatype.org/browse/TYCHO-136 tells me that this feature
> is broken at the moment... :(
>
> I'd like to test it with my tycho installation (I'm using
> tycho-0.4.0-DEV-2408). How would I use this? I cannot find any
> information on source bundles with tycho.
>
> Thanks,

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Source bundle creation

Beat Strasser
Hi Igor

 > I am not sure I understand the question. Tycho is not currently able to
 > generate source bundles and features, so you can not test this.

Well, after reading the source of maven-osgi-source-plugin, I was able
to get it working - at least in my setup. With the tycho build
0.4.0-DEV-2864 and the following configuration, tycho attaches a source
artifact which is a valid Eclipse source bundle - but I had to provide a
manifest file.

Actually, my setup is quite simple: all the sources are in src/main/java...

<plugin>
        <groupId>org.codehaus.tycho</groupId>
        <artifactId>maven-osgi-source-plugin</artifactId>
        <executions>
                <execution>
                        <id>plugin-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                                <goal>plugin-source</goal>
                        </goals>
                        <configuration>
                                <useDefaultManifestFile>true</useDefaultManifestFile>
                         
<defaultManifestFile>src/main/resources/MANIFEST-sources.MF</defaultManifestFile>
                        </configuration>
                </execution>
        </executions>
</plugin>

IMO, it should be the task of the maven-osgi-source-plugin to set the
correct bundle identifier (inclusive version) in the source bundle's
manifest file. Programmers tend to forget to update the
MANIFEST-sources.MF when the bundle version changes.

--
Beat Strasser
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Source bundle creation

Igor Fedorenko-2
Do you think you can patch maven-osgi-source-plugin?

--
Regards,
Igor

Beat Strasser wrote:

> Hi Igor
>
>  > I am not sure I understand the question. Tycho is not currently able to
>  > generate source bundles and features, so you can not test this.
>
> Well, after reading the source of maven-osgi-source-plugin, I was able
> to get it working - at least in my setup. With the tycho build
> 0.4.0-DEV-2864 and the following configuration, tycho attaches a source
> artifact which is a valid Eclipse source bundle - but I had to provide a
> manifest file.
>
> Actually, my setup is quite simple: all the sources are in src/main/java...
>
> <plugin>
>     <groupId>org.codehaus.tycho</groupId>
>     <artifactId>maven-osgi-source-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>plugin-source</id>
>             <phase>generate-sources</phase>
>             <goals>
>                 <goal>plugin-source</goal>
>             </goals>
>             <configuration>
>                 <useDefaultManifestFile>true</useDefaultManifestFile>
>              
> <defaultManifestFile>src/main/resources/MANIFEST-sources.MF</defaultManifestFile>
>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
>
> IMO, it should be the task of the maven-osgi-source-plugin to set the
> correct bundle identifier (inclusive version) in the source bundle's
> manifest file. Programmers tend to forget to update the
> MANIFEST-sources.MF when the bundle version changes.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Source bundle creation

Beat Strasser
> Do you think you can patch maven-osgi-source-plugin?

I did it, see TYCHO-285. Now, we don't have to specify a custom manifest
file for the source jar anymore.

I didn't rename the source jar, the mojo still follows the Maven
convention. So when adding a source bundle to the IDE, one has to rename
com.company.bundle-1.2.3-sources.jar to com.company.bundle.source_1.2.3.jar.

--
Beat Strasser
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Source bundle creation

Igor Fedorenko-2
I applied the patch, thank you.

FYI, actual source bundle file name does not really matter because Maven
will change it to canonical artifactId-version-classifier.jar when
installing/deploying the bundle to a repository.

--
Regards,
Igor


Beat Strasser wrote:

>> Do you think you can patch maven-osgi-source-plugin?
>
> I did it, see TYCHO-285. Now, we don't have to specify a custom manifest
> file for the source jar anymore.
>
> I didn't rename the source jar, the mojo still follows the Maven
> convention. So when adding a source bundle to the IDE, one has to rename
> com.company.bundle-1.2.3-sources.jar to
> com.company.bundle.source_1.2.3.jar.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

consuming bundles built with maven2/felix from tycho

Sievers, Jan
Hi,

for our OSGi development with Maven we have the following boundary conditions:

1. we want to be able to use the PDE build locally in eclipse as far as possible (this means as target platform we need a P2 repo)
2. it's equinox-based

Tycho has great solutions for this, however we are building both server-side OSGi bundles as well as classical eclipse plugins.
Since we don't want to start from scratch, we want to be able to consume existing OSGi wrappers for standard libraries.
Many of these wrappers are built with maven2/felix and
http://www.sonatype.com/people/2009/04/tycho-implicit-build-target-platform-support-from-maven/

says that the tycho P2 resolver won't "see" bundles built with felix/bnd.

We would like to stick  with tycho only but according to
http://www.nabble.com/Re%3A-Building-Eclipse-RCP-applications-with-Tycho-p23694678.html
it seems support for building wrapper bundles is currently quite limited.

After reading http://www.sonatype.com/people/2009/09/maven-handbook-013-minimal-update-print-friendly-pdf/ , esp. "creating a virtual OBR repository", I was hoping to find a similar "creating a virtual P2 repository" which would make OBR or other repo formats transparently available in P2 format which could then be consumed by tycho.

Is something along these lines planned for Nexus Pro?

If not, do you think e.g. an ant script that takes existing wrapper bundles and publishes them using the p2 publisher tasks from eclipse would be an acceptable workaround?

Thanks for your insights and Best Regards
Jan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: consuming bundles built with maven2/felix from tycho

Brian Fox
Administrator
ms support for building wrapper bundles is currently quite limited.
>
> After reading http://www.sonatype.com/people/2009/09/maven-handbook-013-minimal-update-print-friendly-pdf/ , esp. "creating a virtual OBR repository", I was hoping to find a similar "creating a virtual P2 repository" which would make OBR or other repo formats transparently available in P2 format which could then be consumed by tycho.
>
> Is something along these lines planned for Nexus Pro?
>
Yes, we ultimately want to be able to mediate between the various
formats. That's the goal, if it's possible automatically given the
metadata differences between the formats is something we continue to
work on.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: consuming bundles built with maven2/felix from tycho

Igor Fedorenko-2
In reply to this post by Sievers, Jan
Yes, this is planned for Nexus/Pro but you need to talk to Jason or
Brian about details.

--
Regards,
Igor

Sievers, Jan wrote:

> Hi,
>
> for our OSGi development with Maven we have the following boundary conditions:
>
> 1. we want to be able to use the PDE build locally in eclipse as far as possible (this means as target platform we need a P2 repo)
> 2. it's equinox-based
>
> Tycho has great solutions for this, however we are building both server-side OSGi bundles as well as classical eclipse plugins.
> Since we don't want to start from scratch, we want to be able to consume existing OSGi wrappers for standard libraries.
> Many of these wrappers are built with maven2/felix and
> http://www.sonatype.com/people/2009/04/tycho-implicit-build-target-platform-support-from-maven/
>
> says that the tycho P2 resolver won't "see" bundles built with felix/bnd.
>
> We would like to stick  with tycho only but according to
> http://www.nabble.com/Re%3A-Building-Eclipse-RCP-applications-with-Tycho-p23694678.html
> it seems support for building wrapper bundles is currently quite limited.
>
> After reading http://www.sonatype.com/people/2009/09/maven-handbook-013-minimal-update-print-friendly-pdf/ , esp. "creating a virtual OBR repository", I was hoping to find a similar "creating a virtual P2 repository" which would make OBR or other repo formats transparently available in P2 format which could then be consumed by tycho.
>
> Is something along these lines planned for Nexus Pro?
>
> If not, do you think e.g. an ant script that takes existing wrapper bundles and publishes them using the p2 publisher tasks from eclipse would be an acceptable workaround?
>
> Thanks for your insights and Best Regards
> Jan

Loading...