Home » Eclipse Projects » Oomph » Execution of Gradle task before import
Execution of Gradle task before import [message #1706540] |
Thu, 27 August 2015 11:11  |
Eclipse User |
|
|
|
Hello Eclipse Community,
I am trying to import Gradle java-Projects into eclipse, which are at the beginning pure gradle projects. However , the command 'gradlew eclipse' can convert them into eclipse projects. Thus i am looking for a way to execute a command before importing the projects into workspace. Is it possible in oomph ?
Alternatively, is it possible to import non-java projects into eclipse? For example i can let my eclipse have a gradle plugin pre-installed. Will it then be able to import my gradle projects ?
Maksim
[Updated on: Thu, 27 August 2015 11:41] by Moderator
|
|
|
Re: Execution of Gradle task before import [message #1706599 is a reply to message #1706540] |
Fri, 28 August 2015 00:40   |
Eclipse User |
|
|
|
Maksim,
This sounds similar to a Maven import task. In that case the projects
also not properly Eclipse projects, i.e., no .project files. So I
imagine it's possible to integrate with Gradle, but someone would need
to implement such a task We do have a wizard for creating an extension
task implementation, so anyone can implement such interesting extensions...
On 27/08/2015 5:11 PM, Maksim Melnik wrote:
> Hello Eclipse Community,
> I am trying to import Gradle java-Projects into eclipse, which are at
> the beginning pure gradle projects. However , the command 'gradlew
> eclipse' can convert them into eclipse projects. Thus i am looking for
> a way to execute a command before importing the projects into
> workspace. Is it possible in oomph ?
> Maksim
|
|
| | | |
Re: Execution of Gradle task before import [message #1707292 is a reply to message #1707289] |
Thu, 03 September 2015 10:09   |
Eclipse User |
|
|
|
Maksim,
That plugin registers a wizard that allows you to do File -> New ->
Project -> Oomph -> Setup Task Extension, so if you see that wizard, all
is good, if you don't, you've not installed it.
On 03/09/2015 3:45 PM, Maksim Melnik wrote:
> How do i install the org.eclipse.oomph.setup.ui.ide ?
> I've cloned oomph git directory and i found this project in the
> project viewer, however , i don't really understand what you mean by
> installing it. I've tried to run it as eclipse IDE application, but it
> did not work.
|
|
| | | | | |
Re: Execution of Gradle task before import [message #1707776 is a reply to message #1707775] |
Wed, 09 September 2015 06:32   |
Eclipse User |
|
|
|
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Am 09.09.2015 um 12:20 schrieb Maksim Melnik:<br>
<blockquote cite="mid:msp15l$a4d$1@xxxxxxxxe.org" type="cite">Hey
Ed,
<br>
<br>
i have implemented the perform method for a task, which simply
executes ' dir ' command and prints the result into the context.
<br>
<br>
Now, i start new IDE and create a new .setup file which uses my
task:
<br>
<br>
<setupTask
<br>
xsi:type="gradler:GradlerTask"/>
<br>
<br>
<br>
It is also shown correctly in the outline view - startup triggers.
<br>
<br>
However when i try to run the setup file in the installer ( i use
your installer, don't compile my own or so... ) , my task is not
executed when new eclipse starts up.
<br>
</blockquote>
Can you please show the implementation of your isNeeded() method?<br>
<br>
<blockquote cite="mid:msp15l$a4d$1@xxxxxxxxe.org" type="cite">
<br>
<br>
I also have some questions on what you have said above.
<br>
<br>
Where do i find the enablement annotation on the EClass ? </blockquote>
Have a look at one of our extension models, e.g., Git.ecore:<br>
<br>
<img src="https://www.eclipse.org/forums/index.php?t=getfile&id=23193" alt=""><br>
<br>
<blockquote cite="mid:msp15l$a4d$1@xxxxxxxxe.org" type="cite">How
do I set it ?
<br>
</blockquote>
You can copy/adjust from any of our extension models.<br>
<br>
<blockquote cite="mid:msp15l$a4d$1@xxxxxxxxe.org" type="cite">
<br>
You said that the installer augments the p2 tasks with the
requirements and update sites from the enablement annotation. Does
that mean that my task implementation should be online so that the
installer can find it ?
<br>
</blockquote>
Yes. In a runtime launch from within Eclipse the needed EPackages
would be found through the normal extension registry, though.<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<br>
</body>
</html>
Attachment: ceaibgcd.png
(Size: 13.05KB, Downloaded 176 times)
|
|
| | | | | |
Re: Execution of Gradle task before import [message #1707846 is a reply to message #1707843] |
Wed, 09 September 2015 12:43   |
Eclipse User |
|
|
|
Oh yes, you are right.
I've got another problem now.
All my projects are created using java-7. Now, in order to start oomph i need the java 8. Thus, i change my path to java8 and start oomph.
Since i want my eclipse to run on java7 , i chose it in the very first menu of oomph. (First screenshot)
After oomph installs the new it starts it, so far so good.
But then , what i see is , that the new eclipse actually uses java8 (Second screenshot)
Is it a bug, or am i doing something wrong?
I cannot complete full eclipse installation becuz my projects are not compatible with java 8... Thats why i neeed java 7
Attachment: Capture.PNG
(Size: 56.02KB, Downloaded 194 times)
Attachment: Capture2.PNG
(Size: 74.40KB, Downloaded 210 times)
|
|
|
Re: Execution of Gradle task before import [message #1707850 is a reply to message #1707846] |
Wed, 09 September 2015 13:20   |
Eclipse User |
|
|
|
Am 09.09.2015 um 18:43 schrieb Maksim Melnik:
> Oh yes, you are right.
>
> I've got another problem now.
>
> All my projects are created using java-7. Now, in order to start oomph i need the java 8.
Yes, the Platform decided to make use of Java 8 in Neon, for example in JFace and the help system.
> Thus, i change my path to java8 and start oomph.
>
> Since i want my eclipse to run on java7 , i chose it in the very first menu of oomph. (First screenshot)
> After oomph installs the new it starts it, so far so good.
Yes, the installer knows about the minimum Java requirement of the different products and product versions, e.g., Java 7
for Mars, Java 8 for Neon.
>
> But then , what i see is , that the new eclipse actually uses java8 (Second screenshot)
Well, that's not the JRE to be used for the installed IDE, it's the JRE used for Java development in that workspace. And
you must have picked that at some point. It's probably stored in your user.setup and you can change it there at any time
and reperform the respective JRETask to have your workspace adjusted.
>
> Is it a bug, or am i doing something wrong?
Probably the latter :P
> I cannot complete full eclipse installation becuz my projects are not compatible with java 8... Thats why i neeed java 7
That should work; see above.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| | | |
Re: Execution of Gradle task before import [message #1708346 is a reply to message #1708333] |
Tue, 15 September 2015 13:30  |
Eclipse User |
|
|
|
Am 15.09.2015 um 16:42 schrieb Maksim Melnik:
> Thank you Eike for your help,
> so far everything works just perfect, however there is still a problem that my task is automatically included into
> startup task, so it is executed each time when i start my eclipse , instead of just once , after the installation...
> Is there a way to correct this?
If you can't strictly control it via the constant value of the ValidTriggers annotation you need to implement your
SetupTask.isNeeded() method such that it returns false when nothing is to do. But please note that isNeeded() is
generally expected to return rather quickly. Two approaches to achieve that are:
1) Remember a flag somwhere under .metadata to remember the fact that a one-time task has successfully executed. See
ProjectSetImportTaskImpl.Helper.isNeeded() for an example with more fine-grained state that is remembered.
2) Leave more expensive computation to the MANUAL trigger and skip the STARTUP trigger completely. See
P2TaskImpl.isNeeded() for an example of a task that's only needed at startup if from the explicit top-level requirements
it's obvious that software is missing (i.e., it omits expensive remote queries for update searches).
3) Combinations of the two approaches 1 and 2.
> My another issue is preferences sharing, is it possible to keep eclipse updated, when for example someone adds some
> preferences to the .setup file?
To which setup file do you mean?
Project setup files can easily serve this purpose because you can link a workspace to multiple project setups. YOu could
use one such project for a team just to store/distribute some preference tasks.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Tue Jul 15 09:08:06 EDT 2025
Powered by FUDForum. Page generated in 0.08765 seconds
|