On Thu, 2017-11-23 at 14:56 -0800, Andreas Schaefer wrote: > Hi Robert > > See my notes inlined: > > > On Nov 22, 2017, at 1:25 AM, Robert Munteanu <[email protected]> > > wrote: > > > > Hi Andreas, > > > > On Tue, 2017-11-21 at 15:42 -0800, Andreas Schaefer wrote: > > > Hi > > > > > > Last and this year I am working on a IntelliJ Plugin to help > > > develop > > > Sling / AEM > > > projects. Since the start I ran into issue with the Sling Tooling > > > IDE > > > code base > > > as the code is geared towards Eclipse and its use of OSGi. > > > Despite > > > several > > > tries to come up with a resolution to create a code base that > > > would > > > work equally > > > all for IntelliJ and Eclipse there was not progress made towards > > > a > > > solution. > > > > Yes, I am aware of that :-( I still don't have a good answer on how > > to > > build AEM and IntelliJ plugins together. If you have examples or > > ideas > > how to do that I'd be happy to work towards that goal. > > > > The idea would be simple: allow plain Maven artifacts to be > > consumed by > > both an IntelliJ Maven build and an Eclipse Maven build. This is > > currently complicated due to the Tycho/p2 implementation which > > requires > > p2 update sites over http. > > There are a few things that I needs to be done: > > 1. Make common code like impl-vlt eclipse agnostic. If you want or > need > an Activator / Logger then we can create an interface and then you > wrap > this in an eclipse module. > > 2. Shared code that interacts with the IDE needs to be written in a > way > that each plugin can extend or delegate it and the common code is > left > in a non-eclipse module. IntelliJ right now uses a class that > contains common > IDE code and its access to the remote server. Then IntelliJ plugin is > extending that class providing the integration with IntelliJ. > > I would be willing to create the same wrapper for Eclipse if someone > can > show where to find the necessary Eclipse code like IServer, IFile etc > and > the implementation of it. I tried to find it but could not find in a > reasonable > amount of time.
I agree with all of those. But first we need a build solution. If we make the code independent from Eclipse and OSGi ( BTW, PojoSR/Felix Connect would be an option I guess for IntelliJ ) then we still have the problem of building the code in the same reactor and reusing code between IntelliJ and Eclipse. We have a way forward for making impl-vlt IntelliJ-compatible, but not for a build solution. So that's point #0 IMO. > > > 2. IntelliJ (and I assume Eclipse) Plugin cannot import resources > > > from Sling / AEM > > > from a Sling Content Bundle > > > > With the same understanding of content bundles, we only support > > content > > packages. That was the pattern we saw most used developing AEM and > > Sling apps, and that is the one we support right now. > > If my content is stored in a SLING-INF folder can I import a resource > from Sling using the plugin? No, not at the moment. Much of the code is written behind APIs and it would not be a moderate-size effort to add support for another implementation that works with the content loader format and allow multiple implementations to coexist at runtime. > > > > > > > > > 3. IntelliJ and Sling (AFAIK) do not support OSGi bundle > > > deployment > > > as part of a > > > JCR Package which can lead to problems with OSGi bundles in Sling > > > (not sure about > > > AEM). This is an general issue with embedded bundles when they > > > are > > > deployed > > > both as embedded and standalone archive. > > > > I'm curious, why would you want to deploy an OSGi bundle when > > working > > on a content package? I would rather configure them as bundle > > modules > > and allow deployment to work independently of content packages. > > > > Is it only because the bundle is deployed by both the JCR installer > > and > > then also via the Web Console? If so, I'd like to hear some > > examples of > > what goes wrong, to see if we can fix them or work around them. > > Having my bundles embedded inside a Content Package is to make sure > that both are in sync. For example if I updated my page (resource) as > well > as the Sling Model it uses then I can deploy it together. > > I installed Eclipse Oxygen, the latest from Sling (Git) and started > it. Then > I took a sling project that has a core (OSGi bundle) and an ui.apps > that > has the core embedded but also contains resources. When I deploy this > manually (via Maven) then any updates to the core bundle will not be > taken effect in Sling until I deploy it again from Maven. > > This is AFAIK due to the fact that the bundle from the package > overrides > any deployments directly to the OSGi container and this is also a > problem > if someone deploys the bundle manually or through bundle deployment > tool after a JCR package with that bundle is deployed. Deployments through the OSGi console should work, even if the bundle was previously deployed via the JCR installer. But I'm not sure what exact steps you took. AFAIU you: - deployed the content package via Maven - made some changes to the ui.apps project - made some changes to the core project And then saw that the changes to the core project are not reflected? If that is the case, it's a bug so please report it, ideally with a minimal project to help reproduce. > A plugin should be able to deploy the bundle as part of the package > fr;om within the plugin if embedded bundles are supported in Sling. That's a feature request, so also feel free to file it, but please note that it requires more discussion. For instance, it's not possible to make the deployment atomic. Also, should we also deploy embedded bundles that are not resolved in the workspace? Thanks, Robert
