shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

some projects fail to properly convert to Leiningen+Clojure project #531

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import project from git (in eclipse) import this project:
git://github.com/clojurewerkz/titanium.git
import it into workspace as "titanium" folder (basically defaults)
click cancel eventually after git clone happened

2. File->New->Project, General->Project
use the same project name as the folder that was cloned (in workspace)
ie. "titanium"

3. now we got generic project, click on it then right-click, Configure->Convert 
to Leiningen Project

What is the expected output? What do you see instead?
at this point you notice the source folders are messed up:
ie. "src.java.org.clojurewerkz.titanium.pipes" is a java package
instead of "org.clojurewerkz.titanium.pipes" being one in src\java\ source 
folder.

Trying to convert to clojure project will fail with some exceptions in Error 
Log view.

What version of the product are you using? On what operating system?
win7 64bit
Eclipse SDK

Version: 4.2.1
Build id: M20120914-1800
  Counterclockwise (Clojure plugin for Eclipse) 0.11.2.201301241829 ccw.feature.feature.group   Counterclockwise team
    Leiningen Support   0.11.2.201301241829 ccw.leiningen.feature.feature.group Counterclockwise team

Please provide any additional information below.
https://youtu.be/2ye-yz1ORKo

Original issue reported on code.google.com by atkaaz on 12 Feb 2013 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 21 Feb 2013 at 9:29

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 28 Feb 2013 at 2:29

GoogleCodeExporter commented 9 years ago
When it tries to create source folders, an exception is generated by the JDT 
because one of the computed source folders lives inside another.

Namely, when titanium's project map is fully computed, there's a test source 
path set to titanium/test, and a resource source path set to 
titanium/test/resources.

To solve this, test source path has to be explicitly overridden, e.g. add:

:test-paths ["test/clojure" "test/java"]

to the project map, and then everything makes sense again.

I'lltry to  modify CCW so this kind of error is reported explicitly to the 
user, rather than silently logged.

Original comment by laurent....@gmail.com on 28 Feb 2013 at 3:34

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 28 Feb 2013 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 28 Feb 2013 at 4:54

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 14 Mar 2013 at 10:45

GoogleCodeExporter commented 9 years ago
I just retried this and I am getting the error that you probably added to let 
us know (I mean this, below: "Cannot nest 'titanium/test/resources' inside 
'titanium/test'. To enable the nesting exclude 'resources/' from 
'titanium/test' "):

Unhandled event loop exception during blocked modal context.

org.eclipse.swt.SWTException: Failed to execute runnable 
(java.lang.reflect.InvocationTargetException)
    at org.eclipse.swt.SWT.error(SWT.java:4397)
    at org.eclipse.swt.SWT.error(SWT.java:4312)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
    at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:960)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
    at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
    at ccw.util.eclipse$run_in_background$fn__11846.invoke(eclipse.clj:291)
    at clojure.lang.AFn.run(AFn.java:24)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1108)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:992)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:137)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:602)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.reflect.InvocationTargetException
    at ccw.util.eclipse$eval11831$fn$reify__11833.run(eclipse.clj:268)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: Could not reset project 
classpath
    at ccw.leiningen.nature$reset_project_build_path$fn__15228.invoke(nature.clj:234)
    at ccw.leiningen.nature$reset_project_build_path.doInvoke(nature.clj:228)
    at clojure.lang.RestFn.invoke(RestFn.java:442)
    at ccw.leiningen.nature$factory$reify__15232$fn__15235.invoke(nature.clj:256)
    ... 2 more
Caused by: Java Model Exception: Java Model Status [Cannot nest 
'titanium/test/resources' inside 'titanium/test'. To enable the nesting exclude 
'resources/' from 'titanium/test']
    at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:784)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3096)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3058)
    at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3111)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    at ccw.leiningen.nature$reset_project_build_path$fn__15228.invoke(nature.clj:232)
    ... 5 more

eclipse.buildId=4.3.0.I20130416-0800
java.version=1.6.0_30
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -splash org.eclipse.platform
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -splash 
org.eclipse.platform

and adding ":test-paths ["test/clojure" "test/java"]" as you said, works, 
thanks!

Original comment by atkaaz on 19 Apr 2013 at 2:41

GoogleCodeExporter commented 9 years ago
Titanium uses the standard test directory layout, with test namespaces being 
under `test` and matching the directory structure. If CCW cannot handle it, it 
also won't be able to handle tens of thousands of other Leiningen-managed 
projects.

Original comment by Michael....@gmail.com on 19 Apr 2013 at 3:47

GoogleCodeExporter commented 9 years ago
Michael, this line causes problems:
https://github.com/clojurewerkz/titanium/blob/master/project.clj#L17

It declares a resources folder nested within the test folder. This is not what 
Leiningen suggests, AFAIK.

If you remove this (apparently not used anymore?) setting, then everything 
should go back to normal with Titanium on CCW.

Original comment by laurent....@gmail.com on 19 Apr 2013 at 4:49

GoogleCodeExporter commented 9 years ago
thanks Laurent, removing that line
:resource-paths ["test/resources"]
works great!
it looks like this after fix:
http://i.imgur.com/A6yPl3E.png

before it looked like this:
http://i.imgur.com/cSXjSP4.png
and after :test-paths fixes (which weren't (as)good) looked like this:
http://i.imgur.com/uXJpBj0.png
and this:
http://i.imgur.com/lwdlqSB.png

Original comment by atkaaz on 20 Apr 2013 at 3:22