The Ceylon Eclipse plugin now becoming a true Ceylon project

75 views
Skip to first unread message

David Festal

unread,
Jun 15, 2015, 10:48:51 AM6/15/15
to ceylo...@googlegroups.com
Hi all,

I'm about to push a significant change to the Eclipse Ceylon plugin project :

`ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui`

Summary


Before the change


Until now this project was a Java project, with the Eclipse Plugin nature. And the involved Ceylon code was gathered inside the following Ceylon sub-project :

`ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/ceylon`

This `ceylon` sub-project was not using any Eclipse API at all, and only pure Ceylon code was lying there. The produced module archive was included inside the main Eclipse Plugjn bundle and referenced in the classpath of its MANIFEST file.

And the Eclipse plugin was not able to use the Ceylon abstractions available in the `ceylon-ide-common` project.

After the change


Now, the main Eclipse project has become a true Ceylon project itself, and the `ceylon` sub-project doesn't exist any more.

It depends on `ceylon-ide-common` to use / extend / implement its provided abstractions.
And it is now possible to use all the required Eclipse APIs directly within Ceylon code.

Reason


It's the first step and pre-requisite of a major refactoring of the Eclipse Ceylon plugin, in which many parts of the plugin will be abstracted as Ceylon code into the `ceylon-ide-common` repository, to used inside other IDEs such as IntelliJ.

As an example, the AST Delta Builder used for the incremental build, and already written in Ceylon, has now been moved from `ceylon-ide-eclipse` to `ceylon-ide-common`.

In this context, every new abstracted part will be replaced, inside the Eclipse plugin, by some Ceylon or Java code that extends / satisfies / calls common abstractions while using Eclipse APIs.

Change details


The build is now a Ceylon build, that has 3 source directories :
- `src` : the old source directory already used when the plugin was a Java-only project
- `source`: the new source directory for the Ceylon code that will be added (or progressively translated from abstracted old Java code)
- `generated-source` : a directory that contains source files generated during the build : for the moment a module descriptor (`module.ceylon`) and a dependency overrides file (`overrides.xml`) that allow importing all the required Eclipse bundles into Ceylon. The template files that are used to generate these 2 files can be found in the `source-templates` directory.

The required Eclipse APIs are gathered by the build, made available inside a local Ceylon repository (`target/repo`), and imported through the generated module descriptor.
This is done automatically and only when necessary during the build by ANT tasks integrated to the Eclipse build.
However if you need to explicitly run these tasks, you can use the following Eclipse launch configurations available at the root of the project  :
- Retrieve Eclipse Dependencies : it gathers the required Eclipse dependencies into the `target/repo` directory, and will automatically generate the module descriptor and dependency overrides files
- Regenerate Eclipse Imports : it only regenerates the module descriptor and dependency overrides files.
- Retrieve Eclipse Sources : it gathers all the source archives of the required bundles in a separate local repository (`eclipse-source-repo`), so that the source code of any Eclipse bundle can be navigated to from Ceylon code. This task is not  run automatically by the build. You should run it explicitly if you want to have eclipse sources available.

The list of required Eclipse bundles to be imported as Ceylon modules is built from :
- the required bundles found in the `META-INF/MANIFEST.MF`,
- the bundles listed in the `AdditionalBundles.properties`

Impacts


I've tried to make things as transparent as possible compared to the previous situation and no significant change has been done to the source code.

However, the following impacts must be considered :

- Since the project now uses the `ceylon-ide-common` code, you should :
    - have `ceylon-ide-common` cloned locally from `https://github.com/ceylon/ceylon-ide-common` (just as you already do with `ceylon.formatter`) ,
    - run `ant clean publish ide-quick` inside the `ceylon-ide-common`

- The Maven build should work without any change. You will simply notice that it waits a moment just after the line :

    compile:
    Note: Created module com.redhat.ceylon.eclipseDependencies/1.1.1

  it is just waiting for the end of the compilation of the main `com.redhat.ceylon.eclipse` module that contains all the source files.

- When building the plugin inside Eclipse :
    - you should add the `ceylon-ide-eclipse/required-bundle-proxies/com.redhat.ceylon.ide.common-1.1.1.car` to the workspace
    - the first build of the project will probably be a bit longer since it will gather the Eclipse dependencies (you can see the logs of this step in the console window since it is an Ant task)
    - More generally, since the build is now a Ceylon build, it might, in some cases, lead to longer builds, especially when full builds are required since the Ceylon compiler also compiles the more-than-700 Java files.


I hope you will have no problem after pulling these changes, and count on your understanding !

Finally please report any problem you might encounter.


David.

--
David Festal

SERLI - Avenue Thomas Edison - BP 20160
86960 Futuroscope Cedex
France
tel. : (33) +6 22 73 44 54









Max Rydahl Andersen

unread,
Jun 17, 2015, 7:37:56 AM6/17/15
to ceylo...@googlegroups.com
As mentioned on chat yesterday - you should really submit a talk on this
work
to one of the three eclipsecon's (France, Germany or US).

Its really interesting work you guys been doing here.

/max
> --
> You received this message because you are subscribed to the Google
> Groups "ceylon-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ceylon-dev+...@googlegroups.com.
> To post to this group, send email to ceylo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ceylon-dev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ceylon-dev/1434379726.2266.116.camel%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.


/max
http://about.me/maxandersen
Reply all
Reply to author
Forward
0 new messages