diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

goomph does not work with windows #91

Closed moley closed 5 years ago

moley commented 5 years ago

Hi, I am using goomph for both creating my ide and providing a targetplatform for my headless build with gradle. So all in all I am very happy with it, but it turned out that under windows this does not work. I have the small example:

(edit by Ned: use triple backquote then language name for multiline code blocks)

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.diffplug.gradle:goomph:3.17.1'
  }
}

apply plugin: 'com.diffplug.gradle.oomph.ide'
oomphIde {
  repo    "http://download.eclipse.org/releases/2018-12"
  jdt {}
} 

When I call the gradle tasks ideClean ideSetupP2 on my mac everything is working fine. As soon as I call this tasks on a windows VM (in my case 32 bit Windows 7 Home Premium with Service Pack 1) the build breaks with an FileNotFoundException:

Caused by: java.io.FileNotFoundException: projectpath/build/oomph-ide.app/Contents/Eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info (No such file or directory)
        at com.diffplug.common.io.Files$FileByteSource.openStream(Files.java:126)
        at com.diffplug.common.io.Files$FileByteSource.read(Files.java:150)
        at com.diffplug.common.io.Files.toByteArray(Files.java:260)
        at com.diffplug.gradle.FileMisc.modifyFile(FileMisc.java:238)
        at com.diffplug.gradle.oomph.OomphIdeExtension.writeBrandingPlugin(OomphIdeExtension.java:438)
        at com.diffplug.gradle.oomph.OomphIdeExtension.ideSetupP2(OomphIdeExtension.java:385)
        at com.diffplug.common.base.Errors.lambda$wrap$5(Errors.java:218)`

The configuration path contains a config.ini where all bundles are shown under the property osgi.bundles and the bundles.info is missing, using mac the bundles.info is referenced in this config.ini file and exists.

nedtwigg commented 5 years ago

I use goomph on Windows daily, so I'm pretty sure there's no broad compat problem.

First off, ideSetupP2 is an internal task. The only commands we expect users to use are ide and ideClean.

Secondly, are you calling them like this gradlew ideClean ideSetupP2? Or like this:

moley commented 5 years ago

I call it like gradlew ideClean ideSetupP2. If you call my buildfile in this upper example - can you reproduce my problem on a clean machine? By the way - I called gradle idetoo and this resulted in the same error. Did you see my bold text were I described my viewings?

nedtwigg commented 5 years ago

Trygradlew ideClean, then gradlew ide. Does that work? Also, I don't think you should call ideSetupP2, just call ide.

moley commented 5 years ago

OK, calling gradlew ideCleanand gradlew ide in two different calls results in the same error.

nedtwigg commented 5 years ago

I wonder, does projectpath in projectpath/build/oomph-ide.app/Contents/Eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info have spaces? And if so, does putting it somewhere without spaces fix it?

moley commented 5 years ago

projectpath does not contain any spaces - sorry. As told (...The configuration path contains a config.ini where all bundles are shown under the property osgi.bundles and the bundles.info is missing, using mac the bundles.info is referenced in this config.ini file and exists....) the bevaviour is different on both platforms.... Do you have an idea why?

nedtwigg commented 5 years ago

The behavior is different on each platform because each platform has different requirements for how to package an application. .exe on windows, .app folder on mac, etc. I just made a folder with your snippet, and gradle ide & ideClean all work fine on my Windows 10 64-bit box.

The problem might be that eclipse stopped supporting 32-bit: https://www.eclipse.org/lists/eclipse-dev/msg10815.html

Obviously not a great error message if that is indeed the problem...

moley commented 5 years ago

ok, that would be an explanation. I will try to test on a 64 bit VM

moley commented 5 years ago

That was the problem. So perhaps it would be nice to get an error if a not supported architecture is used? If you don't want to add, you can close the bug as well. Thank you for your support

nedtwigg commented 5 years ago

Happy to take a PR for this if it makes it to the top of anyone's todo list :)