Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abi split support #228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 6 additions & 98 deletions FFmpegAndroid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

// This is the library version used when deploying the artifact
version = VERSION_NAME

android {
compileSdkVersion rootProject.ext.compileSdkVersion as Integer
buildToolsVersion rootProject.ext.buildToolsVersion as String
compileSdkVersion 26
buildToolsVersion "26.0.0"

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion as Integer
targetSdkVersion rootProject.ext.targetSdkVersion as Integer
versionCode rootProject.ext.versionCode as Integer
versionName rootProject.ext.versionName as String
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0.0"
}

sourceSets.main {
Expand All @@ -35,93 +33,3 @@ dependencies {

androidTestCompile 'com.squareup.assertj:assertj-android:1.0.0'
}

group = GROUP

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging POM_PACKAGING

// Add your description here
name 'FFmpeg Android'
description = POM_DESCRIPTION
url POM_URL

// Set your license
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
email 'hitesh@writingminds.com'
}
}
scm {
connection POM_SCM_URL
developerConnection POM_SCM_URL
url POM_URL

}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

// https://github.com/bintray/gradle-bintray-plugin
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = "maven"
// it is the name that appears in bintray when logged
name = "ffmpeg-android"
websiteUrl = POM_URL
vcsUrl = POM_SCM_URL
licenses = ["GPL-3.0"]
publish = true
version {
gpg {
sign = true
passphrase = properties.getProperty("bintray.gpg.password")
}
mavenCentralSync {
sync = true
user = properties.getProperty("bintray.oss.user") //OSS user token
password = properties.getProperty("bintray.oss.password") //OSS user password
close = '1'
}
}
}
}
Binary file added FFmpegAndroid/libs/armeabi/lib_ffmpeg.so
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class FileUtils {

static final String ffmpegFileName = "ffmpeg";
static final String ffmpegFileName = "lib_ffmpeg.so";
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
private static final int EOF = -1;

Expand Down Expand Up @@ -51,8 +51,14 @@ static File getFilesDirectory(Context context) {
return context.getFilesDir();
}

static File getLibDirectory(Context context)
{
File dataDir = new File(context.getFilesDir().getParent());
return new File(dataDir.getAbsolutePath(), "lib");
}

static String getFFmpeg(Context context) {
return getFilesDirectory(context).getAbsolutePath() + File.separator + FileUtils.ffmpegFileName;
return getLibDirectory(context).getAbsolutePath() + File.separator + FileUtils.ffmpegFileName;
}

static String getFFmpeg(Context context, Map<String,String> environmentVars) {
Expand Down
23 changes: 17 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion as Integer
buildToolsVersion rootProject.ext.buildToolsVersion as String
compileSdkVersion 26
buildToolsVersion "26.0.0"

defaultConfig {
applicationId "com.github.hiteshsondhi88.sampleffmpeg"
minSdkVersion rootProject.ext.minSdkVersion as Integer
targetSdkVersion rootProject.ext.targetSdkVersion as Integer
versionCode rootProject.ext.versionCode as Integer
versionName rootProject.ext.versionName as String
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0.0"
}

sourceSets.main {
Expand All @@ -28,6 +28,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

splits {
abi {
enable true

reset()

include "x86", "armeabi", "armeabi-v7a"
universalApk false
}
}
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-beta3'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"

Expand All @@ -17,6 +17,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {url 'https://maven.google.com'}
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 20 11:52:28 GMT+05:30 2016
#Wed Aug 23 11:24:03 AEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip