Home » Modeling » M2T (model-to-text transformation) » Efficient Development with a user plugin in JET2
Efficient Development with a user plugin in JET2 [message #53649] |
Wed, 03 December 2008 17:48  |
Eclipse User |
|
|
|
Hi,
Supposing you create your own taglibs for JET2, configure everything in
JET for it, and then export it into a plugin, drop it into your plugins
directory, and restart Eclipse with -clean. This all works but then you
discover there's a small bug in one of your tags. It's quite a lengthy
process to re-export and restart Eclipse with -clean.
Re-exporting is not so bad, but restarting Eclipse with -clean is a 5
minute turnaround.
Is there any more efficient way of working with JET here because I believe
there's no way of loading custom taglibs into JET2 but via the plugin
mechanism?
Thx.
Paul
|
|
|
Re: Efficient Development with a user plugin in JET2 [message #53674 is a reply to message #53649] |
Thu, 04 December 2008 09:49   |
Eclipse User |
|
|
|
Paul:
Here are a couple of alternatives:
1) JET projects and JET tag libraries are plug-ins. Instead of
running/testing the JET Project in your development environment, create what
I still call a Runtime Workbench (Run > Run Configurations, then create an
new Eclipse Application). Then, simply do all your testing by first
launching that workbench, and running your JET transformation there.
Bonus tip: Launch the runtime workbench in Debug (using the Debug menu
instead of Run), and take advantage of the JVMs hot code replacement
capabilities. There are limits to this, but changing method bodies and
editing JET templates generally work quite well without requiring a
relaunch. You have the best chances of a code replacement working if the
code isn't active, so let the JET transformation finish, then make your code
edits in your development workspace, and the run the JET transformation
again from the runtime workbench - no relaunch needed! Only times you'd need
a relaunch are if you've changes manifest files (MANIFEST.MF, plugin.xml),
or if the JVM tells you so.
2) Continue with your current process, but try doing without -clean. I can't
remember the last time I used it - I typically use it only as a last resort.
Paul
|
|
| |
Re: Efficient Development with a user plugin in JET2 [message #53775 is a reply to message #53698] |
Mon, 08 December 2008 04:54   |
Eclipse User |
|
|
|
Hey,
for XPath functions, it is very easy to setup a junit plugin test. I've
done the implementation of my xpath function in this way and this is,
imho, the best way to test an implementation. This works since the
method body doesn't try to collect information from the template via the
context object.
I know, that tag functionality requires more setup configuration, but i
think, this should be also possible in some situations. Correct me if i
am wrong, Paul.
Timothy
Pau schrieb:
> Thanks Paul, they sound like reasonable workarounds, I'll give them a go
> and see how I fare.
>
> Paul
>
>
>
|
|
| | |
Re: Efficient Development with a user plugin in JET2 [message #54205 is a reply to message #54047] |
Tue, 16 December 2008 08:30   |
Eclipse User |
|
|
|
Paul:
A 'runtime workbench' is an Eclipse instance, with the plug-in projeccts you
are working on installed. It is primarily used by Eclipse plug-in developers
to test and debug their changes. Since JET projects are Eclipse plug-ins, it
can also be used to test and debug them.
But, as you notices, the runtime workbench starts out with an empty
workspace. But, rest assured, your JET transformation is available. To run
your transformation:
1) create a project, and create some test input in it.
2) From the Run menu, choose Run > Run Configuration, then select JET
Transformation and click the 'new' icon. Browse for your input, and select
your JET transformation's id. Click Run.
Paul
|
|
|
Re: Efficient Development with a user plugin in JET2 [message #54441 is a reply to message #54205] |
Wed, 17 December 2008 10:58   |
Eclipse User |
|
|
|
Paul,
Just so I understand this, once I have the Run workbench up in debug mode,
it will hot patch any change to my plugins I make, either the JET Project
and templates itself, or my custom tags Java plugin that my JET project
depends on? And I don't have to export these plugins to JARs each from my
dev environment? Can my JET project then purely have a project dependency
on my custom plugin as opposed to a plugin dependency? Or does it always
have to be a plugin dependency and in such case, is it always necessary to
push every change out to a JAR in the plugins directory so the runtime
workbench picks it up? Or can the workbench pick a change up say in my
local custom tags Java project without any export?
I notice you can close a plugin project, and when you do if you look at
the project dependencies on say the JET project which depends on the
project you closed, there's a dark arrow missing on the plugin icon if the
project is open, but is present if it's closed. Is this saying that if
open, it uses the local version in the workspace project folder, but if
it's closed, it uses the version in the JAR in the plugins directory? And
this relationship would then be maintained in the runtime workbench?
Paul
|
|
|
Re: Efficient Development with a user plugin in JET2 [message #54521 is a reply to message #54441] |
Wed, 17 December 2008 12:19   |
Eclipse User |
|
|
|
Paul: answers in-line:
"Pau" <paul_hammond@hotmail.com> wrote in message
news:8a4eafc20f25f7f45b57b9fbdc25229d$1@www.eclipse.org...
> Paul,
>
> Just so I understand this, once I have the Run workbench up in debug mode,
> it will hot patch any change to my plugins I make, either the JET Project
> and templates itself, or my custom tags Java plugin that my JET project
> depends on(1)? And I don't have to export these plugins to JARs each from
> my dev environment (2)? Can my JET project then purely have a project
> dependency on my custom plugin as opposed to a plugin dependency (3)? Or
> does it always have to be a plugin dependency and in such case, is it
> always necessary to push every change out to a JAR in the plugins
> directory so the runtime workbench picks it up(4)? Or can the workbench
> pick a change up say in my local custom tags Java project without any
> export(5)?
>
(1)Yes, you can just change things w/o restart. The exceptions: changes to
plugin.xml and MANIFEST.MF don't get picked-up - you'd need to restart the
debug session.
(2) No, you don't need to export plug-in JARs to your local dev env if you
use a runtime workbench.
(3) No, don't use project dependencies. OSGi only understands plug-in
dependencies (I.e. those declared in the Plug-in Manifest editor)
(4) Always use plug-in dependencies. Don't bother exporting them to JARs.
(5) The JRE (assuming is hot-code replace enabled) will pick up any changes
to Java classes in plug-in projects in your workspace. No export required.
> I notice you can close a plugin project, and when you do if you look at
> the project dependencies on say the JET project which depends on the
> project you closed, there's a dark arrow missing on the plugin icon if the
> project is open, but is present if it's closed. Is this saying that if
> open, it uses the local version in the workspace project folder, but if
> it's closed, it uses the version in the JAR in the plugins directory(6)?
> And this relationship would then be maintained in the runtime workbench
> (7)?
(6) Haven't noticed that. But, that is a fair summary. The runtime work
bench uses the plug-ins specified in its launch configuration on the
Plug-ins tab. There are number of settings - I typically choose "plug-ins
selected below only", and list the workspace and target environment plug-in
explicitly. If you choose one of the other options, I believe (not 100%
sure) that the config would give preference to open workspace projects over
already installed plug-ins.
(7) Yes.
>
> Paul
>
>
>
|
|
| | | |
Re: Efficient Development with a user plugin in JET2 [message #55416 is a reply to message #54654] |
Wed, 14 January 2009 11:30  |
Eclipse User |
|
|
|
Paul:
Sorrying for taking so long...
A workspace may not be used simultaneously by two running Eclipse instances.
So, a runtime workbench must necessarily have a separate workspace than the
development one.
But, I'm confused as to how c:include's can be failing. Yes, the template
path's are relative to the JET project, but the compiled JET templates
contain all the information necessary to resolve these templates. Same goes
for the template attribute in ws:file.
Are you getting messages like:
Error: Could not find template templates/dumpX.jet
?
There are a number of tags that take relative paths for which the context
can be switched from the JET transformation to the current workspace. This
include c:load and ws:copyfile.
If you are using these and are copying out of the workspace, you'd need to
import these projects into your runtime workbench. There is an import wizard
that can import projects into a workspace (File > Import, then General >
Existing Project into workspace).
Paul
|
|
|
Goto Forum:
Current Time: Thu May 08 09:36:50 EDT 2025
Powered by FUDForum. Page generated in 0.33365 seconds
|