diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..16f7e8aec9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Android generated +bin +gen +lint.xml + +# IntelliJ IDEA +.idea +*.iml +*.ipr +*.iws +classes +gen-external-apklibs + +# Eclipse +.project +.classpath +.settings +.checkstyle + +# Gradle +.gradle +build +out + +# Maven +target +release.properties +pom.xml.* + +# Ant +ant.properties +local.properties +proguard.cfg +proguard-project.txt + +# Other +.DS_Store +dist +tmp diff --git a/README.md b/README.md index 7efc281f85..6faf3a264b 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,22 @@ accompanying demo application. To get started: ## Using Gradle ## -ExoPlayer can also be built using Gradle. For a complete list of tasks, run: +ExoPlayer can also be built using Gradle. You can include it as a dependent project and build from source. e.g. -./gradlew tasks +``` +// setting.gradle +include ':app', ':..:ExoPlayer:library' + +// app/build.gradle +dependencies { + compile project(':..:ExoPlayer:library') +} +``` + +If you want to use ExoPlayer as a jar, run: + +``` +./gradlew jarRelease +``` + +and copy library.jar to the libs-folder of your new project. diff --git a/build.gradle b/build.gradle index 2d29f854be..a444cfb512 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.10.+' + classpath 'com.android.tools.build:gradle:0.12.+' } } diff --git a/library/build.gradle b/library/build.gradle index 5b751a0820..68a489b08a 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -36,3 +36,14 @@ android { dependencies { } + +android.libraryVariants.all { variant -> + def name = variant.buildType.name + if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { + return; // Skip debug builds. + } + def task = project.tasks.create "jar${name.capitalize()}", Jar + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + artifacts.add('archives', task); +}