Skip to content

Conversation

@m273d15
Copy link
Contributor

@m273d15 m273d15 commented Jun 16, 2020

We are currently using a workaround that allows us to import gradle into eclipse
(via the prepareEclipse task). However, it would be possible to modify our build
and import the project via the default eclipse gradle importer (buildship).
This import does not detect projects as "features" and "update" which are not
managed by gradle. This would lead to the situation that we are not able to
create release artifacts.

With the following gradle tasks we can create an eclipse update-site or
dropin using the recommended approach via the P2Director.

@m273d15 m273d15 added Area: Eclipse Issue affecting Saros for Eclipse (Saros/E) Area: Infrastructure Issue affecting the infrastructure to build, test and deploy Saros and its documentation labels Jun 16, 2020
@m273d15 m273d15 requested review from srossbach, stefaus and tobous June 16, 2020 11:50
stefaus
stefaus previously approved these changes Jun 21, 2020
Copy link
Contributor

@stefaus stefaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 96 to 104
from("feature/feature.xml") {
into("features")
}
into("plugins") {
from(project.tasks.findByName("jar"))
from(project(":saros.core").tasks.findByName("jar"))
}
from("update/site.xml")
into(updateSiteDirPath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unify usage of into...from.. logic? This uses 3 layouts. from->into with braces, into->from with braces, and from->into without braces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I could change the first closure into a into{from} (removing one layout).

However, the remaining two layouts are not interchangeable:

  • The "plain" layout at the bottom of the task (l.103-104) defines the root target dir (into) and what should be copied into the root dir (from)
  • The previous from/into-definitions define target dirs relative to the root dir.

dependsOn(":saros.core:jar", ":saros.eclipse:jar")

from("feature/feature.xml") {
into("features")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this work? I.e., why can you just use the path relative to build/update-site here while you still seem to have to provide the base path for the site.xml (l.103).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last into defines the base path.
I think I should change the order and place the root into at the top of the specification.
See here for a detailled explanation.

val updateSiteCategoryPublishing by registering {
dependsOn(updateSiteFeaturesAndBundlesPublishing)
doLast {
with(saros.gradle.eclipse.CategoryPublisher("4.8.0")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the specification of the targeted Eclipse release? If so, is there a way of unifying it with the declaration in SarosEclipseExtension so that we don't have to specify the version in two different places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Sure

register("dropin", Zip::class) {
dependsOn(updateSite)

archiveFileName.set("saros-dropin.zip")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify that it is Saros/E and the contained version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like saros-eclipse-dropin-<version>.zip? Sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started to implement this but realized that I have to implement a proper version handling (as we need it for #808). This task is only executed to create a release and the current process is also to rename the zip manually. Therefore, I would rename the archive to "saros-eclipse-dropin.zip" without the version nr.

destinationDirectory.set(project.file("build/dropin"))

from(updateSiteDirPath) {
exclude("*.jar")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this exclude the jar files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It excludes the content.jar and artifacts.jar as described here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected that the cleanup was already done in l.167 - l.176.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup you mention removes all metadata that are not part of the update-site, but these metadata are part of the update-site, but not part of the dropin.

@m273d15 m273d15 force-pushed the pr/stf/gradle_kts branch from ddbddf6 to b4c0c76 Compare June 25, 2020 08:27
Base automatically changed from pr/stf/gradle_kts to master July 13, 2020 10:24
@m273d15 m273d15 dismissed stefaus’s stale review July 13, 2020 10:24

The base branch was changed.

@m273d15
Copy link
Contributor Author

m273d15 commented Aug 3, 2020

I will rebase and introduce requested changes as soon as my PR in goomph is merged & released (allows to remove the custom CategoryPublisher class)

m273d15 added 2 commits August 5, 2020 10:20
We are currently using a workaround that
allows us to import gradle into eclipse
(via the prepareEclipse task). However,
it would be possible to modify our build
and import the project via the default
eclipse gradle importer (buildship).
This import does not detect projects
as "features" and "update" which are not
managed by gradle. This would lead to
the situation that we are not able to
create release artifacts.

With the following gradle tasks we
can create an eclipse update-site or
dropin using the recommended approach
via the P2Director.
@m273d15 m273d15 force-pushed the pr/build/update-site branch from cbe1fe6 to d01031e Compare August 5, 2020 08:42
@m273d15 m273d15 force-pushed the pr/build/update-site branch from d01031e to 01b2b47 Compare August 5, 2020 08:45
@m273d15
Copy link
Contributor Author

m273d15 commented Sep 16, 2020

@tobous Are there still open change requests?

@saros-infrastructure
Copy link

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipsePlugin.java  1
         

See the complete overview on Codacy

@m273d15 m273d15 merged commit 2c1bfa2 into master Sep 17, 2020
@m273d15 m273d15 deleted the pr/build/update-site branch September 17, 2020 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Eclipse Issue affecting Saros for Eclipse (Saros/E) Area: Infrastructure Issue affecting the infrastructure to build, test and deploy Saros and its documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants