2012-07-31 1 views
1

나는 헤드리스 이클립스 빌드를 실행하려고하지만 막혀있다. 필자가 생각하기로는 Python의 PyDev 코드 분석을 사용하여 Eclipse GUI를 실행하지 않아도된다는 것이다. 필자는 코드 분석 (pyflakes, pylint 등)을 수행하는 다른 명령 행 도구에 대해 알고 있습니다.커맨드 라인에서 PyDev 코드 분석을 실행할 수 있습니까?

java -jar /path/to/eclipse/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -noSplash -data "/path/to/workspace" -application org.eclipse.jdt.apt.core.aptBuild 

내 자바 버전 1.6.0_31, 내 이클립스 버전은 3.7.2이며, 내 PyDev의 버전은 2.5.0이다 :

내가 지금까지 가지고있는 명령입니다.

명령을 실행하면 작동하는 것처럼 보이지만 오류나 경고가 발생하지 않습니다.

!ENTRY org.eclipse.equinox.preferences 4 2 2012-07-30 17:48:39.612 
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.preferences". 
!STACK 0 
java.lang.ExceptionInInitializerError 
    at org.eclipse.debug.internal.ui.DebugUIPreferenceInitializer.setDefault(DebugUIPreferenceInitializer.java:186) 
    at org.eclipse.debug.internal.ui.DebugUIPreferenceInitializer.setThemeBasedPreferences(DebugUIPreferenceInitializer.java:204) 
    at org.eclipse.debug.internal.ui.DebugUIPreferenceInitializer.initializeDefaultPreferences(DebugUIPreferenceInitializer.java:79) 
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:281) 
..... TRUNCATED ...... 

!ENTRY org.eclipse.osgi 4 0 2012-07-30 17:48:39.622 
!MESSAGE An error occurred while automatically activating bundle org.eclipse.debug.ui (42). 
!STACK 0 
org.osgi.framework.BundleException: Exception in org.eclipse.debug.internal.ui.DebugUIPlugin.start() of bundle org.eclipse.debug.ui. 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) 
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) 
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299) 
..... TRUNCATED ....... 

java.lang.IllegalStateException: Workbench has not been created yet. 
    at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92) 
    at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.startup(LaunchingResourceManager.java:546) 
    at org.eclipse.debug.internal.ui.DebugUIPlugin.getLaunchingResourceManager(DebugUIPlugin.java:315) 
    at org.eclipse.debug.internal.ui.DebugUIPlugin.start(DebugUIPlugin.java:516) 
..... TRUNCATED ...... 

!ENTRY org.eclipse.osgi 4 0 2012-07-30 17:48:39.624 
!MESSAGE An error occurred while automatically activating bundle org.eclipse.debug.core (41). 
!STACK 0 
org.osgi.framework.BundleException: Exception in org.eclipse.debug.core.DebugPlugin.start() of bundle org.eclipse.debug.core. 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) 
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) 
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) 
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299) 
..... TRUNCATED ...... 

내 의심의 PyDev는 오류/경고를 렌더링하는 GUI를 필요로한다는 것입니다 :

... 
PyDev: Analyzing 29 of 33 (forms.py) 
PyDev: Analyzing 29 of 33 (forms.py) 
PyDev: Analyzing 29 of 33 (forms.py) 
PyDev: Analyzing 29 of 33 (forms.py) 
... 

내가 tail -f /path/to/workspace/.metadata/.log 경우에, 나는 거대한 스택 추적을 얻을.

답변

2

PyDev는 오류/경고를 렌더링하기 위해 gui가 필요하며 일반적으로 명령 행에서 사용하기 위해 완료되지 않았습니다 ... 이제는 말하면서, 코드 분석을 실행하지 않는 단위 테스트가 있습니다. gui (또는 심지어로드 된 일식),하지만 작동하도록 인터프리터/프로젝트 메모리를 구성해야합니다.

참조 : Eclipse 워크 벤치를 필요로하지 않고 코드 분석을 시험

https://github.com/aptana/Pydev/blob/development/plugins/com.python.pydev.analysis/tests/com/python/pydev/analysis/OccurrencesAnalyzerTest.java

https://github.com/aptana/Pydev/blob/development/plugins/com.python.pydev.analysis/tests/com/python/pydev/analysis/AnalysisTestsBase.java

전혀로드 할 (예 : 심지어 헤드리스를 실행하는 일식 필요하지 않습니다 - 간단한 자바 프로그램으로 실행될 수 있지만 CLASSPATH에서 PyDev를 사용하여 java main ([])을 수행하고 해당 API를 사용하여 PyDev 및 프로젝트/pythonpath에서 사용되는 인터프리터를 올바르게 설정해야합니다. .

테스트 세트를 살펴볼 수 있습니다 (예 : CodeCompletionTestsBase/AnalysisTestsBase와 같은 수퍼 클래스도 확인해야 함).

참고 : 같은 주가 다른 사람에 의해 사용될 수있다 ([]), ... 구현 참고로

을, PyDev에 대한 패치를 제공하시기 바랍니다 같은 주요 아마 수집해야 모두를 생성 할 경우 실행중인 쉘의 현재 PYTHONPATH 항목은 인터프리터에있는 모든 항목을 구성합니다 ... 또한 트리의 모든 파일을 분석 할 수 있도록 매개 변수로 디렉토리를 수신해야합니다 (시작이 아마도 가장 많이 걸릴 것입니다 PyDev 코드 분석이 시동시에 많은 것을 캐싱하고 RAM의 정보를 사용하기 위해 수행 되었기 때문에 한 번의 실행으로 가능한 한 많은 파일을 분석하는 것이 이상적입니다. 항상 살아있는 서버 프로세스?).

관련 문제