Git Product home page Git Product logo

gradle-android-eclipse's Introduction

Android Eclipse Generator

A Gradle plug-in that enables generation of Eclipse project files (.project and .classpath) to enable use of the Eclipse IDE for Android projects.

This generator works with the new Android build system.

Based on this stack overflow by Johannes Brodwall.

What It Does

This plug-in hooks into the Gradle eclipse plugin to make it work for Android projects, by doing the following:

  • Adds the following Android source paths:
    • src/main/java
    • src/test/java
    • src/main/resources
    • build/generated/source/buildConfig/debug
    • build/generated/not_namespaced_r_class_sources/debug/r
  • For any dependency packaged as an aar (Android Archive), the aar is extracted into build/exploded-aars
    • each aar-packaged jar is added to the .classpath
  • Adds the Android SDK to the .classpath
  • Updates the Eclipse project compiler settings to match the android.compileOptions in the gradle build

How to Use

Add the following to your build.gradle:

apply plugin: 'com.greensopinion.gradle-android-eclipse'
apply plugin: 'eclipse'

buildscript {
    repositories {
        maven {
          url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
      classpath "gradle.plugin.com.greensopinion.gradle-android-eclipse:gradle-android-eclipse:1.1"
    }
}

eclipse {
  classpath {
    plusConfigurations += [ configurations.compile, configurations.testCompile ]
    downloadSources = true
  }
}

See build.gradle for a complete working example.

Then from the command-line run:

$ gradle eclipse

When done, a .classpath and .project file should be in the current folder.

Contributing

To open this project in Eclipse, first run the following:

$ gradle eclipse

License

Copyright 2017 David Green

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

gradle-android-eclipse's People

Contributors

greensopinion avatar ikws4 avatar mortalis13 avatar rubdos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.