How to use Gradle to generate Eclipse and Intellij project files for Android projects

前端 未结 6 1783
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 13:30

Is it possible to generate Eclipse and Intellij project files for Android projects using Gradle?

In maven we would do mvn eclipse:eclipse and in PlayFra

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 13:47

    As answered in Issue 57668 by Android team (raised by @arcone)

    Project Member #2 x...@android.com

    The eclipse plugin is not compatible with the android plugin.

    You will not be able to import an Android gradle project into Eclipse using the default Gradle support in Eclipse.

    To make it work in Eclipse we will have to change the Gradle plugin for Eclipse, the same way we are modifying the Gradle support in IntelliJ

    That is Android team is working on gradle plugin for IntelliJ and gradle plugin for Eclipse needs to be updated too.

    What is possible with Eclipse now is

    .1. import the project as general project

    .project

    
    
        OpenSpritz-Android
        
        
        
        
        
        
        
    
    

    import-android-gradle-as-general-project

    .2. Put 2 Eclipse . "dot" files into modules into /OpenSpritz-Android/app/src/main and /OpenSpritz-Android/lib/src/main

    add-eclipse-files

    .project

    
    
        OpenSpritz-Android-app
        
        
        
        
            
                com.android.ide.eclipse.adt.ResourceManagerBuilder
                
                
            
            
                com.android.ide.eclipse.adt.PreCompilerBuilder
                
                
            
            
                org.eclipse.jdt.core.javabuilder
                
                
            
            
                com.android.ide.eclipse.adt.ApkBuilder
                
                
            
        
        
            com.android.ide.eclipse.adt.AndroidNature
            org.eclipse.jdt.core.javanature
        
    
    

    .classpath

    
    
        
        
        
        
        
        
    
    

    .3. Import as Existing Android Code into Workspace

    results

    you can then browse code in familiar way, but even after that you won't be able to run with Eclipse ADT.

    .4.

    Now you can run build and tasks with gradle CLI or Nodeclipse/Enide Gradle for Eclipse (marketplace)

    start

    discuss at https://github.com/Nodeclipse/nodeclipse-1/issues/148

提交回复
热议问题