Home » Modeling » M2T (model-to-text transformation) » Efficient Development with a user plugin in JET2
|
Re: Efficient Development with a user plugin in JET2 [message #53674 is a reply to message #53649] |
Thu, 04 December 2008 14:49 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
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 09:54 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
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 13:30 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
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 15:58 |
Paul Hammond Messages: 17 Registered: July 2009 |
Junior Member |
|
|
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 17:19 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
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
>
>
>
|
|
| | | | |
Goto Forum:
Current Time: Thu Dec 26 13:11:07 GMT 2024
Powered by FUDForum. Page generated in 0.12403 seconds
|