New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move custom gradle configs into custom plugins #721
Conversation
c9df221
to
dcaff4f
Compare
TODO: Remove workaround that removes duplicate classpath entries. Already fixed with #722 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review in progress. But here are the first notes.
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijExtension.java
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijExtension.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
I think Codacy is a bit broken. The first analysis failed to find anything (as it did not analyze the 'buildSrc' directory), and the results of the successful analysis were not posted here. Anyways, @m273d15, you should have a look at the results of the newest codacy build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I only had a very coarse look at the changes for the Eclipse build stuff as I am not really familiar with it or the Eclipse usage (as I don't use Eclipse myself). Also, the review already took me long enough as it is.
So it would be nice if somebody else could have a more detailed look at the eclipse (and STF) part of the code as well.
In general, a lot of classes and methods (at least for the IntelliJ stuff) need javadoc. There are a lot of implicit assumptions based on "insider knowledge" about Gradle, Gradle Tasks, IntelliJ, and the IntelliJ Gradle build process that is not mentioned at all. This makes it a lot harder to understand the logic.
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/ConfigureIntelliJTask.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipseExtension.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipsePlugin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thank you for your review 👍
@@ -123,37 +108,16 @@ configure(projectsToConfigure) { projectToConf -> | |||
from projectToConf.configurations.releaseDep | |||
} | |||
|
|||
projectToConf.ext.eclipseHome = projectToConf.hasProperty('eclipseHome') ? eclipseHome : System.getenv('ECLIPSE_HOME') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means that the developers don't have to use a local eclipse installation in order to build the eclipse plugin. You still need a local installation in order to run the plugin (which would be the next step of the infrastructure improvement). This has the advantage that you don't need to install eclipse if you want to build all projects in your ide without problems.
If you want to use a specific eclipse version for build and testing you can set the value:
sarosEclipse {
eclipseVersion = <version string>
}
Is this due to complications in the eclipse build process that required the "Mavenize" job in the previous setup?
The previous setup was necessary, because the eclipse bundles were not available via maven central, but the bundle are now deployed into maven central (by the eclipse project itself). Therefore, we don't need the weird setup of converting an eclipse installation (more specific the P2 repository) into a local maven repository. The only bundle that is not available via maven central is gef (because it is not part of the default bundles)
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java
Outdated
Show resolved
Hide resolved
Also, since this (at least slightly) changes the necessary build setup (e.g. the reference to a local eclipse installation no longer being necessary), the documentation should be updated accordingly. |
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java
Outdated
Show resolved
Hide resolved
213a724
to
72599a2
Compare
buildSrc/src/main/java/saros/gradle/intellij/IntellijConfigurator.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/IntellijConfigurator.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijExtension.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipsePlugin.java
Outdated
Show resolved
Hide resolved
import org.jetbrains.intellij.IntelliJPluginExtension; | ||
|
||
/** Gradle task that configures the intellij plugin. */ | ||
public class IntellijConfigurator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this no longer extend DefaultTask
? Is it no longer necessary?
buildSrc/src/main/java/saros/gradle/intellij/IntellijConfigurator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eclipse and IntelliJ (runIde) worked for me, but gradlew stfTest
failed with:
exception
> Task :saros.stf.test:compileStfTestJava FAILED
[gitfolder]/stf.test/test/saros/stf/test/followmode/SimpleFollowModeITest.java:8: error: package org.eclipse.jface.bindings.keys does not exist
import org.eclipse.jface.bindings.keys.IKeyLookup;
^
[gitfolder]/stf.test/test/saros/stf/test/filefolderoperations/FileOperationsTest.java:11: error: package org.eclipse.core.runtime does not exist
import org.eclipse.core.runtime.CoreException;
^
[gitfolder]/stf.test/test/saros/stf/test/filefolderoperations/FileOperationsTest.java:194: error: cannot find symbol
public void testNewPkgAndClass() throws CoreException, IOException {
^
symbol: class CoreException
location: class FileOperationsTest
[gitfolder]/stf.test/test/saros/stf/test/editing/ConcurrentEditingTest.java:8: error: package org.eclipse.jface.bindings.keys does not exist
import org.eclipse.jface.bindings.keys.IKeyLookup;
^
[gitfolder]/stf.test/test/saros/stf/test/invitation/ParallelInvitationWithTerminationByHostTest.java:13: error: package org.eclipse.core.runtime does not exist
import org.eclipse.core.runtime.CoreException;
^
[gitfolder]/stf.test/test/saros/stf/test/invitation/ParallelInvitationWithTerminationByHostTest.java:65: error: cannot find symbol
throws IOException, CoreException, InterruptedException {
^
symbol: class CoreException
location: class ParallelInvitationWithTerminationByHostTest
[gitfolder]/stf.test/test/saros/stf/test/invitation/HostInvitesBelatedlyTest.java:8: error: package org.eclipse.core.runtime does not exist
import org.eclipse.core.runtime.CoreException;
^
[gitfolder]/stf.test/test/saros/stf/test/followmode/SimpleFollowModeITest.java:55: error: cannot find symbol
.pressShortcut(IKeyLookup.BACKSPACE_NAME, IKeyLookup.BACKSPACE_NAME);
^
symbol: variable IKeyLookup
location: class SimpleFollowModeITest
[gitfolder]/stf.test/test/saros/stf/test/followmode/SimpleFollowModeITest.java:55: error: cannot find symbol
.pressShortcut(IKeyLookup.BACKSPACE_NAME, IKeyLookup.BACKSPACE_NAME);
^
symbol: variable IKeyLookup
location: class SimpleFollowModeITest
[gitfolder]/stf.test/test/saros/stf/test/editing/ConcurrentEditingTest.java:72: error: cannot find symbol
ALICE.remoteBot().editor(FILE).pressShortcut(new String[] {IKeyLookup.BACKSPACE_NAME});
^
symbol: variable IKeyLookup
location: class ConcurrentEditingTest
[gitfolder]/stf.test/test/saros/stf/test/editing/ConcurrentEditingTest.java:78: error: cannot find symbol
ALICE.remoteBot().editor(FILE).pressShortcut(new String[] {IKeyLookup.BACKSPACE_NAME});
^
symbol: variable IKeyLookup
location: class ConcurrentEditingTest
11 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':saros.stf.test:compileStfTestJava'.
> Compilation failed; see the compiler error output for details.
return Arrays.stream(value.split(",")) | ||
.map( | ||
(it) -> { | ||
return it.split(";")[0]; | ||
}) | ||
.filter( | ||
(it) -> { | ||
return !bundlesToExclude.contains(it); | ||
}) | ||
.toArray(String[]::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
return Arrays.stream(value.split(","))
.map(it -> it.split(";")[0])
.filter(it -> !bundlesToExclude.contains(it))
.toArray(String[]::new);
I know it is a simple fix. Seems like I forgot to add this as comment (I commented this issue somewhere ...). I will add the fix and the remaining improvements as soon as possible. |
6e4b6ba
to
b50160d
Compare
buildSrc/src/main/java/saros/gradle/eclipse/configurator/OsgiDependencyConfigurator.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/configurator/OsgiDependencyConfigurator.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/configurator/JarConfigurator.java
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/configurator/JarConfigurator.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/java/saros/gradle/eclipse/configurator/JarConfigurator.java
Outdated
Show resolved
Hide resolved
* You need an **Intellij IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/#section=linux) (we have only tested Saros/I for IntelliJ releases 2017.X and later) | ||
|
||
Set the **system-wide environment variable `ECLIPSE_HOME`** to the eclipse installation dir that contains the directory `plugins`.<br/> | ||
* *Optional:* You can install an **Intellij IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/#section=linux) (we have only tested Saros/I for IntelliJ releases 2017.X and later)<br/> | ||
Set the **system-wide environment variable `INTELLIJ_HOME`** to the intellij installation dir that contains the directory `lib`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the **system-wide environment variable `INTELLIJ_HOME`** to the intellij installation dir that contains the directory `lib`. | |
Set the **system-wide environment variable `INTELLIJ_HOME`** to the IntelliJ installation dir that contains the directory `lib`. | |
* *Optional:* You can also set the **system-wide environment variable `SAROS_INTELLIJ_SANDBOX`** to specify the base directory in which the IntelliJ sandboxes will be created. Otherwise, the directory `intellij/build` in the repository will be used by default. |
b50160d
to
448d15f
Compare
Fixed all mentioned issues. @tobous Sorry, the review board is very chaotic. Seems like I missed the issues you already highlighted in the previous review. |
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijExtension.java 1
- buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipseExtension.java 1
- buildSrc/src/main/java/saros/gradle/eclipse/SarosEclipsePlugin.java 4
- buildSrc/src/main/java/saros/gradle/eclipse/configurator/EclipseConfigurator.java 1
- buildSrc/src/main/java/saros/gradle/eclipse/configurator/OsgiDependencyConfigurator.java 7
- buildSrc/src/main/java/saros/gradle/intellij/SarosIntellijPlugin.java 3
- buildSrc/src/main/java/saros/gradle/eclipse/configurator/JarConfigurator.java 3
- buildSrc/src/main/java/saros/gradle/intellij/IntellijConfigurator.java 6
See the complete overview on Codacy |
* You need an **IntelliJ IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/) (we have only tested Saros/I for IntelliJ releases 2017.X and later) | ||
|
||
Set the **system-wide environment variable `ECLIPSE_HOME`** to the Eclipse installation dir that contains the directory `plugins`.<br/> | ||
* *Optional:* You can install an **IntelliJ IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/#section=linux) (we have only tested Saros/I for IntelliJ releases 2017.X and later).<br/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change got lost during rebasing (or rather the code suggestion this change is based on was still based on the old content of the file).
* *Optional:* You can install an **IntelliJ IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/#section=linux) (we have only tested Saros/I for IntelliJ releases 2017.X and later).<br/> | |
* *Optional:* You can install an **IntelliJ IDEA** installation which is used for dependency resolution. Install a current version of [**IntelliJ IDEA**](https://www.jetbrains.com/idea/download/) (we have only tested Saros/I for IntelliJ releases 2017.X and later).<br/> |
Add the SarosEclipsePlugin that configures the gradle eclipse plugin and provides methods to create osgi-bundles and resolve bundle dependencies from MANIFEST.MF This plugin uses the goomph mavencentral plugin in order to match eclipse bundle ids to maven artifacts. This makes the mavenize step obsolete Add the SarosIntellijPlugin that configures the gradle intellij plugin and enhances the runIde task by locking/unlocking actions that allow us to use muliple simultaneously running runIde instances (as already configured in the intellij/build.gradle).
The gef entry is superfluous since the stf is in a separate project and bundle. Therefore, the entry has to be removed.
All other bundles can be resolved by the goomph plugin (which is used in the custom saros gradle eclipse plugin). This is not an eclipse core bundle and therefore not deployed to maven central.
448d15f
to
fbfb1b6
Compare
rebased, removed |
which are written in Java. This reduces the usage of implicit groovy/gradle magic,
allows to reduce the amount of code in the build.gradle files and allows to reuse more code.
converts this repository into a maven repository. The new workflow uses the maven artifacts which
are deployed into maven central by the eclipse community. The mapping of eclipse version + bundle id -> maven artifact is performed by the goomph mavencentral plugin.
Also solves the issue #517 in the intellij environment.