Benoker / DockingFrames

http://www.docking-frames.org
96 stars 46 forks source link

Reworked the maven and eclipse project structure. #61

Closed RocusHalbasch closed 6 years ago

RocusHalbasch commented 6 years ago

This updates the maven project and modules as well as the eclipse projects and adds maven and eclipse projects so the entire project can be edited and built using maven and eclipse. The build has also been changed so the jars built by maven are essentially the same as what comes in the current distributables. Also a couple more modules have been added that build the distributables.

Benoker commented 6 years ago

Thanks. I'll checkout your branch just to ensure my workspace still works, and if so do a merge.

RocusHalbasch commented 6 years ago

I think it should I tried to avoid changes that might break things. If you run into anything let me know.

Benoker commented 6 years ago

Using java.home caused some issues on my system: I have several JDKs installed, and java.home points to some random JRE. Perhaps reading the path from a properties file would be nice.

  <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.4.2</version>
      <scope>system</scope>
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
  </dependency>
Benoker commented 6 years ago

The thing with java.home is the only complaint I have, everything else works fine. I did run into an Eclipse related bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=454053) - one reason why I hate updates :-) , but that has absolutely nothing to do with you.

Thanks for all the work you did, I did not realise how much code you touched when I first looked at the pull request.

RocusHalbasch commented 6 years ago

You're welcome.

I ran into an exception and thought I would check if a recent snapshot had broken something. Then I realized the snapshots haven't been updating for a very long time and that I was way out of date. I checked your site and I checked maven central and realized you still don't deploy to maven central. I used to get around this by downloading your distributions and using deploy:deploy-file to deploy them to my teams maven repo so everyone on the project could get it, but that required going to your site and checking for new versions and manually downloading them, the rest I had automated with a deploy pom. Anyway I figured it might just be easier to clone and build your project and then use altDeploymentRepository to point the deploy phase to deploy to our team repo. I figured then I could get my build server to update and check for version tags and every time it saw a new one have it kickoff a new deploy to our team server and email us that a new dockingframes was built so then all we would have to do is update our project pom to point to the new version. We already have our build working like that so it wouldn't be much work to do that with your project as well. Then I cloned it and imported exisiting projects and realized that wasn't going to work. So I went about trying to fix all of the errors and getting it to a state where it could be built, by the time I was done with that a lot of the work was done but the changes to the project were big enough that I felt I would have problems trying to keep integrating your changes into my version, so I cleaned it up and added the dist building modules in hopes you would integrate it into the project and then everything would just work.

As for the bug I completely forgot to mention it. It doesn't actually prevent eclipse from building but it is annoying. I was thinking I would try and extract a trivial case and add it to the bug report.

I would be happy to change the implementation for tools.jar any way you would like just let me know. I have a couple more tiny things I forgot to do.

RocusHalbasch commented 6 years ago

So what I did for the tools.jar issue is I created the following propery <toolsJar>${java.home}/../lib/tools.jar</toolsJar> in the docking-frames-base pom. That property is then used in the Help module to point to the tools.jar. This means there are several options if ${java.home} does not point to the right place, you can make ${java.home} point to the right place, or you can override the toolsJar property this can be done by adding the following to one of your settings.xml files:

  <profiles>
    <profile>
      <id>toolsJarConfig</id>
      <properties>
        <toolsJar>[whatever you want]</toolsJar>
      </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>toolsJarConfig</activeProfile>
  </activeProfiles>

or by using -D from the command line.

RocusHalbasch commented 6 years ago

Also to change java.home in eclipse if I remember correctly you need to edit your eclipse.ini and set the vm property as follows with a correct path to the JDK of your choice.

-vm
C:/Program Files/Java/jdk1.8.0_144/bin

https://bugs.eclipse.org/bugs/show_bug.cgi?id=432992

RocusHalbasch commented 6 years ago

So that is the last of the edits I was going to make. Let me know if that solution for tools.jar is not satisfactory.

Benoker commented 6 years ago

Merged back to master. In order to resolve dependency issues in Eclipse I did add a dependency to tools.jar in "demonstration" as well (technically that is correct).

RocusHalbasch commented 6 years ago

Weird that shouldn't be needed as it should get that dependency from Help, but it won't harm anything.

RocusHalbasch commented 6 years ago

I distilled the bug you saw and added it to the bug report. Maybe it will help them find and fix it. The simplest version of it I could make was

ExtFoo.jar:

package stuff;

import stuff.ExtFoo.ExtBar;

interface Foo<X> {}

interface ExtFoo extends Foo<ExtBar<Object>> {
    interface Bar {}
    interface ExtBar<Y> extends Bar {}
}
Benoker commented 6 years ago

Converting the inner interface to "normal" interfaces also works. The master branch should be error free again (well, technically it always was error free). They did not fix the bug in Eclipse since it was reported in 2014, I would be surprised if they do now.

RocusHalbasch commented 6 years ago

That is fair. Also you only needed to move ColumnItem to it's own file to work around the bug. Column could have stayed.

Benoker commented 6 years ago

I just started at the top, and was too lazy to try all permutations :-)

RocusHalbasch commented 6 years ago

I figured it out playing with the slimmed down example. If you move Bar out of ExtFoo it works.

RocusHalbasch commented 6 years ago

So I did a little more searching and the actual bug was this one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=527731 They already fixed it in Photon and the fix is targeted to be released with 4.7.3 which is the next release.