Allows running Robolectric tests directly from the Android Studio.
This script works with com.android.tools.build:gradle:0.14.0 and Android Studio v0.9.1
dependencies { | |
// Libs folder | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
// ... | |
// Google auth, drive, etc | |
compile 'com.google.code.gson:gson:2.3' | |
compile 'com.google.api-client:google-api-client:1.19.0' | |
compile 'com.google.api-client:google-api-client-android:1.19.0' |
// Base auth task | |
public abstract class AbstractAuthTask extends AsyncTask<Void, Void, Void> { | |
protected final AuthorizationFlow mAuthFlow; | |
AbstractAuthTask(final AuthorizationFlow authFlow) { | |
mAuthFlow = authFlow; | |
} | |
} |
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
{ | |
"cmd": ["/usr/local/Cellar/gcc49/4.9.3/bin/g++-4.9", "-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++", | |
"variants": | |
[ | |
{ | |
"name": "Run", |
public final class CustomTabsKeepAliveService extends Service { | |
private static final Binder sBinder = new Binder (); | |
@Override public IBinder onBind (Intent intent) { | |
return sBinder; | |
} | |
} |
public final class CustomTabsHelper { | |
public static abstract class ChromePackages { | |
public static final String STABLE_PACKAGE = "com.android.chrome"; | |
public static final String BETA_PACKAGE = "com.chrome.beta"; | |
public static final String DEV_PACKAGE = "com.chrome.dev"; | |
public static final String LOCAL_PACKAGE = "com.google.android.apps.chrome"; | |
} | |
public static String sPackageNameToUse; |
public class CustomTabsSceneHelper { | |
/** | |
* A Callback for when the service is connected or disconnected. Use those callbacks to | |
* handle UI changes when the service is connected or disconnected | |
*/ | |
public static interface ConnectionCallback { | |
public void onCustomTabsConnected (); | |
public void onCustomTabsDisconnected (); | |
} |
public class FragmentChromeCustomTabs | |
extends Fragment | |
implements CustomTabsSceneHelper.ConnectionCallback { | |
public static enum CustomTabsAction { | |
GOOGLE_PLUS ("Open Google+", "https://plus.google.com/+ЕгорМалышев"), | |
MEDIUM ("Open Medium", "https://medium.com/@brainail"), | |
ABOUT_ME ("Open About.Me", "https://about.me/brainail"); | |
private final String mActionDescription; |