Skip to content

Commit

Permalink
Add Timber as external lib to the android project
Browse files Browse the repository at this point in the history
  • Loading branch information
fstephany committed May 23, 2018
1 parent 1ce6887 commit 408e47e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions App-A-Android/BUILD
Expand Up @@ -5,4 +5,7 @@ android_binary(
srcs = glob(["src/main/java/**"]),
resource_files = glob(["src/main/res/**"]),
visibility = ["//visibility:public"],
deps = [
"@timber//aar",
],
)
Expand Up @@ -2,11 +2,14 @@

import android.app.Activity;
import android.os.Bundle;
import timber.log.Timber;
import static timber.log.Timber.DebugTree;

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Timber.plant(new DebugTree());
setContentView(R.layout.activity_main);
}
}
9 changes: 8 additions & 1 deletion WORKSPACE
@@ -1,7 +1,14 @@
# Android

android_sdk_repository(
name = "androidsdk",
api_level = 27,
build_tools_version = "27.0.3",
)

# External deps for android
load("@bazel_tools//tools/build_defs/repo:maven_rules.bzl", "maven_aar")

maven_aar(
name = "timber",
artifact= "com.jakewharton.timber:timber:4.7.0"
)

0 comments on commit 408e47e

Please sign in to comment.