Skip to content

Commit

Permalink
rename plugins as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jul 12, 2019
1 parent 4e05aa0 commit 04e9c0b
Show file tree
Hide file tree
Showing 211 changed files with 99 additions and 81 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ steps:
- docker-compose#v2.6.0:
run: android-instrumentation-tests
env:
APP_LOCATION: "/app/bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-debug-androidTest.apk"
APP_LOCATION: "/app/bugsnag-plugin-android-jvm/build/outputs/apk/androidTest/debug/bugsnag-plugin-android-jvm-debug-androidTest.apk"
INSTRUMENTATION_DEVICES: '["Google Nexus 5-4.4", "Google Pixel-7.1", "Google Pixel 3-9.0"]'
NDK_VERSION: "r12b"
concurrency: 5
Expand All @@ -152,7 +152,7 @@ steps:
- docker-compose#v2.6.0:
run: android-instrumentation-tests
env:
APP_LOCATION: "/app/bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-debug-androidTest.apk"
APP_LOCATION: "/app/bugsnag-plugin-android-jvm/build/outputs/apk/androidTest/debug/bugsnag-plugin-android-jvm-debug-androidTest.apk"
INSTRUMENTATION_DEVICES: '["Google Nexus 5-4.4", "Google Pixel-7.1", "Google Pixel 3-9.0"]'
NDK_VERSION: "r16b"
concurrency: 5
Expand All @@ -163,7 +163,7 @@ steps:
- docker-compose#v2.6.0:
run: android-instrumentation-tests
env:
APP_LOCATION: "/app/bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-debug-androidTest.apk"
APP_LOCATION: "/app/bugsnag-plugin-android-jvm/build/outputs/apk/androidTest/debug/bugsnag-plugin-android-jvm-debug-androidTest.apk"
INSTRUMENTATION_DEVICES: '["Google Nexus 5-4.4", "Google Pixel-7.1", "Google Pixel 3-9.0"]'
NDK_VERSION: "r19"
concurrency: 5
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "bugsnag-android-ndk/src/main/jni/external/libunwindstack-ndk"]
path = bugsnag-android-ndk/src/main/jni/external/libunwindstack-ndk
[submodule "bugsnag-plugin-android-ndk/src/main/jni/external/libunwindstack-ndk"]
path = bugsnag-plugin-android-ndk/src/main/jni/external/libunwindstack-ndk
url = https://github.com/bugsnag/libunwindstack-ndk
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif
ifeq ($(BROWSER_STACK_ACCESS_KEY),)
@$(error BROWSER_STACK_ACCESS_KEY is not defined)
endif
@APP_LOCATION=/app/bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-debug-androidTest.apk \
@APP_LOCATION=/app/bugsnag-plugin-android-jvm/build/outputs/apk/androidTest/debug/bugsnag-plugin-android-jvm-debug-androidTest.apk \
INSTRUMENTATION_DEVICES='["Google Nexus 5-4.4", "Google Pixel-7.1", "Google Pixel 3-9.0"]' \
docker-compose up --build android-instrumentation-tests

Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Commands can be run on the entire project, or on an individual module:

```shell
./gradlew build // builds whole project
./gradlew bugsnag-android-anr:build // builds bugsnag-android-anr module only
./gradlew bugsnag-plugin-android-anr:build // builds bugsnag-plugin-android-anr module only
```

## Static analysis
Expand Down
2 changes: 0 additions & 2 deletions bugsnag-android-anr/gradle.properties

This file was deleted.

2 changes: 0 additions & 2 deletions bugsnag-android-core/gradle.properties

This file was deleted.

8 changes: 1 addition & 7 deletions bugsnag-android-ndk/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# bugsnag-android-ndk

This module detects NDK signals/exceptions and reports them to bugsnag.

## High-level Overview

This module installs C signal handlers and a CPP exception handler. When a native crash occurs,
it writes a report to disk. This is then converted to a JVM report on the next app launch, and is
delivered to the error reporting API.
This module is identical to [bugsnag-android](../bugsnag-android/README.md) and is published for legacy support.
25 changes: 1 addition & 24 deletions bugsnag-android-ndk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "io.gitlab.arturbosch.detekt"

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
externalNativeBuild.cmake.arguments "-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static"
ndk.abiFilters = project.hasProperty("ABI_FILTERS") ? project.ABI_FILTERS.split(",") :
["arm64-v8a", "armeabi-v7a", "armeabi", "x86", "x86_64"]
}
externalNativeBuild.cmake.path = "CMakeLists.txt"
}

dependencies {
api project(":bugsnag-android-core")
}

apply from: "../gradle/dependencies.gradle"
apply from: "../gradle/release.gradle"
apply from: "../gradle/detekt.gradle"
apply from: "../gradle/checkstyle.gradle"
apply from: "../bugsnag-android/build.gradle"
2 changes: 1 addition & 1 deletion bugsnag-android-ndk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.bugsnag.android.ndk" />
<manifest package="com.bugsnag.android" />
6 changes: 3 additions & 3 deletions bugsnag-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ implementation "com.bugsnag:bugsnag-android:$version"
Which is simpler than manually specifying every single dependency:

```
implementation "com.bugsnag:bugsnag-android-core:$version"
implementation "com.bugsnag:bugsnag-android-ndk:$version"
implementation "com.bugsnag:bugsnag-android-anr:$version"
implementation "com.bugsnag:bugsnag-plugin-android-jvm:$version"
implementation "com.bugsnag:bugsnag-plugin-android-ndk:$version"
implementation "com.bugsnag:bugsnag-plugin-android-anr:$version"
```
6 changes: 3 additions & 3 deletions bugsnag-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ android {
}

dependencies {
api project(":bugsnag-android-core")
api project(":bugsnag-android-anr")
api project(":bugsnag-android-ndk")
api project(':bugsnag-plugin-android-jvm')
api project(':bugsnag-plugin-android-anr')
api project(':bugsnag-plugin-android-ndk')
}

apply from: "../gradle/release.gradle"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bugsnag-android-anr
# bugsnag-plugin-android-anr

This module detects ANRs and reports them to bugsnag.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

dependencies {
api project(":bugsnag-android-core")
api project(':bugsnag-plugin-android-jvm')
}

apply from: "../gradle/dependencies.gradle"
Expand Down
2 changes: 2 additions & 0 deletions bugsnag-plugin-android-anr/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pomName=Bugsnag Android ANR
artefactId=bugsnag-plugin-android-anr
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(BUGSNAG_VERSION 1.0.1)
add_library( # Specifies the name of the library.
bugsnag-android-anr
bugsnag-plugin-android-anr
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
Expand All @@ -19,11 +19,11 @@ find_library( # Defines the name of the path variable that stores the
log )

target_link_libraries( # Specifies the target library.
bugsnag-android-anr
bugsnag-plugin-android-anr
# Links the log library to the target library.
${log-lib})

set_target_properties(bugsnag-android-anr
set_target_properties(bugsnag-plugin-android-anr
PROPERTIES
COMPILE_OPTIONS
-Werror -Wall -pedantic)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal class AnrPlugin : BugsnagPlugin {
private external fun installAnrDetection(sentinelBuffer: ByteBuffer)

override fun initialisePlugin(client: Client) {
System.loadLibrary("bugsnag-android-anr")
System.loadLibrary("bugsnag-plugin-android-anr")
val delegate: (Thread) -> Unit = { handleAnr(it, client) }
val monitor = AppNotRespondingMonitor(delegate)
monitor.start()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* JNI interface between bugsnag-android-anr JVM and C++
* JNI interface between bugsnag-plugin-android-anr JVM and C++
*/
#ifndef BUGSNAG_ANR_H
#define BUGSNAG_ANR_H
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bugsnag-android-core
# bugsnag-plugin-android-jvm

This module detects JVM exceptions and reports them to bugsnag.

Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions bugsnag-plugin-android-jvm/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pomName=Bugsnag Android Core
artefactId=bugsnag-plugin-android-jvm
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ private void loadPlugins() {
try {
pluginInterface.registerPlugin(Class.forName("com.bugsnag.android.NdkPlugin"));
} catch (ClassNotFoundException exc) {
Logger.warn("bugsnag-android-ndk artefact not found on classpath, "
Logger.warn("bugsnag-plugin-android-ndk artefact not found on classpath, "
+ "NDK errors will not be captured.");
}
}
if (config.getDetectAnrs()) {
try {
pluginInterface.registerPlugin(Class.forName("com.bugsnag.android.AnrPlugin"));
} catch (ClassNotFoundException exc) {
Logger.warn("bugsnag-android-anr artefact not found on classpath, "
Logger.warn("bugsnag-plugin-android-anr artefact not found on classpath, "
+ "ANR errors will not be captured.");
}
}
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions bugsnag-plugin-android-ndk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# bugsnag-plugin-android-ndk

This module detects NDK signals/exceptions and reports them to bugsnag.

## High-level Overview

This module installs C signal handlers and a CPP exception handler. When a native crash occurs,
it writes a report to disk. This is then converted to a JVM report on the next app launch, and is
delivered to the error reporting API.
24 changes: 24 additions & 0 deletions bugsnag-plugin-android-ndk/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "io.gitlab.arturbosch.detekt"

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
externalNativeBuild.cmake.arguments "-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static"
ndk.abiFilters = project.hasProperty("ABI_FILTERS") ? project.ABI_FILTERS.split(",") :
["arm64-v8a", "armeabi-v7a", "armeabi", "x86", "x86_64"]
}
externalNativeBuild.cmake.path = "CMakeLists.txt"
}

dependencies {
api project(':bugsnag-plugin-android-jvm')
}

apply from: "../gradle/dependencies.gradle"
apply from: "../gradle/release.gradle"
apply from: "../gradle/detekt.gradle"
apply from: "../gradle/checkstyle.gradle"
2 changes: 2 additions & 0 deletions bugsnag-plugin-android-ndk/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pomName=Bugsnag Android NDK
artefactId=bugsnag-plugin-android-ndk
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions bugsnag-plugin-android-ndk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.bugsnag.android.ndk" />
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions dockerfiles/Dockerfile.android-base
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ WORKDIR /app
COPY gradlew build.gradle settings.gradle gradle.properties /app/
COPY gradle/ /app/gradle/
COPY bugsnag-android/ bugsnag-android/
COPY bugsnag-android-anr/ bugsnag-android-anr/
COPY bugsnag-android-core/ bugsnag-android-core/
COPY bugsnag-android-ndk/ bugsnag-android-ndk/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-plugin-android-jvm/ bugsnag-plugin-android-jvm/
COPY bugsnag-plugin-android-ndk/ bugsnag-plugin-android-ndk/
COPY examples/ examples/
COPY scripts/ scripts/

Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/Dockerfile.android-builder
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ WORKDIR /app
COPY gradlew build.gradle settings.gradle gradle.properties /app/
COPY gradle/ /app/gradle/
COPY bugsnag-android/ bugsnag-android/
COPY bugsnag-android-anr/ bugsnag-android-anr/
COPY bugsnag-android-core/ bugsnag-android-core/
COPY bugsnag-android-ndk/ bugsnag-android-ndk/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-plugin-android-jvm/ bugsnag-plugin-android-jvm/
COPY bugsnag-plugin-android-ndk/ bugsnag-plugin-android-ndk/
COPY examples/ examples/
COPY scripts/ scripts/

Expand Down
7 changes: 4 additions & 3 deletions dockerfiles/Dockerfile.android-instrumentation-tests
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ WORKDIR /app
COPY gradlew build.gradle settings.gradle gradle.properties /app/
COPY gradle/ /app/gradle/
COPY bugsnag-android/ bugsnag-android/
COPY bugsnag-android-anr/ bugsnag-android-anr/
COPY bugsnag-android-core/ bugsnag-android-core/
COPY bugsnag-android-ndk/ bugsnag-android-ndk/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-plugin-android-jvm/ bugsnag-plugin-android-jvm/
COPY bugsnag-plugin-android-ndk/ bugsnag-plugin-android-ndk/
COPY examples/ examples/
COPY scripts/ scripts/

Expand All @@ -30,5 +31,5 @@ RUN scripts/install-ndk.sh
RUN ./gradlew

# Everything above this point should be derived from android-base
RUN sed --in-place="" --expression='s/"armeabi",//' bugsnag-android-anr/build.gradle bugsnag-android-ndk/build.gradle
RUN sed --in-place="" --expression='s/"armeabi",//' bugsnag-plugin-android-anr/build.gradle bugsnag-plugin-android-ndk/build.gradle
CMD ./scripts/build-instrumentation-tests.sh && ./scripts/run-instrumentation-test.sh
15 changes: 8 additions & 7 deletions dockerfiles/Dockerfile.android-linter
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ WORKDIR /app
COPY gradlew build.gradle settings.gradle gradle.properties /app/
COPY gradle/ /app/gradle/
COPY bugsnag-android/ bugsnag-android/
COPY bugsnag-android-anr/ bugsnag-android-anr/
COPY bugsnag-android-core/ bugsnag-android-core/
COPY bugsnag-android-ndk/ bugsnag-android-ndk/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-plugin-android-jvm/ bugsnag-plugin-android-jvm/
COPY bugsnag-plugin-android-ndk/ bugsnag-plugin-android-ndk/
COPY examples/ examples/
COPY scripts/ scripts/

Expand All @@ -35,11 +36,11 @@ RUN apt-get install -y cppcheck
COPY examples/sdk-app-example/ examples/sdk-app-example/
COPY config/ config/

RUN sed --in-place="" --expression="s/'armeabi',//" bugsnag-android-anr/build.gradle \
bugsnag-android-ndk/build.gradle examples/sdk-app-example/build.gradle
RUN sed --in-place="" --expression="s/'armeabi',//" bugsnag-plugin-android-anr/build.gradle \
bugsnag-plugin-android-ndk/build.gradle examples/sdk-app-example/build.gradle

CMD ./gradlew lint checkstyle detekt && \
cppcheck --enable=warning,performance bugsnag-android-anr/src/main/jni && \
cppcheck --enable=warning,performance bugsnag-android-ndk/src/main/jni -i \
bugsnag-android-ndk/src/main/jni/deps -i bugsnag-android-ndk/src/main/jni/external
cppcheck --enable=warning,performance bugsnag-plugin-android-anr/src/main/jni && \
cppcheck --enable=warning,performance bugsnag-plugin-android-ndk/src/main/jni -i \
bugsnag-plugin-android-ndk/src/main/jni/deps -i bugsnag-plugin-android-ndk/src/main/jni/external

2 changes: 1 addition & 1 deletion examples/sdk-app-example/ndk_local_setup.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BugsnagTestNdkSetupTask extends DefaultTask {
}
} catch (Exception e) {} // some configurations cannot be directly resolved
}
throw new Exception("SOLUTION: The bugsnag-android-ndk file was not found, please run `./gradlew ndk:assembleRelease`")
throw new Exception("SOLUTION: The bugsnag-plugin-android-ndk file was not found, please run `./gradlew ndk:assembleRelease`")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ExampleActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.main)
setupToolbarLogo()
performAdditionalBugsnagSetup()

val view: View = findViewById(R.id.btn_fatal_crash)
view.setOnClickListener(::crashUnhandled)
Expand Down Expand Up @@ -172,11 +173,9 @@ class ExampleActivity : AppCompatActivity() {

@Suppress("UNUSED_PARAMETER")
fun readDocs(view: View) {
Bugsnag.init(this)
//
// val uri = Uri.parse("https://docs.bugsnag.com/platforms/android/sdk/")
// val intent = Intent(Intent.ACTION_VIEW, uri)
// startActivity(intent)
val uri = Uri.parse("https://docs.bugsnag.com/platforms/android/sdk/")
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}

private fun generateUserMetaData(): MetaData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ExampleApplication : Application() {

override fun onCreate() {
super.onCreate()
Bugsnag.init(this)
}

}
10 changes: 8 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
include ":bugsnag-android", ":bugsnag-android-core", ":bugsnag-android-anr",
":bugsnag-android-ndk", ":sdkAppExample"
include(
":bugsnag-android",
":bugsnag-android-ndk",
':bugsnag-plugin-android-jvm',
':bugsnag-plugin-android-anr',
':bugsnag-plugin-android-ndk',
":sdkAppExample"
)
project(":sdkAppExample").projectDir = new File("examples/sdk-app-example")

0 comments on commit 04e9c0b

Please sign in to comment.