Porject structure and building system changes?

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

Porject structure and building system changes?

Daniel Dekany
1. Project structure under "src"
--------------------------------

I think the project structure of FM should be revisited... The main
problem is that we have src/freemarker, which *directly* corresponds
to the freemarker package. Thus you can't just add src to the
class-path, as then you will have the src/manual and that src/META-INF
etc in your class path. This odd structure can cause a lot of
hard-to-solve or practically unsolvable problems.

So... I recommend switching to a Maven-ist structure:

src
  main
    java
      freemarker <-- This is the freemarker *package* itself
        ...
    freecc
        FM.freecc
    resources
      META-INF
        ...
      freemarker
        ...
  test
    java
      ...
    resources
      ...
  manual
    ...

We can also use a hibrid-structure where instead of "java" and
"resources" we have "java-and-resources".


2. freemarker.jar must be a proper OSGi bundle
----------------------------------------------

... because your building process has never convoluted enough!

That's can be more "fun" for than it sounds... unless of curse the
stuff we always a bundle before everything. Anyway, I hope bnd
(http://www.aqute.biz/Code/Bnd#ant) can take care of it all. That
means I would use the "bnd" Ant-task instead of "jar" Ant task. (Ivy
can "install" bnd it automatically...)


3. This all should be backported to 2.3.x/2.4.x
-----------------------------------------------

But AFAIR we have some unresolved issues around the JSP versions in
3.0, and that should be fixed first. Attila, dig up my old mail about
that sometimes.

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
Wednesday, July 7, 2010, 4:05:35 PM, Daniel Dekany wrote:

[snip]

> 2. freemarker.jar must be a proper OSGi bundle
> ----------------------------------------------
>
> ... because your building process in never convoluted enough!
>
> That can be more "fun" than it sounds... unless of curse the stuff
> we always a bundle before everything. Anyway, I hope bnd
> (http://www.aqute.biz/Code/Bnd#ant) can take care of it all. That
> means I would use the "bnd" Ant-task instead of "jar" Ant task. (Ivy
> can "install" bnd it automatically...)

I just went ahead and did this part in the trunk (FreeMarker 3).

Angelo, I wonder how it helps the Eclipse plugins, after all Eclipse
runs on Equinox, so installing + starting the raw freemarker.jar
bundle on it should be enough to make it available for all the other
bundles. However I guess Eclipse interferes by requiring some fancy
installation... tell me if I can make that easier in freemarker.jar.

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
2010/7/7 Daniel Dekany <[hidden email]>:

> Wednesday, July 7, 2010, 4:05:35 PM, Daniel Dekany wrote:
>
> [snip]
>> 2. freemarker.jar must be a proper OSGi bundle
>> ----------------------------------------------
>>
>> ... because your building process in never convoluted enough!
>>
>> That can be more "fun" than it sounds... unless of curse the stuff
>> we always a bundle before everything. Anyway, I hope bnd
>> (http://www.aqute.biz/Code/Bnd#ant) can take care of it all. That
>> means I would use the "bnd" Ant-task instead of "jar" Ant task. (Ivy
>> can "install" bnd it automatically...)
>
> I just went ahead and did this part in the trunk (FreeMarker 3).
>
> Angelo, I wonder how it helps the Eclipse plugins, after all Eclipse
> runs on Equinox, so installing + starting the raw freemarker.jar
> bundle on it should be enough to make it available for all the other
> bundles. However I guess Eclipse interferes by requiring some fancy
> installation... tell me if I can make that easier in freemarker.jar.

Ok I will try to explain how use Freemarker JAR (or another JAR)  into
Eclipse Plugin :

1. Add your JAR into plugin ClassPath. It's your plugin wich contains
the JAR. It's the solution used by JBoss Freemarker plugin. problem
with thos solution is that your plugin is linked to the Freemarker
JAR.

2. Use OSGi Import package (see MANIFEST.MF) to import needed
Freemarker package. If you see teh
org.eclipse.dltk.freemarker.coreplugin, it use FMParser. This plugin
doesn't contaisn the Freemarker Jar. The dependency is managed with
MANIFEST.MF :

---------------
Import-Package: freemarker.core,
 freemarker.core.ast,
 freemarker.core.parser,
 freemarker.provisionnal.template,
 freemarker.template
---------------

To do that, the Freemarker JAR must be a bundle. The best way is that
the FReemarker JAR is an OSGi bundle. To do that, teh FReemarker JAR
must contains a MANIFEST.MF like ethis :

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Freemarker
Bundle-SymbolicName: org.freemarker
Bundle-Version: 2.3.98
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: freemarker.cache,
 freemarker.core,
 freemarker.core.ast,
 freemarker.core.builtins,
 freemarker.core.helpers,
 freemarker.core.ooparam,
 freemarker.core.parser,
 freemarker.debug,
 freemarker.debug.impl,
 freemarker.ext.ant,
 freemarker.ext.beans,
 freemarker.ext.dom,
 freemarker.ext.jruby,
 freemarker.ext.jsp,
 freemarker.ext.jython,
 freemarker.ext.rhino,
 freemarker.ext.script,
 freemarker.ext.servlet,
 freemarker.ext.util,
 freemarker.log,
 freemarker.template,
 freemarker.template.utility

But in our case, Freemarke rJAR is not an OSGi bundle, so I have
create a plugin Eclipse org.freemarker wich contains the JAR and wich
export the Freemarker packages.

In my case I have done that because several plugins use Freemarker API
(I wanted add Freemarker JAR into each plugins). So I have created
org.freemarker wich is Freemarker OSGi bundle and which export
Freemarker packages. Plugins which use Freemarker API, import the
Freemarker packages.

Hope my explanation will help you.

Regards Angelo

>
> --
> Best regards,
>  Daniel Dekany
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
Wednesday, July 7, 2010, 9:11:29 PM, Angelo zerr wrote:

> 2010/7/7 Daniel Dekany <[hidden email]>:
>> Wednesday, July 7, 2010, 4:05:35 PM, Daniel Dekany wrote:
>>
>> [snip]
>>> 2. freemarker.jar must be a proper OSGi bundle
>>> ----------------------------------------------
>>>
>>> ... because your building process in never convoluted enough!
>>>
>>> That can be more "fun" than it sounds... unless of curse the stuff
>>> we always a bundle before everything. Anyway, I hope bnd
>>> (http://www.aqute.biz/Code/Bnd#ant) can take care of it all. That
>>> means I would use the "bnd" Ant-task instead of "jar" Ant task. (Ivy
>>> can "install" bnd it automatically...)
>>
>> I just went ahead and did this part in the trunk (FreeMarker 3).
>>
>> Angelo, I wonder how it helps the Eclipse plugins, after all Eclipse
>> runs on Equinox, so installing + starting the raw freemarker.jar
>> bundle on it should be enough to make it available for all the other
>> bundles. However I guess Eclipse interferes by requiring some fancy
>> installation... tell me if I can make that easier in freemarker.jar.
>
> Ok I will try to explain how use Freemarker JAR (or another JAR)  into
> Eclipse Plugin :
>
> 1. Add your JAR into plugin ClassPath. It's your plugin wich contains
> the JAR. It's the solution used by JBoss Freemarker plugin. problem
> with thos solution is that your plugin is linked to the Freemarker
> JAR.
>
> 2. Use OSGi Import package (see MANIFEST.MF) to import needed
> Freemarker package. If you see teh
> org.eclipse.dltk.freemarker.coreplugin, it use FMParser. This plugin
> doesn't contaisn the Freemarker Jar. The dependency is managed with
> MANIFEST.MF :
[snip]

Sorry, you misunderstand the situation and the question. As I said, I
already have made freemarker.jar to be an OSGi bundle earlier today.
(Symbolic-name is org.freemarker.freemarker, version is
3.0.0.pre1mod). While this is all an OSGi framework implementation
like Equinox needs, I suppose Eclipse needs something more for
convenient installation. So I asked if what do *you* and other Eclipse
plug-in authors need to make this thing as painless as possible, if
that's possible in the jar (or in the distro) at all.

> Regards Angelo

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
> Sorry, you misunderstand the situation and the question.
oopps sorry -(

> As I said, I
> already have made freemarker.jar to be an OSGi bundle earlier today.
> (Symbolic-name is org.freemarker.freemarker, version is
> 3.0.0.pre1mod).
Cool:)
> While this is all an OSGi framework implementation
> like Equinox needs, I suppose Eclipse needs something more for
> convenient installation.
Do you mean Eclipse Update Site (Install New Software...)? I think you
need not to create an Update Site. User can copy/paste the Freemarker
JAR bundle into plugins directory and that's all. But teh clean
solution is to create an Update site (PDE give you the capability to
create Update Site wich is another project). The Update Site give the
capability to install Freemarker bundle into plugins directory and
check the Freemarker dependencies (ex : Rhino...which must be too OSGi
bundles).

> So I asked if what do *you* and other Eclipse
> plug-in authors need to make this thing as painless as possible, if
> that's possible in the jar (or in the distro) at all.

I think if Update Site exists, it should be cool. I think I could
reference your Upodate Site in my Update Site to install Freemarker
OSGi bundle before.

>
>> Regards Angelo
>
> --
> Best regards,
>  Daniel Dekany
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
Wednesday, July 7, 2010, 10:29:12 PM, Angelo zerr wrote:

>> Sorry, you misunderstand the situation and the question.
> oopps sorry -(
>
>> As I said, I
>> already have made freemarker.jar to be an OSGi bundle earlier today.
>> (Symbolic-name is org.freemarker.freemarker, version is
>> 3.0.0.pre1mod).
> Cool:)

BTW, before anyone runs into this... after SVN update, you need to run

  ant update-deps

once, or else bnd.jar will be missing.

>> While this is all an OSGi framework implementation
>> like Equinox needs, I suppose Eclipse needs something more for
>> convenient installation.
> Do you mean Eclipse Update Site (Install New Software...)?

I think... yes.

> I think you need not to create an Update Site. User can copy/paste
> the Freemarker JAR bundle into plugins directory and that's all.

Indeed, that worked.

> But teh clean solution is to create an Update site (PDE give you the
> capability to create Update Site wich is another project). The
> Update Site give the capability to install Freemarker bundle into
> plugins directory and check the Freemarker dependencies (ex :
> Rhino...which must be too OSGi bundles).
>
>> So I asked if what do *you* and other Eclipse
>> plug-in authors need to make this thing as painless as possible, if
>> that's possible in the jar (or in the distro) at all.
>
> I think if Update Site exists, it should be cool. I think I could
> reference your Upodate Site in my Update Site to install Freemarker
> OSGi bundle before.

So, it seems all we need then is an update site on freemarker.org that
will simply provide the now OSGi-bundle freemarker.jar, and that's it.
Great. I think I will figure that out tomorrow, assuming it's not
rocket science. Or if you have practice in this, you are more than
welcome do provide the necessary Ant snippet. Well, assuming you
signed the CLA already. /-:

>>> Regards Angelo
>>
>> --
>> Best regards,
>>  Daniel Dekany

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
>
> BTW, before anyone runs into this... after SVN update, you need to run
>
>  ant update-deps

Ok.

>
>> I think you need not to create an Update Site. User can copy/paste
>> the Freemarker JAR bundle into plugins directory and that's all.
>
> Indeed, that worked.
>>
> So, it seems all we need then is an update site on freemarker.org that
> will simply provide the now OSGi-bundle freemarker.jar, and that's it.
> Great. I think I will figure that out tomorrow, assuming it's not
> rocket science. Or if you have practice in this, you are more than
> welcome do provide the necessary Ant snippet. Well, assuming you
> signed the CLA already. /-:

I have never done that with Ant. I have created a long time an Update
Site for Akroegn but with PDE. I remember that I had a lot difficult
to create an Update Site which works with SourceForge.

Sorry I have not signed my CLA. I must do that!

>
>>>> Regards Angelo
>>>
>>> --
>>> Best regards,
>>>  Daniel Dekany
>
> --
> Best regards,
>  Daniel Dekany
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
Hi Daniel,

I have rebuilt the Freemarker JAR from the trunk and I have copy/paste
JAR+MANIFEST.MF (from the JAR) in my org.freemarker plugin (which wrap
the Freemarker JAR). It works but I have some comments about
MANIFEST.MF :

1. Bundle-Name: org.freemarker.freemarker
There is 2 freemarker. What do you think about "org.freemarker.osgi"
or "freemarker.osgi" ?

2. Bundle-Vendor doesn't exist.
Ex : Bundle-Vendor: Freemarker

3. freemarker packages are present in the import packages. I think,
there is not sense to have that.

Regards Angelo

2010/7/8 Angelo zerr <[hidden email]>:

>>
>> BTW, before anyone runs into this... after SVN update, you need to run
>>
>>  ant update-deps
>
> Ok.
>
>>
>>> I think you need not to create an Update Site. User can copy/paste
>>> the Freemarker JAR bundle into plugins directory and that's all.
>>
>> Indeed, that worked.
>>>
>> So, it seems all we need then is an update site on freemarker.org that
>> will simply provide the now OSGi-bundle freemarker.jar, and that's it.
>> Great. I think I will figure that out tomorrow, assuming it's not
>> rocket science. Or if you have practice in this, you are more than
>> welcome do provide the necessary Ant snippet. Well, assuming you
>> signed the CLA already. /-:
>
> I have never done that with Ant. I have created a long time an Update
> Site for Akroegn but with PDE. I remember that I had a lot difficult
> to create an Update Site which works with SourceForge.
>
> Sorry I have not signed my CLA. I must do that!
>
>>
>>>>> Regards Angelo
>>>>
>>>> --
>>>> Best regards,
>>>>  Daniel Dekany
>>
>> --
>> Best regards,
>>  Daniel Dekany
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Guo Du-4
On Thu, Jul 8, 2010 at 2:02 PM, Angelo zerr <[hidden email]> wrote:
> 1. Bundle-Name: org.freemarker.freemarker
> There is 2 freemarker. What do you think about "org.freemarker.osgi"
> or "freemarker.osgi" ?
We'd better to keep org.freemarker as prefix where possible as you can
see most of bundles follow this practice.

What about org.freemarker.core? It leave space for extension bundles as well.

> 3. freemarker packages are present in the import packages. I think,
> there is not sense to have that.


I didn't see the Import-Package header contain dependencies. As FM
template may dynamically load other classes, I want to know any one
has concern to have header "DynamicImport-Package: *
".

-Guo

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
Hi Guo,

2010/7/8 Guo Du <[hidden email]>:
> On Thu, Jul 8, 2010 at 2:02 PM, Angelo zerr <[hidden email]> wrote:
>> 1. Bundle-Name: org.freemarker.freemarker
>> There is 2 freemarker. What do you think about "org.freemarker.osgi"
>> or "freemarker.osgi" ?
> We'd better to keep org.freemarker as prefix where possible as you can
> see most of bundles follow this practice.
>
> What about org.freemarker.core? It leave space for extension bundles as well.

Yes, I like this name.

>
>> 3. freemarker packages are present in the import packages. I think,
>> there is not sense to have that.
>
>
> I didn't see the Import-Package header contain dependencies.

Here a copy/paste of teh MANIFEST.MF after generation of teh Freemarker JAR :

----------------
Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
 onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
 rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
 marker.cache,freemarker.core,freemarker.core.ast,freemarker.core.buil
 tins,freemarker.core.helpers,freemarker.core.ooparam,freemarker.core.
 parser,freemarker.debug,freemarker.debug.impl,freemarker.ext.ant,free
 marker.ext.beans,freemarker.ext.dom,freemarker.ext.jruby
....
----------------
As you can see, you have freemarker,freemarker.cache ...packages
There is no sense to have this import packages.

>As FM
> template may dynamically load other classes, I want to know any one
> has concern to have header "DynamicImport-Package: *
> ".
>

Do you think DynamicImport-Package is required? Sorry I don't
understand your comment.

> -Guo
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Guo Du-4
On Thu, Jul 8, 2010 at 4:05 PM, Angelo zerr <[hidden email]> wrote:

> Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
>  onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
>  rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
Not sure why have those dependencies, it may run into the same problem
as swing dependency.

>  parser,freemarker.debug,freemarker.debug.impl,freemarker.ext.ant,free
>  marker.ext.beans,freemarker.ext.dom,freemarker.ext.jruby
> Do you think DynamicImport-Package is required? Sorry I don't
> understand your comment.
>From the existing dependency you may see that it has some third party
dependencies such as jruby. OSGi will fail to load those classes as
it's not imported. To solve this, we could add as optional import, but
there are other third party class may need by the freemarker new
syntax. Without the DynamicImport-Package headers, user has to change
the org.freemarker.core jar headers.

-Guo

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
>> Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
>>  onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
>>  rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
> Not sure why have those dependencies, it may run into the same problem
> as swing dependency.

I don't speak about "com.sun.org.apache.xml.internal.utils" packages
but about "freemarker",  "freemarker.cache" ... packages. Thoses
packages must be exported but not imported.


>> Do you think DynamicImport-Package is required? Sorry I don't
>> understand your comment.
> >From the existing dependency you may see that it has some third party
> dependencies such as jruby. OSGi will fail to load those classes as
> it's not imported. To solve this, we could add as optional import, but
> there are other third party class may need by the freemarker new
> syntax. Without the DynamicImport-Package headers, user has to change
> the org.freemarker.core jar headers.

Are you sure DynamicImport-Package is a clean solution? User can
create an OSGi fragment linked to the Freemarker bundle and add new
packages into this fragment like jruby.No?

>
> -Guo
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
In reply to this post by angelozerr
Thursday, July 8, 2010, 3:02:09 PM, Angelo zerr wrote:

> Hi Daniel,
>
> I have rebuilt the Freemarker JAR from the trunk and I have copy/paste
> JAR+MANIFEST.MF (from the JAR) in my org.freemarker plugin (which wrap
> the Freemarker JAR). It works but I have some comments about
> MANIFEST.MF :
>
> 1. Bundle-Name: org.freemarker.freemarker
> There is 2 freemarker. What do you think about "org.freemarker.osgi"
> or "freemarker.osgi" ?

The format I follow here is:

  groupId '.' artifactId

This is the de-facto standard of naming stuff, also it's pretty much
required by Maven and Ivy. Surely OSGi allows me to deviate from this,
but that can cause complications in the other systems which require
these two "coordinates" and then possibly try to deduce the bundle
symbolic name from that.

I admit that the result looks strange... but our domain is
freemarker.org and the artifact is obviously called "freemarker" (and
surely not "osgi"; just think about the MAVEN artifact name), so I
don't think I can do much about it.

> 2. Bundle-Vendor doesn't exist.
> Ex : Bundle-Vendor: Freemarker

Hm... what needs that? But right, I added it with value
"freemarker.org". (No guys, I don't want to point to VSS...)

> 3. freemarker packages are present in the import packages. I think,
> there is not sense to have that.

That's done deliberately by bnd; it's an OSGi "best practice".
However, now that you mention this, it's highly unhealthy in the case
of FM, given the packages work together too tightly, so I really don't
want the OSGi framework to mix packages from different FreeMarker
releases. So, I removed the imports. Also, I versioned all the
freemarker.* packages... with the bundle version. Ugh. I guess OSGi
evangelists start pulling their own hair out, but until someone
convicts me that it can be reliable and maintainable anyhow else, I
will have to do this...

> Regards Angelo
>
> 2010/7/8 Angelo zerr <[hidden email]>:
>>>
>>> BTW, before anyone runs into this... after SVN update, you need to run
>>>
>>>  ant update-deps
>>
>> Ok.
>>
>>>
>>>> I think you need not to create an Update Site. User can copy/paste
>>>> the Freemarker JAR bundle into plugins directory and that's all.
>>>
>>> Indeed, that worked.
>>>>
>>> So, it seems all we need then is an update site on freemarker.org that
>>> will simply provide the now OSGi-bundle freemarker.jar, and that's it.
>>> Great. I think I will figure that out tomorrow, assuming it's not
>>> rocket science. Or if you have practice in this, you are more than
>>> welcome do provide the necessary Ant snippet. Well, assuming you
>>> signed the CLA already. /-:
>>
>> I have never done that with Ant. I have created a long time an Update
>> Site for Akroegn but with PDE. I remember that I had a lot difficult
>> to create an Update Site which works with SourceForge.
>>
>> Sorry I have not signed my CLA. I must do that!
>>
>>>
>>>>>> Regards Angelo
>>>>>
>>>>> --
>>>>> Best regards,
>>>>>  Daniel Dekany
>>>
>>> --
>>> Best regards,
>>>  Daniel Dekany

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
In reply to this post by Guo Du-4
Thursday, July 8, 2010, 4:14:00 PM, Guo Du wrote:

> On Thu, Jul 8, 2010 at 2:02 PM, Angelo zerr <[hidden email]> wrote:
>> 1. Bundle-Name: org.freemarker.freemarker
>> There is 2 freemarker. What do you think about "org.freemarker.osgi"
>> or "freemarker.osgi" ?
> We'd better to keep org.freemarker as prefix where possible as you can
> see most of bundles follow this practice.

It is and always was org.freemarker. I just said out Internet domain
is freemarker.org.

> What about org.freemarker.core? It leave space for extension bundles as well.
>
>> 3. freemarker packages are present in the import packages. I think,
>> there is not sense to have that.
>
>
> I didn't see the Import-Package header contain dependencies. As FM
> template may dynamically load other classes, I want to know any one
> has concern to have header "DynamicImport-Package: *
> ".
>
> -Guo
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
In reply to this post by Guo Du-4
Thursday, July 8, 2010, 5:54:27 PM, Guo Du wrote:

> On Thu, Jul 8, 2010 at 4:05 PM, Angelo zerr <[hidden email]> wrote:
>
>> Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
>>  onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
>>  rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
> Not sure why have those dependencies, it may run into the same problem
> as swing dependency.
[snip]

These are *optional* dependencies. Means, if they are available, they
will be visible for FreeMarker, otherwise they just won't be.

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
In reply to this post by angelozerr
Thursday, July 8, 2010, 5:05:18 PM, Angelo zerr wrote:

> Hi Guo,
>
> 2010/7/8 Guo Du <[hidden email]>:
>> On Thu, Jul 8, 2010 at 2:02 PM, Angelo zerr <[hidden email]> wrote:
>>> 1. Bundle-Name: org.freemarker.freemarker
>>> There is 2 freemarker. What do you think about "org.freemarker.osgi"
>>> or "freemarker.osgi" ?
>> We'd better to keep org.freemarker as prefix where possible as you can
>> see most of bundles follow this practice.
>>
>> What about org.freemarker.core? It leave space for extension bundles as well.
>
> Yes, I like this name.

We already use this for Maven (since 2.3.x):

<dependency>
  <groupId>org.freemarker</groupId>
  <artifactId>freemarker</artifactId>
  <version>...</version>
</dependency>

And I would find the artifact name be "core" a bit odd...

>>
>>> 3. freemarker packages are present in the import packages. I think,
>>> there is not sense to have that.
>>
>>
>> I didn't see the Import-Package header contain dependencies.
>
> Here a copy/paste of teh MANIFEST.MF after generation of teh Freemarker JAR :
>
> ----------------
> Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
>  onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
>  rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
>  marker.cache,freemarker.core,freemarker.core.ast,freemarker.core.buil
>  tins,freemarker.core.helpers,freemarker.core.ooparam,freemarker.core.
>  parser,freemarker.debug,freemarker.debug.impl,freemarker.ext.ant,free
>  marker.ext.beans,freemarker.ext.dom,freemarker.ext.jruby
> ....
> ----------------
> As you can see, you have freemarker,freemarker.cache ...packages
> There is no sense to have this import packages.
>
>>As FM
>> template may dynamically load other classes, I want to know any one
>> has concern to have header "DynamicImport-Package: *
>> ".
>>
>
> Do you think DynamicImport-Package is required? Sorry I don't
> understand your comment.
>> -Guo
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

angelozerr
Hi Daniel,

I think it's interesting to see
http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.freemarker&version=2.3.15&searchType=bundlesByName&searchQuery=freemarker

It's OSGFied Freemarker JAR that you can find in the Spring
Repository. You can download the JAR and see the MANIFEST.MF.


Bundle Vendor is not required but I suggest you to edit the
MANIFEST.MF with PDE.Eclipse (Open With ->Other...Plugin Manifest
Editor).

You will see in the Overview Page some informations wich miss liek :

* Provider . Ex :
Bundle-Vendor: Freemarker Team
* Execution Environment. Ex :
 Bundle-RequiredExecutionEnvironment: J2SE-1.5


Here the content of OSGi (Spring) Freemarker MANIFEST (No Dynamic
Packages is added, I think Fragment OSGi can help user to add another
librarires):
-----------------------
Manifest-Version: 1.0
Export-Package: freemarker.cache;version="2.3.15";uses:="freemarker.co
 re,freemarker.template,javax.servlet",freemarker.core;version="2.3.15
 ";uses:="freemarker.template,javax.swing.tree",freemarker.debug;versi
 on="2.3.15";uses:="freemarker.template",freemarker.debug.impl;version
 ="2.3.15";uses:="freemarker.core,freemarker.debug,freemarker.log,free
 marker.template",freemarker.ext.ant;version="2.3.15";uses:="freemarke
 r.template,org.apache.tools.ant",freemarker.ext.beans;version="2.3.15
 ";uses:="freemarker.ext.util,freemarker.template",freemarker.ext.dom;
 version="2.3.15";uses:="freemarker.core,freemarker.template,javax.xml
 .parsers,org.jaxen,org.w3c.dom,org.xml.sax",freemarker.ext.jdom;versi
 on="2.3.15";uses:="freemarker.template,org.jaxen,org.jdom",freemarker
 .ext.jsp;version="2.3.15";uses:="freemarker.core,freemarker.log,freem
 arker.template,javax.el,javax.servlet,javax.servlet.http,javax.servle
 t.jsp,javax.servlet.jsp.el,javax.servlet.jsp.tagext,javax.xml.parsers
 ,org.xml.sax,org.xml.sax.helpers",freemarker.ext.jython;version="2.3.
 15";uses:="freemarker.template,org.python.core",freemarker.ext.rhino;
 version="2.3.15";uses:="freemarker.ext.beans,freemarker.ext.util,free
 marker.template,org.mozilla.javascript",freemarker.ext.servlet;versio
 n="2.3.15";uses:="freemarker.cache,freemarker.core,freemarker.templat
 e,javax.servlet,javax.servlet.http",freemarker.ext.util;version="2.3.
 15";uses:="freemarker.template",freemarker.ext.xml;version="2.3.15";u
 ses:="freemarker.template,org.jaxen",freemarker.log;version="2.3.15";
 uses:="org.apache.log,org.apache.log4j",freemarker.template;version="
 2.3.15";uses:="freemarker.cache,freemarker.core,javax.swing.tree",fre
 emarker.template.utility;version="2.3.15";uses:="freemarker.core,free
 marker.template,org.python.core,org.w3c.dom"
Implementation-Title: VSS Java FreeMarker
Implementation-Version: 2.3.15
Bundle-Classpath: .
Specification-Vendor: Visigoth Software Society
Bundle-Name: Freemarker Templating Engine
Created-By: 11.0-b15 (Sun Microsystems Inc.)
Ant-Version: Apache Ant 1.6.5
Implementation-Vendor: Visigoth Software Society
Bundle-Vendor: SpringSource
Bundle-Version: 2.3.15
Specification-Title: FreeMarker
Bundle-ManifestVersion: 2
Import-Package: javax.el;version="[1.0.0, 2.0.0)";resolution:=optional
 ,javax.servlet;version="[2.5.0, 3.0.0)";resolution:=optional,javax.se
 rvlet.http;version="[2.5.0, 3.0.0)";resolution:=optional,javax.servle
 t.jsp;version="[2.1.0, 3.0.0)";resolution:=optional,javax.servlet.jsp
 .el;version="[2.1.0, 3.0.0)";resolution:=optional,javax.servlet.jsp.t
 agext;version="[2.1.0, 3.0.0)";resolution:=optional,javax.swing;versi
 on="0",javax.swing.tree;version="0",javax.xml.parsers;version="0",jav
 ax.xml.transform;version="0",org.apache.log;version="[1.0.1, 1.0.1]";
 resolution:=optional,org.apache.log4j;version="[1.2.15, 2.0.0)";resol
 ution:=optional,org.apache.tools.ant;version="[1.7.0, 2.0.0)";resolut
 ion:=optional,org.apache.tools.ant.taskdefs;version="[1.7.0, 2.0.0)";
 resolution:=optional,org.apache.xml.utils;version="[2.7.0, 3.0.0)";re
 solution:=optional,org.apache.xpath;version="[2.7.0, 3.0.0)";resoluti
 on:=optional,org.apache.xpath.objects;version="[2.7.0, 3.0.0)";resolu
 tion:=optional,org.dom4j;version="[1.6.1, 2.0.0)";resolution:=optiona
 l,org.dom4j.tree;version="[1.6.1, 2.0.0)";resolution:=optional,org.ja
 xen;version="[1.1.1, 2.0.0)";resolution:=optional,org.jaxen.dom;versi
 on="[1.1.1, 2.0.0)";resolution:=optional,org.jaxen.dom4j;version="[1.
 1.1, 2.0.0)";resolution:=optional,org.jaxen.jdom;version="[1.1.1, 2.0
 .0)";resolution:=optional,org.jdom;version="[1.0.0, 2.0.0)";resolutio
 n:=optional,org.jdom.input;version="[1.0.0, 2.0.0)";resolution:=optio
 nal,org.jdom.output;version="[1.0.0, 2.0.0)";resolution:=optional,org
 .mozilla.javascript;version="0";resolution:=optional,org.python.core;
 version="[2.2.1, 2.3.0)";resolution:=optional,org.python.util;version
 ="[2.2.1, 2.3.0)";resolution:=optional,org.w3c.dom;version="0",org.xm
 l.sax;version="0",org.xml.sax.helpers;version="0",org.zeroturnaround.
 javarebel;version="0";resolution:=optional
Specification-Version: 2.3.15
Bundle-SymbolicName: com.springsource.freemarker
Main-Class: freemarker.core.CommandLine
Extension-name: FreeMarker
-----------------------
2010/7/8 Daniel Dekany <[hidden email]>:

> Thursday, July 8, 2010, 5:05:18 PM, Angelo zerr wrote:
>
>> Hi Guo,
>>
>> 2010/7/8 Guo Du <[hidden email]>:
>>> On Thu, Jul 8, 2010 at 2:02 PM, Angelo zerr <[hidden email]> wrote:
>>>> 1. Bundle-Name: org.freemarker.freemarker
>>>> There is 2 freemarker. What do you think about "org.freemarker.osgi"
>>>> or "freemarker.osgi" ?
>>> We'd better to keep org.freemarker as prefix where possible as you can
>>> see most of bundles follow this practice.
>>>
>>> What about org.freemarker.core? It leave space for extension bundles as well.
>>
>> Yes, I like this name.
>
> We already use this for Maven (since 2.3.x):
>
> <dependency>
>  <groupId>org.freemarker</groupId>
>  <artifactId>freemarker</artifactId>
>  <version>...</version>
> </dependency>
>
> And I would find the artifact name be "core" a bit odd...
>
>>>
>>>> 3. freemarker packages are present in the import packages. I think,
>>>> there is not sense to have that.
>>>
>>>
>>> I didn't see the Import-Package header contain dependencies.
>>
>> Here a copy/paste of teh MANIFEST.MF after generation of teh Freemarker JAR :
>>
>> ----------------
>> Import-Package: com.sun.org.apache.xml.internal.utils;resolution:=opti
>>  onal,com.sun.org.apache.xpath.internal;resolution:=optional,com.sun.o
>>  rg.apache.xpath.internal.objects;resolution:=optional,freemarker,free
>>  marker.cache,freemarker.core,freemarker.core.ast,freemarker.core.buil
>>  tins,freemarker.core.helpers,freemarker.core.ooparam,freemarker.core.
>>  parser,freemarker.debug,freemarker.debug.impl,freemarker.ext.ant,free
>>  marker.ext.beans,freemarker.ext.dom,freemarker.ext.jruby
>> ....
>> ----------------
>> As you can see, you have freemarker,freemarker.cache ...packages
>> There is no sense to have this import packages.
>>
>>>As FM
>>> template may dynamically load other classes, I want to know any one
>>> has concern to have header "DynamicImport-Package: *
>>> ".
>>>
>>
>> Do you think DynamicImport-Package is required? Sorry I don't
>> understand your comment.
>>> -Guo
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>> _______________________________________________
>>> FreeMarker-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>
> --
> Best regards,
>  Daniel Dekany
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
Thursday, July 8, 2010, 9:45:05 PM, Angelo zerr wrote:

> Hi Daniel,
>
> I think it's interesting to see
> http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.freemarker&version=2.3.15&searchType=bundlesByName&searchQuery=freemarker
>
> It's OSGFied Freemarker JAR that you can find in the Spring
> Repository. You can download the JAR and see the MANIFEST.MF.
>
>
> Bundle Vendor is not required but I suggest you to edit the
> MANIFEST.MF with PDE.Eclipse (Open With ->Other...Plugin Manifest
> Editor).
>
> You will see in the Overview Page some informations wich miss liek :
>
> * Provider . Ex :
> Bundle-Vendor: Freemarker Team
> * Execution Environment. Ex :
>  Bundle-RequiredExecutionEnvironment: J2SE-1.5

Bundle-RequiredExecutionEnvironment was indeed missing.

> Here the content of OSGi (Spring) Freemarker MANIFEST (No Dynamic
> Packages is added, I think Fragment OSGi can help user to add another
> librarires):

I see they have specified the versions for many imports (even if kind
of incorrectly: they are more restricted than what FM needs). For the
cases where I think it's practically useful I might will do that too.
But this is the point where things start to be real a PITA. Developers
had to ensure that ivy.xml is up-to-date (luckily if it's not, the
build will certainly fail... but only because it basically only
specifies building and test-suite dependencies right now), then that
osgi.bnd is up-to-date... and actually we also have a POM, and the
only reason we don't have to deal with that in this regard is that it
just doesn't list the optional dependencies. Because I'm lazy. :) I
think that in principle we should extend ivy.xml to contain all the
optional runtime dependencies precisely (version ranges), and then
generate the POM and the osgi.bnd from that... And this is the point
where I start to think that maybe I rather should spend my time with
making stuff that actually does something useful for the end-user.
(Not to mention that maintaining all this meta-info require a strict
developer culture.)

> -----------------------
> Manifest-Version: 1.0
> Export-Package: freemarker.cache;version="2.3.15";uses:="freemarker.co
>  re,freemarker.template,javax.servlet",freemarker.core;version="2.3.15
>  ";uses:="freemarker.template,javax.swing.tree",freemarker.debug;versi
>  on="2.3.15";uses:="freemarker.template",freemarker.debug.impl;version
>  ="2.3.15";uses:="freemarker.core,freemarker.debug,freemarker.log,free
>  marker.template",freemarker.ext.ant;version="2.3.15";uses:="freemarke
>  r.template,org.apache.tools.ant",freemarker.ext.beans;version="2.3.15
>  ";uses:="freemarker.ext.util,freemarker.template",freemarker.ext.dom;
>  version="2.3.15";uses:="freemarker.core,freemarker.template,javax.xml
>  .parsers,org.jaxen,org.w3c.dom,org.xml.sax",freemarker.ext.jdom;versi
>  on="2.3.15";uses:="freemarker.template,org.jaxen,org.jdom",freemarker
>  .ext.jsp;version="2.3.15";uses:="freemarker.core,freemarker.log,freem
>  arker.template,javax.el,javax.servlet,javax.servlet.http,javax.servle
>  t.jsp,javax.servlet.jsp.el,javax.servlet.jsp.tagext,javax.xml.parsers
>  ,org.xml.sax,org.xml.sax.helpers",freemarker.ext.jython;version="2.3.
>  15";uses:="freemarker.template,org.python.core",freemarker.ext.rhino;
>  version="2.3.15";uses:="freemarker.ext.beans,freemarker.ext.util,free
>  marker.template,org.mozilla.javascript",freemarker.ext.servlet;versio
>  n="2.3.15";uses:="freemarker.cache,freemarker.core,freemarker.templat
>  e,javax.servlet,javax.servlet.http",freemarker.ext.util;version="2.3.
>  15";uses:="freemarker.template",freemarker.ext.xml;version="2.3.15";u
>  ses:="freemarker.template,org.jaxen",freemarker.log;version="2.3.15";
>  uses:="org.apache.log,org.apache.log4j",freemarker.template;version="
>  2.3.15";uses:="freemarker.cache,freemarker.core,javax.swing.tree",fre
>  emarker.template.utility;version="2.3.15";uses:="freemarker.core,free
>  marker.template,org.python.core,org.w3c.dom"
> Implementation-Title: VSS Java FreeMarker
> Implementation-Version: 2.3.15
> Bundle-Classpath: .
> Specification-Vendor: Visigoth Software Society
> Bundle-Name: Freemarker Templating Engine
> Created-By: 11.0-b15 (Sun Microsystems Inc.)
> Ant-Version: Apache Ant 1.6.5
> Implementation-Vendor: Visigoth Software Society
> Bundle-Vendor: SpringSource
> Bundle-Version: 2.3.15
> Specification-Title: FreeMarker
> Bundle-ManifestVersion: 2
> Import-Package: javax.el;version="[1.0.0, 2.0.0)";resolution:=optional
>  ,javax.servlet;version="[2.5.0, 3.0.0)";resolution:=optional,javax.se
>  rvlet.http;version="[2.5.0, 3.0.0)";resolution:=optional,javax.servle
>  t.jsp;version="[2.1.0, 3.0.0)";resolution:=optional,javax.servlet.jsp
>  .el;version="[2.1.0, 3.0.0)";resolution:=optional,javax.servlet.jsp.t
>  agext;version="[2.1.0, 3.0.0)";resolution:=optional,javax.swing;versi
>  on="0",javax.swing.tree;version="0",javax.xml.parsers;version="0",jav
>  ax.xml.transform;version="0",org.apache.log;version="[1.0.1, 1.0.1]";
>  resolution:=optional,org.apache.log4j;version="[1.2.15, 2.0.0)";resol
>  ution:=optional,org.apache.tools.ant;version="[1.7.0, 2.0.0)";resolut
>  ion:=optional,org.apache.tools.ant.taskdefs;version="[1.7.0, 2.0.0)";
>  resolution:=optional,org.apache.xml.utils;version="[2.7.0, 3.0.0)";re
>  solution:=optional,org.apache.xpath;version="[2.7.0, 3.0.0)";resoluti
>  on:=optional,org.apache.xpath.objects;version="[2.7.0, 3.0.0)";resolu
>  tion:=optional,org.dom4j;version="[1.6.1, 2.0.0)";resolution:=optiona
>  l,org.dom4j.tree;version="[1.6.1, 2.0.0)";resolution:=optional,org.ja
>  xen;version="[1.1.1, 2.0.0)";resolution:=optional,org.jaxen.dom;versi
>  on="[1.1.1, 2.0.0)";resolution:=optional,org.jaxen.dom4j;version="[1.
>  1.1, 2.0.0)";resolution:=optional,org.jaxen.jdom;version="[1.1.1, 2.0
>  .0)";resolution:=optional,org.jdom;version="[1.0.0, 2.0.0)";resolutio
>  n:=optional,org.jdom.input;version="[1.0.0, 2.0.0)";resolution:=optio
>  nal,org.jdom.output;version="[1.0.0, 2.0.0)";resolution:=optional,org
>  .mozilla.javascript;version="0";resolution:=optional,org.python.core;
>  version="[2.2.1, 2.3.0)";resolution:=optional,org.python.util;version
>  ="[2.2.1, 2.3.0)";resolution:=optional,org.w3c.dom;version="0",org.xm
>  l.sax;version="0",org.xml.sax.helpers;version="0",org.zeroturnaround.
>  javarebel;version="0";resolution:=optional
> Specification-Version: 2.3.15
> Bundle-SymbolicName: com.springsource.freemarker
> Main-Class: freemarker.core.CommandLine
> Extension-name: FreeMarker
> -----------------------
[snip]

--
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Guo Du-4
In reply to this post by angelozerr
On Thu, Jul 8, 2010 at 6:15 PM, Angelo zerr <[hidden email]> wrote:
> Are you sure DynamicImport-Package is a clean solution? User can
No, it's against OSGi and have no control on which version will be imported.

Template/script engine requirement is very different to service
oriented OSGi environment. JRUBY and GROOVY has this discussion as
well:
http://jira.codehaus.org/browse/JRUBY-3792
http://jira.codehaus.org/browse/GROOVY-3192

> create an OSGi fragment linked to the Freemarker bundle and add new
> packages into this fragment like jruby.No?
Fragment is the OSGi way to solve the problem partially only if you
know the packages you want to use in template. After freemarker bundle
started, you have cannot access none imported package without
DynamicImport.

DynamicImport-Package give the max flexibility, there is no harm if
user doesn't access the packages. User may use Fragment to lock down
to particular version if there are multiple package version available.

I am not sure we can set the classloader for the new operation inside
template. If yes, then we may leave the problem to freemarker consumer
class to setup correct classloader like groovy does.

-Guo

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: Porject structure and building system changes?

Daniel Dekany
I have added "DynamicImport-Package: *" to the bnd now. While FTL is
not a script language like Python and Rubby in that it usually doesn't
import java packages, I have realized that there is still a
not-so-rare case where it does it: "apackage.AClass"?new. Now, if the
thread's context class loader finds apackage.AClass, then it work
without DynamicImport, but I don't think many will fiddle with the
context class-loader in the real-life.

--
Best regards,
 Daniel Dekany


Friday, July 9, 2010, 12:40:13 AM, Guo Du wrote:

> On Thu, Jul 8, 2010 at 6:15 PM, Angelo zerr <[hidden email]> wrote:
>> Are you sure DynamicImport-Package is a clean solution? User can
> No, it's against OSGi and have no control on which version will be imported.
>
> Template/script engine requirement is very different to service
> oriented OSGi environment. JRUBY and GROOVY has this discussion as
> well:
> http://jira.codehaus.org/browse/JRUBY-3792
> http://jira.codehaus.org/browse/GROOVY-3192
>
>> create an OSGi fragment linked to the Freemarker bundle and add new
>> packages into this fragment like jruby.No?
> Fragment is the OSGi way to solve the problem partially only if you
> know the packages you want to use in template. After freemarker bundle
> started, you have cannot access none imported package without
> DynamicImport.
>
> DynamicImport-Package give the max flexibility, there is no harm if
> user doesn't access the packages. User may use Fragment to lock down
> to particular version if there are multiple package version available.
>
> I am not sure we can set the classloader for the new operation inside
> template. If yes, then we may leave the problem to freemarker consumer
> class to setup correct classloader like groovy does.
>
> -Guo
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
12