mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
playback/player: android: Move to gradle based build
This commit is contained in:
parent
048de74441
commit
e8906735ae
16 changed files with 150 additions and 108 deletions
|
@ -1,10 +1,15 @@
|
|||
EXTRA_DIST = \
|
||||
AndroidManifest.xml \
|
||||
jni/Android.mk \
|
||||
jni/player.c \
|
||||
res/layout/main.xml \
|
||||
res/values/strings.xml \
|
||||
src/org/freedesktop/gstreamer/Player.java \
|
||||
src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java \
|
||||
src/org/freedesktop/gstreamer/player/Play.java
|
||||
|
||||
build.gradle \
|
||||
gradle.properties \
|
||||
settings.gradle \
|
||||
app/build.gradle \
|
||||
app/proguard-rules.pro \
|
||||
app/src/main/AndroidManifest.xml \
|
||||
app/src/main/java/org/freedesktop/gstreamer/Player.java \
|
||||
app/src/main/java/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java \
|
||||
app/src/main/java/org/freedesktop/gstreamer/player/Play.java \
|
||||
app/src/main/jni/Android.mk \
|
||||
app/src/main/jni/Application.mk \
|
||||
app/src/main/jni/player.c \
|
||||
app/src/main/res/layout/main.xml \
|
||||
app/src/main/res/values/strings.xml
|
||||
|
|
73
playback/player/android/app/build.gradle
Normal file
73
playback/player/android/app/build.gradle
Normal file
|
@ -0,0 +1,73 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
|
||||
def getNdkCommandLine(ndkRoot, target) {
|
||||
def gstRoot
|
||||
|
||||
if (project.hasProperty('gstAndroidRoot'))
|
||||
gstRoot = project.gstAndroidRoot
|
||||
else
|
||||
gstRoot = System.properties['user.home'] + '/cerbero/dist/android_arm'
|
||||
|
||||
if (ndkRoot == null)
|
||||
throw new GradleException('NDK not configured')
|
||||
|
||||
return ["$ndkRoot/ndk-build",
|
||||
'NDK_PROJECT_PATH=build',
|
||||
'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
|
||||
'NDK_APPLICATION_MK=src/main/jni/Application.mk',
|
||||
'GSTREAMER_JAVA_SRC_DIR=src/main/java',
|
||||
"GSTREAMER_ROOT_ANDROID=$gstRoot",
|
||||
target]
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
// Avoid using the built in JNI generation plugin
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = ['build/libs']
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "org.freedesktop.gstreamer.play"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 22
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
// Before compiling our app, prepare NDK code
|
||||
tasks.withType(JavaCompile) {
|
||||
compileTask -> compileTask.dependsOn ndkBuild
|
||||
}
|
||||
|
||||
// Need to call clean on NDK ourselves too
|
||||
clean.dependsOn 'ndkClean'
|
||||
|
||||
// Build native code using mk files like on Eclipse
|
||||
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
|
||||
commandLine getNdkCommandLine(android.ndkDirectory, 'all')
|
||||
}
|
||||
|
||||
task ndkClean(type: Exec, description: 'Clean JNI code built via NDK') {
|
||||
commandLine getNdkCommandLine(android.ndkDirectory, 'clean')
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
}
|
17
playback/player/android/app/proguard-rules.pro
vendored
Normal file
17
playback/player/android/app/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /home/arun/code/android/sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
|
@ -1,13 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.freedesktop.gstreamer.play"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
|
||||
package="org.freedesktop.gstreamer.play">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-feature android:glEsVersion="0x00020000"/>
|
||||
|
||||
<application android:label="@string/app_name">
|
||||
<activity android:name=".Play"
|
||||
android:label="@string/app_name">
|
||||
|
@ -174,7 +173,6 @@
|
|||
<data android:pathPattern=".*\\.XESC" />
|
||||
|
||||
<!-- audio -->
|
||||
|
||||
<data android:pathPattern=".*\\.3ga" />
|
||||
<data android:pathPattern=".*\\.a52" />
|
||||
<data android:pathPattern=".*\\.aac" />
|
||||
|
@ -341,8 +339,6 @@
|
|||
<data android:scheme="udp" />
|
||||
</intent-filter>
|
||||
|
||||
|
||||
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
1
playback/player/android/app/src/main/jni/Application.mk
Normal file
1
playback/player/android/app/src/main/jni/Application.mk
Normal file
|
@ -0,0 +1 @@
|
|||
APP_PLATFORM = 15
|
23
playback/player/android/build.gradle
Normal file
23
playback/player/android/build.gradle
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="gst-play" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
18
playback/player/android/gradle.properties
Normal file
18
playback/player/android/gradle.properties
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
1
playback/player/android/settings.gradle
Normal file
1
playback/player/android/settings.gradle
Normal file
|
@ -0,0 +1 @@
|
|||
include ':app'
|
Loading…
Reference in a new issue