How to convert gradle project to android project

I am using Eclipse ADT and I converted my android project into a gradle project via configure -> convert to a gradle project, in fact I need to convert the gradle project to an android project. How can i do this?

+4
source share
2 answers

Your Android project in Eclipse ADT should usually contain 2 files

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>Android-app</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>com.android.ide.eclipse.adt.ApkBuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>

Once you fix them, your project returns to the standard Android projects in Eclipse.

To use the new build system from Eclipse, try Nodeclipse / Enide Gradle for Eclipse ( marketplace )

Some screenshots for Gradle for Eclipse:

+2

1. eclipse

Eclipse, eclipse . , .

. , gradle, build.gradle .. ( , ).

2. gradle

gradle :

, apply plugin: "eclipse" build.gradle

cd myProject/
gradle eclipse

Eclipse.

build.gradle Eclipse .

gradle Eclipse, STS, , .

IDE, , gradle, IntelliJ IDEA. gradle . Community Edition, .

+1

Source: https://habr.com/ru/post/1534125/


All Articles