Commit 242837b0 authored by Geoffrey Métais's avatar Geoffrey Métais

Revert "Remove chrome flavor"

This reverts commit bba58dcb.
parent d618950f
...@@ -210,10 +210,14 @@ fi ...@@ -210,10 +210,14 @@ fi
################## ##################
# Compile the UI # # Compile the UI #
################## ##################
PLATFORM="Vanilla"
BUILDTYPE="Debug" BUILDTYPE="Debug"
if [ "$RELEASE" = 1 ]; then if [ "$RELEASE" = 1 ]; then
BUILDTYPE="Release" BUILDTYPE="Release"
fi fi
if [ "$CHROME_OS" = 1 ]; then
PLATFORM="Chrome"
fi
if [ "$BUILD_LIBVLC" = 1 ];then if [ "$BUILD_LIBVLC" = 1 ];then
./gradlew -p libvlc assemble${BUILDTYPE} ./gradlew -p libvlc assemble${BUILDTYPE}
RUN=0 RUN=0
...@@ -224,7 +228,7 @@ else ...@@ -224,7 +228,7 @@ else
else else
ACTION="assemble" ACTION="assemble"
fi fi
TARGET="${ACTION}${GRADLE_ABI}${BUILDTYPE}" TARGET="${ACTION}${PLATFORM}${GRADLE_ABI}${BUILDTYPE}"
CLI="" ./gradlew $TARGET CLI="" ./gradlew $TARGET
fi fi
......
...@@ -22,7 +22,7 @@ android { ...@@ -22,7 +22,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion buildToolsVersion rootProject.ext.buildToolsVersion
flavorDimensions "abi" flavorDimensions "target", "abi"
lintOptions { lintOptions {
abortOnError false abortOnError false
...@@ -110,6 +110,15 @@ android { ...@@ -110,6 +110,15 @@ android {
} }
} }
productFlavors { productFlavors {
vanilla {
dimension "target"
versionCode = 1
}
chrome {
minSdkVersion 19
dimension "target"
versionCode = 2
}
ARMv7 { ARMv7 {
dimension "abi" dimension "abi"
versionCode = 4 versionCode = 4
...@@ -142,15 +151,19 @@ android { ...@@ -142,15 +151,19 @@ android {
def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile) def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
// get the version code of each flavor // get the version code of each flavor
def vlcVersion = manifestParser.getVersionName() def vlcVersion = manifestParser.getVersionName()
def abiVersion = variant.productFlavors.get(0).versionCode def targetVersion = variant.productFlavors.get(0).versionCode
def abiVersion = variant.productFlavors.get(1).versionCode
// set the composite code // set the composite code
variant.mergedFlavor.versionCode = 10000000 + manifestParser.versionCode + abiVersion variant.mergedFlavor.versionCode = targetVersion * 10000000 + manifestParser.versionCode + abiVersion
variant.mergedFlavor.versionName = vlcVersion variant.mergedFlavor.versionName = vlcVersion
//Custom APK name //Custom APK name
variant.outputs.each { output -> variant.outputs.each { output ->
def outputName = "VLC-Android-" + vlcVersion + "-" + variant.productFlavors.get(0).name + ".apk" def outputName = "VLC-Android-"
if (variant.productFlavors.get(0).name != "vanilla")
outputName += variant.productFlavors.get(0).name.toUpperCase() + "-"
outputName += vlcVersion + "-" + variant.productFlavors.get(1).name + ".apk"
output.outputFile = new File(output.outputFile.parentFile, outputName); output.outputFile = new File(output.outputFile.parentFile, outputName);
} }
} }
...@@ -174,6 +187,10 @@ android { ...@@ -174,6 +187,10 @@ android {
sourceSets.test { sourceSets.test {
java.srcDirs = ['test'] java.srcDirs = ['test']
} }
sourceSets.chrome {
manifest.srcFile 'flavors/chrome/AndroidManifest.xml'
res.srcDirs = ['flavors/chrome/res']
}
} }
task generateSources (type: Jar) { task generateSources (type: Jar) {
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.videolan.vlc" >
<uses-sdk
android:minSdkVersion="19" />
<application
android:name="org.videolan.vlc.VLCApplication" >
<activity
android:name="org.videolan.vlc.StartActivity"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- This filter captures protocols without type info -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="rtmp" />
<data android:scheme="rtmpe" />
<data android:scheme="rtmps" />
<data android:scheme="rtp" />
<data android:scheme="rtsp" />
<data android:scheme="mms" />
<data android:scheme="mmsh" />
<data android:scheme="icyx" />
<data android:scheme="httplive" />
<data android:scheme="udp" />
<data android:scheme="vlc" />
</intent-filter>
<!-- This filter captures protocols with type info -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:scheme="rtmp" />
<data android:scheme="rtmpe" />
<data android:scheme="rtmps" />
<data android:scheme="rtp" />
<data android:scheme="rtsp" />
<data android:scheme="mms" />
<data android:scheme="mmsh" />
<data android:scheme="icyx" />
<data android:scheme="httplive" />
<data android:scheme="udp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="file" />
<data android:scheme="ftp" />
<data android:scheme="content" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="video/rmvb" />
<data android:mimeType="video/avi" />
<data android:mimeType="video/mkv" />
<data android:mimeType="application/3gpp*" />
<data android:mimeType="application/mp4" />
<data android:mimeType="application/mpeg*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/sdp" />
<data android:mimeType="application/vnd.3gp*" />
<data android:mimeType="application/vnd.apple.mpegurl" />
<data android:mimeType="application/vnd.dvd*" />
<data android:mimeType="application/vnd.dolby*" />
<data android:mimeType="application/vnd.rn-realmedia*" />
<data android:mimeType="application/x-iso9660-image" />
<data android:mimeType="application/x-extension-mp4" />
<data android:mimeType="application/x-flac" />
<data android:mimeType="application/x-matroska" />
<data android:mimeType="application/x-mpegURL" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/x-quicktimeplayer" />
<data android:mimeType="application/x-shockwave-flash" />
<data android:mimeType="application/xspf+xml" />
<data android:mimeType="misc/ultravox" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="file" />
<data android:scheme="ftp" />
<data android:scheme="content" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*" />
<!-- video -->
<data android:pathPattern=".*\\.3g2" />
<data android:pathPattern=".*\\.3gp" />
<data android:pathPattern=".*\\.3gp2" />
<data android:pathPattern=".*\\.3gpp" />
<data android:pathPattern=".*\\.amv" />
<data android:pathPattern=".*\\.asf" />
<data android:pathPattern=".*\\.avi" />
<data android:pathPattern=".*\\.divx" />
<data android:pathPattern=".*\\.drc" />
<data android:pathPattern=".*\\.dv" />
<data android:pathPattern=".*\\.f4v" />
<data android:pathPattern=".*\\.flv" />
<data android:pathPattern=".*\\.gvi" />
<data android:pathPattern=".*\\.gxf" />
<data android:pathPattern=".*\\.ismv" />
<data android:pathPattern=".*\\.iso" />
<data android:pathPattern=".*\\.m1v" />
<data android:pathPattern=".*\\.m2v" />
<data android:pathPattern=".*\\.m2t" />
<data android:pathPattern=".*\\.m2ts" />
<!-- <data android:pathPattern=".*\\.m3u" /> -->
<data android:pathPattern=".*\\.m3u8" />
<data android:pathPattern=".*\\.mkv" />
<data android:pathPattern=".*\\.mov" />
<data android:pathPattern=".*\\.mp2" />
<data android:pathPattern=".*\\.mp2v" />
<data android:pathPattern=".*\\.mp4" />
<data android:pathPattern=".*\\.mp4v" />
<data android:pathPattern=".*\\.m4v" />
<data android:pathPattern=".*\\.mpe" />
<data android:pathPattern=".*\\.mpeg" />
<data android:pathPattern=".*\\.mpeg1" />
<data android:pathPattern=".*\\.mpeg2" />
<data android:pathPattern=".*\\.mpeg4" />
<data android:pathPattern=".*\\.mpg" />
<data android:pathPattern=".*\\.mpv2" />
<data android:pathPattern=".*\\.mts" />
<data android:pathPattern=".*\\.mtv" />
<data android:pathPattern=".*\\.mxf" />
<data android:pathPattern=".*\\.mxg" />
<data android:pathPattern=".*\\.nsv" />
<data android:pathPattern=".*\\.nut" />
<data android:pathPattern=".*\\.nuv" />
<data android:pathPattern=".*\\.ogm" />
<data android:pathPattern=".*\\.ogv" />
<data android:pathPattern=".*\\.ogx" />
<data android:pathPattern=".*\\.ps" />
<data android:pathPattern=".*\\.rec" />
<data android:pathPattern=".*\\.rm" />
<data android:pathPattern=".*\\.rmvb" />
<data android:pathPattern=".*\\.tod" />
<data android:pathPattern=".*\\.ts" />
<data android:pathPattern=".*\\.tts" />
<data android:pathPattern=".*\\.vob" />
<data android:pathPattern=".*\\.vro" />
<data android:pathPattern=".*\\.webm" />
<data android:pathPattern=".*\\.wm" />
<data android:pathPattern=".*\\.wmv" />
<data android:pathPattern=".*\\.wtv" />
<data android:pathPattern=".*\\.xesc" />
<!-- audio -->
<data android:pathPattern=".*\\.3ga" />
<data android:pathPattern=".*\\.a52" />
<data android:pathPattern=".*\\.aac" />
<data android:pathPattern=".*\\.ac3" />
<data android:pathPattern=".*\\.adt" />
<data android:pathPattern=".*\\.adts" />
<data android:pathPattern=".*\\.aif" />
<data android:pathPattern=".*\\.aifc" />
<data android:pathPattern=".*\\.aiff" />
<data android:pathPattern=".*\\.amr" />
<data android:pathPattern=".*\\.aob" />
<data android:pathPattern=".*\\.ape" />
<data android:pathPattern=".*\\.awb" />
<data android:pathPattern=".*\\.caf" />
<data android:pathPattern=".*\\.dts" />
<data android:pathPattern=".*\\.flac" />
<data android:pathPattern=".*\\.it" />
<data android:pathPattern=".*\\.m4a" />
<data android:pathPattern=".*\\.m4b" />
<data android:pathPattern=".*\\.m4p" />
<data android:pathPattern=".*\\.mid" />
<data android:pathPattern=".*\\.mka" />
<data android:pathPattern=".*\\.mlp" />
<data android:pathPattern=".*\\.mod" />
<data android:pathPattern=".*\\.mpa" />
<data android:pathPattern=".*\\.mp1" />
<data android:pathPattern=".*\\.mp2" />
<data android:pathPattern=".*\\.mp3" />
<data android:pathPattern=".*\\.mpc" />
<data android:pathPattern=".*\\.mpga" />
<data android:pathPattern=".*\\.oga" />
<data android:pathPattern=".*\\.ogg" />
<data android:pathPattern=".*\\.oma" />
<data android:pathPattern=".*\\.opus" />
<data android:pathPattern=".*\\.ra" />
<data android:pathPattern=".*\\.ram" />
<data android:pathPattern=".*\\.rmi" />
<data android:pathPattern=".*\\.s3m" />
<data android:pathPattern=".*\\.spx" />
<data android:pathPattern=".*\\.tta" />
<data android:pathPattern=".*\\.voc" />
<data android:pathPattern=".*\\.vqf" />
<data android:pathPattern=".*\\.w64" />
<data android:pathPattern=".*\\.wav" />
<data android:pathPattern=".*\\.wma" />
<data android:pathPattern=".*\\.wv" />
<data android:pathPattern=".*\\.xa" />
<data android:pathPattern=".*\\.xm" />
</intent-filter>
</activity>
</application>
</manifest>
{
"enableExternalDirectory": true,
"formFactor": "tablet",
"short_name": "VLC",
"name": "VLC for Chrome OS",
"orientation": "landscape",
"packageName": "org.videolan.vlc",
"resize": "reconfigure",
"needsClipboard": true
}
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="chroma_format_default" translatable="false">YV12</string>
</resources>
...@@ -90,7 +90,6 @@ import org.videolan.vlc.interfaces.IRefreshable; ...@@ -90,7 +90,6 @@ import org.videolan.vlc.interfaces.IRefreshable;
import org.videolan.vlc.interfaces.ISortable; import org.videolan.vlc.interfaces.ISortable;
import org.videolan.vlc.media.MediaDatabase; import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.media.MediaUtils; import org.videolan.vlc.media.MediaUtils;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.Permissions; import org.videolan.vlc.util.Permissions;
import org.videolan.vlc.util.VLCInstance; import org.videolan.vlc.util.VLCInstance;
...@@ -212,7 +211,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter ...@@ -212,7 +211,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter
private void setupNavigationView() { private void setupNavigationView() {
mNavigationView = (NavigationView) findViewById(R.id.navigation); mNavigationView = (NavigationView) findViewById(R.id.navigation);
if (AndroidDevices.isChromeBook) { if (TextUtils.equals(BuildConfig.FLAVOR_target, "chrome")) {
MenuItem item = mNavigationView.getMenu().findItem(R.id.nav_directories); MenuItem item = mNavigationView.getMenu().findItem(R.id.nav_directories);
item.setTitle(R.string.open); item.setTitle(R.string.open);
} }
...@@ -828,7 +827,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter ...@@ -828,7 +827,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter
new MRLPanelFragment().show(getSupportFragmentManager(), "fragment_mrl"); new MRLPanelFragment().show(getSupportFragmentManager(), "fragment_mrl");
break; break;
case R.id.nav_directories: case R.id.nav_directories:
if (AndroidDevices.isChromeBook) { if (TextUtils.equals(BuildConfig.FLAVOR_target, "chrome")) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("audio/* video/*"); intent.setType("audio/* video/*");
startActivityForResult(intent, ACTIVITY_RESULT_OPEN); startActivityForResult(intent, ACTIVITY_RESULT_OPEN);
......
...@@ -216,7 +216,7 @@ public class UiTools { ...@@ -216,7 +216,7 @@ public class UiTools {
TextView compiled = (TextView) v.findViewById(R.id.main_compiled); TextView compiled = (TextView) v.findViewById(R.id.main_compiled);
compiled.setText(builder + " (" + builddate + ")"); compiled.setText(builder + " (" + builddate + ")");
TextView textview_rev = (TextView) v.findViewById(R.id.main_revision); TextView textview_rev = (TextView) v.findViewById(R.id.main_revision);
textview_rev.setText(VLCApplication.getAppResources().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR); textview_rev.setText(VLCApplication.getAppResources().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR_abi);
final ImageView logo = (ImageView) v.findViewById(R.id.logo); final ImageView logo = (ImageView) v.findViewById(R.id.logo);
logo.setOnClickListener(new View.OnClickListener() { logo.setOnClickListener(new View.OnClickListener() {
......
...@@ -33,6 +33,7 @@ import android.os.Bundle; ...@@ -33,6 +33,7 @@ import android.os.Bundle;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.preference.EditTextPreference; import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.text.TextUtils;
import org.videolan.libvlc.util.AndroidUtil; import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.vlc.BuildConfig; import org.videolan.vlc.BuildConfig;
...@@ -40,7 +41,6 @@ import org.videolan.vlc.R; ...@@ -40,7 +41,6 @@ import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication; import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.DebugLogActivity; import org.videolan.vlc.gui.DebugLogActivity;
import org.videolan.vlc.gui.helpers.UiTools; import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.VLCInstance; import org.videolan.vlc.util.VLCInstance;
public class PreferencesAdvanced extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { public class PreferencesAdvanced extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
...@@ -59,7 +59,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share ...@@ -59,7 +59,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (AndroidDevices.isChromeBook) { if (TextUtils.equals(BuildConfig.FLAVOR_target, "chrome")) {
findPreference("quit_app").setEnabled(false); findPreference("quit_app").setEnabled(false);
} }
......
...@@ -35,6 +35,7 @@ import android.os.Build; ...@@ -35,6 +35,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.preference.EditTextPreference; import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.text.TextUtils;
import android.widget.Toast; import android.widget.Toast;
import org.videolan.libvlc.util.AndroidUtil; import org.videolan.libvlc.util.AndroidUtil;
...@@ -42,7 +43,6 @@ import org.videolan.vlc.BuildConfig; ...@@ -42,7 +43,6 @@ import org.videolan.vlc.BuildConfig;
import org.videolan.vlc.R; import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication; import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.DebugLogActivity; import org.videolan.vlc.gui.DebugLogActivity;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.VLCInstance; import org.videolan.vlc.util.VLCInstance;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
...@@ -61,7 +61,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share ...@@ -61,7 +61,7 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (AndroidDevices.isChromeBook) { if (TextUtils.equals(BuildConfig.FLAVOR_target, "chrome")) {
findPreference("quit_app").setEnabled(false); findPreference("quit_app").setEnabled(false);
} }
findPreference("debug_logs").setVisible(AndroidUtil.isJellyBeanOrLater || findPreference("debug_logs").setVisible(AndroidUtil.isJellyBeanOrLater ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment