Set up no-op package (#425)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/425 Incomplete implementation that should allow for most uses as a release-only package. Next steps: - Integrate sample app with this. - Set up CI to build sample app in release mode with this. - Register with JCenter. - Automatically publish to JCenter as part of our release step. Reviewed By: jknoxville Differential Revision: D15146823 fbshipit-source-id: 3ad058dce7b0395721c6e6715d44d4d51b1834da
This commit is contained in:
committed by
Facebook Github Bot
parent
3771026eeb
commit
db5d486c6f
4
android/no-op/src/main/AndroidManifest.xml
Normal file
4
android/no-op/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.facebook.flipper">
|
||||
</manifest>
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*/
|
||||
package com.facebook.flipper.android;
|
||||
|
||||
import android.content.Context;
|
||||
import com.facebook.flipper.core.FlipperClient;
|
||||
|
||||
public final class AndroidFlipperClient {
|
||||
public static FlipperClient getInstance(Context context) {
|
||||
return new NoOpAndroidFlipperClient();
|
||||
}
|
||||
|
||||
public static FlipperClient getInstanceIfInitialized() {
|
||||
return new NoOpAndroidFlipperClient();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
package com.facebook.flipper.android;
|
||||
|
||||
import com.facebook.flipper.core.FlipperClient;
|
||||
import com.facebook.flipper.core.FlipperPlugin;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class NoOpAndroidFlipperClient implements FlipperClient {
|
||||
|
||||
@Override
|
||||
public void addPlugin(FlipperPlugin plugin) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends FlipperPlugin> T getPlugin(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends FlipperPlugin> T getPluginByClass(Class<T> cls) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePlugin(FlipperPlugin plugin) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe() {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
package com.facebook.flipper.core;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface FlipperClient {
|
||||
void addPlugin(FlipperPlugin plugin);
|
||||
|
||||
@Nullable
|
||||
<T extends FlipperPlugin> T getPlugin(String id);
|
||||
|
||||
@Nullable
|
||||
<T extends FlipperPlugin> T getPluginByClass(Class<T> cls);
|
||||
|
||||
void removePlugin(FlipperPlugin plugin);
|
||||
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
|
||||
void unsubscribe();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
package com.facebook.flipper.core;
|
||||
|
||||
public interface FlipperPlugin {}
|
||||
Reference in New Issue
Block a user