在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ksoichiro/gradle-eclipse-aar-plugin开源软件地址(OpenSource Url):https://github.com/ksoichiro/gradle-eclipse-aar-plugin开源编程语言(OpenSource Language):Groovy 99.7%开源软件介绍(OpenSource Introduction):gradle-eclipse-aar-pluginGradle plugin to use Android AAR libraries on Eclipse. Android Studio has been officially released, but some of you still want/are forced to use Eclipse ADT for some reasons. Android Studio has much better build system by integrating Gradle, and many of the remarkable features are unavailable in Eclipse. In particular, many Android libraries are provided with AAR format recently, so it's now big disadvantage for Eclipse to manage these dependencies. This plugin will explode AAR libraries and create "Android Library Project"s or copy JARs for your project by executing just one command, and you just import these projects in Eclipse. Originally I was inspired by this article, then rewrote almost all of it and added many improvements to automate conversion process and to cover several dependency/project conditions. PrerequisitesEclipse ADT is no longer maintained by Google, and it's forked into the Andmore project. This plugin is tested under these conditions. For the original Eclipse ADT Plugin developed by Google, the plugin is tested under the following conditions. UsagePrepare build.gradleIf your project already uses Gradle and Android Studio, just apply this plugin. Gradle 2.1+: buildscript {
repositories {
mavenCentral()
// or jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
plugins {
id 'com.github.ksoichiro.eclipse.aar' version '0.3.1'
}
apply plugin: 'com.android.application' Gradle 2.0 and former: buildscript {
repositories {
mavenCentral()
// Enable this if you use SNAPSHOT
//maven {
// url uri('https://oss.sonatype.org/content/repositories/snapshots/')
//}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.github.ksoichiro:gradle-eclipse-aar-plugin:0.3.1'
}
}
apply plugin: 'com.android.application'
// Apply this plugin
apply plugin: 'com.github.ksoichiro.eclipse.aar' And configure it in repositories {
mavenCentral()
}
// Write your dependencies
dependencies {
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.melnykov:floatingactionbutton:1.0.7'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
}
// Configure eclipse-aar plugin
eclipseAar {
// See "Configurations" for details
androidTarget = 'android-21'
aarDependenciesDir = 'aarDependencies'
// Set to true if you use Andmore. Default is false
andmore = true
}
// Configure android plugin
// (Even if you don't develop with Gradle, write following at least)
android {
compileSdkVersion 1
// Source directory is 'src/main/java' by default.
// This will be added as a classpath entry in .classpath file.
// If you'd like to set src directory other than that,
// override it with sourceSets.main.java.srcDirs like this.
sourceSets {
main {
java.srcDirs = [ 'src' ]
}
}
} Migrate from Eclipse ADT to AndmoreIf you're going to migrate from Eclipse ADT to Andmore, please check the following notes. Remove or edit meta data filesPlease remove the meta data files ( Those files are slightly different between ADT and Andmore - package has been changed Perhaps this plugin can/should overwrite those files in the future, Set andmore flagSet Prepare Gradle or Gradle wrapperInstall Gradle 2.2.1+. Or copy Gradle wrapper files into your project. If you use Gradle wrapper, you don't have to install Gradle.
Generate dependencies$ ./gradlew generateEclipseDependencies JAR dependencies will be copied to Import projects to Eclipse and build app
Run the app
project.properties?Eclipse ADT plugin uses If you don't have But please note that if you have file dependencies ( .classpath files?Eclipse has If you don't have But please note that if you have file dependencies ( Note that .project files?Eclipse has Note that ConfigurationsConfigurations for this plugin are written in
SamplesSee Each projects refer to $ cd /path/to/this/project/root/
$ ./gradlew clean assemble uploadArchives After that, you can try this plugin in each projects. $ cd ./samples/example/
$ ./gradlew generateEclipseDependencies License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论