Skip to content

Commit

Permalink
Merge pull request #44 from BaristaVentures/release/0.6.2
Browse files Browse the repository at this point in the history
Release/0.6.2
  • Loading branch information
danielgomezrico authored Jun 9, 2017
2 parents b250c57 + c6d2161 commit fdce79b
Show file tree
Hide file tree
Showing 84 changed files with 637 additions and 921 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

# v 0.6.2

- Remove extra resources on PivotalTracker reporter module.
- Update dependencies.
- Simplify the use of properties view.
- Hide library resources to user.

# v 0.6.1 (~~0.6~~ BROKEN)

- Update to Kotlin 1.1.1.
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](img/logo.png)
![](img/logo.jpg)

[![Download](https://api.bintray.com/packages/barista-ventures/maven/debugartist/images/download.svg)](https://bintray.com/barista-ventures/maven/debug-artist/_latestVersion)
[![codecov](https://codecov.io/gh/BaristaVentures/debug-artist/branch/master/graph/badge.svg)](https://codecov.io/gh/BaristaVentures/debug-artist)
Expand All @@ -10,27 +10,33 @@ libraries like [Leakcanary](https://github.com/square/leakcanary) and others wit

Library contains:
- [Debug Drawer Menu](docs/debug-drawer.md): right menu with features for development, (*yeah, it's for you! developer!*).
* __Note:__ check [shake to report bug feature](docs/custom-bug-report-service.md)

- [ViewServer](https://github.com/romainguy/ViewServer): helps to debug layouts with more devices.

## Add to gradle project
## Some Comments

```groovy
repositories { jcenter() }
dependencies { compile("com.baristav.debugartist:debugartist:<library-version>@aar") { transitive = true } }
```
- If you want to differentiate release/staging/debug builds on the drawer you need to add:

__Note:__ check [cusartom-bug-report-service](docs/custom-bug-report-service.md) to
```
buildTypes {
debug {
versionNameSuffix "-staging" // THIS LINE
//...
}
//...
}
```

## Publish
Looks like we cant get

- You need to create `lib/bintray.properties` with the variables declared on `lib/bintray.properties.example`.
## Add to gradle project

```groovy
repositories { jcenter() }
dependencies { compile("com.baristav.debugartist:debugartist:<library-version>@aar") { transitive = true } }
```
cp lib/gradle.properties.example lib/gradle.properties
```

- To Sync with Maven Central you need to get auth tokens from: https://oss.sonatype.org/
- Run `scripts/deploy.sh` to upload to BinTray (jcenter).

## Thanks to
- All feature developers!
Expand Down
17 changes: 17 additions & 0 deletions lib/bintray.gradle → bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.jfrog.bintray'

def areBinTrayPropertiesDefined() {
["BINTRAY_USER",
"BINTRAY_USER_ORG",
"BINTRAY_PASSWORD",
"BINTRAY_API_KEY",
"BINTRAY_GPG_PASSPHRASE"].each {

if (!hasProperty(it)) {
return false
}
}
}

if (areBinTrayPropertiesDefined()) {
return
}

version = VERSION_NAME
group = GROUP

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
repositories { jcenter() }

dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath plugs.kotlin
classpath plugs.gradleVersions
Expand Down
14 changes: 9 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
machine:
environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-3.3/bin:$PATH"
GRADLE_VERSION: "gradle-3.5"
PATH: "~/$CIRCLE_PROJECT_REPONAME/$GRADLE_VERSION/bin:$PATH"

TERM: "dumb"
ADB_INSTALL_TIMEOUT: "10"

GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
_JAVA_OPTIONS: "-Xms512m -Xmx1024m"

dependencies:
cache_directories:
- ~/.android
- ~/android
- ~/.gradle
pre:
- wget "https://services.gradle.org/distributions/gradle-3.3-bin.zip"; unzip gradle-3.3-bin.zip
- echo y | android update sdk --no-ui --all --filter android-25,build-tools-25.0.2,tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository
# Install dependencies
- wget "https://services.gradle.org/distributions/$GRADLE_VERSION-bin.zip"; unzip $GRADLE_VERSION-bin.zip
- sh scripts/install-dependencies.sh

# BinTray
# Create config files based on all env variables
- PROPERTIES_FILE=lib/bintray.properties sh scripts/cp-env-to-properties.sh
- PROPERTIES_FILE=pivotaltracker-reporter/bintray.properties sh scripts/cp-env-to-properties.sh
- sh scripts/cp-env-to-properties.sh
Expand All @@ -28,6 +33,5 @@ test:
- cp -r lib/build/reports $CIRCLE_TEST_REPORTS
- cp -r lib/build/jacoco $CIRCLE_TEST_REPORTS
- cp -r lib/build/test-results $CIRCLE_TEST_REPORTS

post:
- bash <(curl -s https://codecov.io/bash) -f "$CIRCLE_TEST_REPORTS/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml"
18 changes: 10 additions & 8 deletions deps.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
ext {
setup = [buildTools: "25.0.2",
setup = [buildTools: "25.0.3",
compileSdk: 25,
minSdk : 15,
targetSdk : 25]

versions = [supportLibrary: "25.0.0",
kotlin : "1.1.1",
spek : "1.1.0-beta2"]
versions = [supportLibrary: "25.3.1",
kotlin : "1.1.2-3",
retrofit : "2.3.0",
okHttp : "3.8.0",
rxJava : "1.3.0"]

plugs = [kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
plugs = [kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
gradleVersions: 'com.github.ben-manes:gradle-versions-plugin:0.14.0']

deps = [appCompat : "com.android.support:appcompat-v7:$versions.supportLibrary",
supportDesign: "com.android.support:design:$versions.supportLibrary",
deps = [appCompat : "com.android.support:appcompat-v7:${versions.supportLibrary}",
supportDesign: "com.android.support:design:${versions.supportLibrary}",

kotlinStdLib: "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"]
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"]
}
58 changes: 46 additions & 12 deletions docs/custom-bug-report-service.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# Shake to Report Bug

![](img/report-bug.jpg)
This feature try to help your tester users report bugs into your team with all the needed data
you need (device info, screenshots, logs, tags, etc).

When this feature is enabled will be checking if you shake your device, on shake takes an screenshot
and starts a new activity with the provided . This builder enable the menu
to send the repository to the new activity and then build it there.
Flow:
1. *Tester/You* want to report a bug to your team.
1. *Tester/You* shake the device with the `debug-artist`.
1. *Tester/You* touch send.
1. Bug `Card/Story` is created in your third party ticket system.

The idea is to allow custom bug repositories so build your own!
All your `Card/Story` will be created with:

- Device Logs.
- Current screen screenshot.
- Custom title/description.
- Default tags if able.
- Default properties (api host url, or any variable data you want to see)

Sample of report view:

![](img/shake-to-report.jpg)

If enabled device shake will take an screenshot and start a new activity with the provided `BugReporter.Builder`.
This builder enable the menu to send the repository to the new activity and then build it there.

Supported third party bug/story/card trackers:
The idea is to allow custom bug repositories so build your own!
Supported third party `Card/Story` trackers:

- [Pivotal Tracker](https://www.pivotaltracker.com/)
- Trello (soon)
Expand All @@ -17,28 +34,45 @@ Supported third party bug/story/card trackers:

# How to use it

1. Add the library
1. Add the library you need (in this case `pivotal tracker reporter`)

```groovy
debugCompile("com.baristav.debugartist:reporter_pivotal:0.6.1@aar") { transitive = true }
```

2. Create the instance of the `Builder` you need, in this case will be the `PivotalBugRepositoryBuilder`:


- From Kotlin:
```
val repositoryBuilder = PivotalBugRepositoryBuilder("project-key",
"project-id",
propertiesToInclude,
defaultTags);
```

BugRepository.Builder repositoryBuilder =
new PivotalBugRepositoryBuilder("project-key",
- From Java:
```java
PivotalBugRepositoryBuilder repositoryBuilder =
new PivotalBugRepositoryBuilder("project-key",
"project-id",
propertiesToInclude,
new String[] { "android-sample" });
defaultTags);

```

3. Add the button with the builder to

- From Kotlin:
```kotlin
val debugDrawer = DebugDrawer(MyApplication.sInstance, this)
//...
.withShakeToReportBugSwitch(false, repositoryBuilder)
```
mDebugDrawer = new DebugDrawer(MyApplication.sInstance, this)

- From Java:
```java
DebugDrawer debugDrawer = new DebugDrawer(MyApplication.sInstance, this)
//...
.withShakeToReportBugSwitch(false, repositoryBuilder)
```
Expand All @@ -49,4 +83,4 @@ You will need to create 2 classes that inherit from:
- `BugRepository.Builder`: know how to build the repository with its dependencies. Added to allow
the menu to send the dependencies to the report bug activity, build it and use it there.

- `BugRepository`: the repository itself that know how to use the custom service api to create.
- `BugRepository`: the repository itself that know how to use the custom service api to create.
49 changes: 43 additions & 6 deletions docs/debug-drawer.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
# Debug Drawer

![](img/debug_drawer.jpg)
![](img/debug-drawer.jpg)

## How to use it

Add this on each activity `setContentView` so your child activities always add it to each activity:
**Please** check the [sample/](sample/) project.

```
debugDrawer = new DebugDrawer(appInstance, activityInstance)
1. Add this on each activity `onResume` so your child activities always add it to each activity:

Java:
```java
@Override
protected void onResume() {
super.onResume();

String[] hosts = new String[] { "Value 1", "Value 2" };

// Create debug drawer with selected features
mDebugDrawer = new DebugDrawer(applicationContext, activityContext)
.withScalpelSwitch((ScalpelFrameLayout) findViewById(R.id.scalpelLayout))
.with_<feature>_()
.withLeakCanarySwitch(true)
.withPicassoLogsSwitch(true)
.withStethoSwitch(true)
// .withShakeToReportBugSwitch(false, repositoryBuilder)
.withDivider() // a line like this ------------------ in the drawer
.withLynksButton()
.withPhoenixRestartButton(this)
.withDivider()
.withInputItem(2, "Host", this)
.withSpinnerItem(1, "Spinner with item selected by index", hosts, 0, this)
.withDivider()
.withInfoProperties(getProperties());
.withInfoProperties(dictionaryWithProperties);

// Enable view debuger on some devices
ViewServer.get(this).addWindow(this);
}
```

2. Release resources on onPause:

Java:

```java
@Override
protected void onPause() {
super.onPause();

mDebugDrawer.release();
ViewServer.get(this).removeWindow(this);
}
```

### Features:
Expand Down
Binary file added docs/img/debug-drawer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/shake-to-report.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Publish

- You need to create `lib/bintray.properties` with the variables declared on `lib/bintray.properties.example`.

```
cp lib/gradle.properties.example lib/gradle.properties
```

- To Sync with Maven Central you need to get auth tokens from: https://oss.sonatype.org/
- Run `scripts/deploy.sh` to upload to BinTray (jcenter).
Binary file removed img/debug_drawer.jpg
Binary file not shown.
Binary file added img/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/logo.png
Binary file not shown.
Binary file removed img/report-bug.jpg
Binary file not shown.
26 changes: 10 additions & 16 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ android {
}
}


dependencies {
compile deps.kotlinStdLib

Expand All @@ -37,32 +36,27 @@ dependencies {
compile 'com.squareup.leakcanary:leakcanary-android:1.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.scalpel:scalpel:1.1.2'
compile 'com.facebook.stetho:stetho-okhttp:1.4.2'
compile 'com.facebook.stetho:stetho-okhttp:1.5.0'
compile 'com.github.pedrovgs:lynx:1.6'
compile 'com.jakewharton:process-phoenix:1.1.1'
compile 'nl.littlerobots.rxlint:rxlint:1.0'
compile 'nl.littlerobots.rxlint:rxlint:1.3'

// Bug Reporter
compile "io.reactivex:rxjava:1.2.1"
compile "io.reactivex:rxjava:${versions.rxJava}"
compile "io.reactivex:rxandroid:1.2.1"
compile 'com.artemzin.rxjava:proguard-rules:1.2.1.0'
compile "com.squareup.retrofit2:retrofit:2.1.0"
compile "com.squareup.retrofit2:converter-gson:2.1.0"
compile "com.squareup.retrofit2:adapter-rxjava:2.1.0"
compile "com.squareup.okhttp3:logging-interceptor:3.5.0"
compile "com.squareup.okhttp3:okhttp:3.5.0"
compile "com.artemzin.rxjava:proguard-rules:${versions.rxJava}.0"
compile "com.squareup.retrofit2:retrofit:${versions.retrofit}"
compile "com.squareup.retrofit2:converter-gson:${versions.retrofit}"
compile "com.squareup.retrofit2:adapter-rxjava:${versions.retrofit}"
compile "com.squareup.okhttp3:logging-interceptor:${versions.okHttp}"
compile "com.squareup.okhttp3:okhttp:${versions.okHttp}"
compile 'com.jraska:falcon:1.0.3'

testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:2.6.3"
testCompile "com.nhaarman:mockito-kotlin:1.1.0"

testCompile "org.jetbrains.spek:spek-api:$versions.spek"
testCompile "org.jetbrains.spek:spek-junit-platform-engine:$versions.spek"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$versions.kotlin"

testCompile 'org.junit.platform:junit-platform-runner:1.0.0-M3'
}

// SHOULD BE AT THE BOTTOM OF THE FILE, DONT MOVE
apply from: 'bintray.gradle'
apply from: '../bintray.gradle'
4 changes: 2 additions & 2 deletions lib/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=0.6.1
VERSION_CODE=27
VERSION_NAME=0.6.2
VERSION_CODE=28
GROUP=com.baristav.debugartist

POM_NAME=Debug Artist
Expand Down
Loading

0 comments on commit fdce79b

Please sign in to comment.