Skip to content

Commit

Permalink
Remove common and android code (#110)
Browse files Browse the repository at this point in the history
This repo now represents the standard JRE version of the lightstep-java-tracer.
  • Loading branch information
frenchfrywpepper committed Jun 27, 2017
1 parent 77352ef commit 4bc623f
Show file tree
Hide file tree
Showing 141 changed files with 5 additions and 18,690 deletions.
6 changes: 2 additions & 4 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`Makefile`s are used to encapsulate the various tools in the toolchain:

```bash
make build # builds Android, JRE libraries and examples
make build # builds JRE libraries and examples
make publish # increment versions and publish the artifacts to bintray
```

Expand All @@ -15,10 +15,8 @@ NOTE: to publish, `BINTRAY_USER` and `BINTRAY_API_KEY` need to be set in the she

```
Makefile # Top-level Makefile to encapsulate tool-specifics
common/ # Shared source code for JRE and Android
lightstep-tracer-android/ # Android instrumentation library
lightstep-tracer-jre/ # JRE instrumentation library
examples/ # Sample code for both JRE and Android
examples/ # Sample code for JRE
```

## Formatting
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test: ci_test
# See https://bintray.com/lightstep for published artifacts
publish: pre-publish build test inc-version
git add gradle.properties
git add common/src/main/java/com/lightstep/tracer/shared/Version.java
git commit -m "VERSION `awk 'BEGIN { FS = "=" }; { printf("%s", $$2) }' gradle.properties`"
git tag `awk 'BEGIN { FS = "=" }; { printf("%s", $$2) }' gradle.properties`
git push
Expand All @@ -38,10 +37,7 @@ ci_test: build
./gradlew test
make -C examples/jre-simple run

# The version of the Android and JRE libraries is kept in lock-step as the
# majority of the code is the same.
inc-version:
@git diff-index --quiet HEAD || (echo "git has uncommitted changes. Refusing to publish." && false)
awk 'BEGIN { FS = "." }; { printf("%s.%d.%d", $$1, $$2, $$3+1) }' gradle.properties > gradle.properties.incr
mv gradle.properties.incr gradle.properties
make -C common generate-version-source-file
66 changes: 2 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,14 @@

[ ![Download](https://api.bintray.com/packages/lightstep/maven/lightstep-tracer-android/images/download.svg) ](https://bintray.com/lightstep/maven/) [![Circle CI](https://circleci.com/gh/lightstep/lightstep-tracer-java.svg?style=shield)](https://circleci.com/gh/lightstep/lightstep-tracer-java) [![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)

The LightStep distributed tracing library for Android and the standard Java runtime environment.
The LightStep distributed tracing library for the standard Java runtime environment.

* [Getting Started](#getting-started)
* [Android](#getting-started-android)
* [JRE](#getting-started-jre)
* [API documentation](#apidocs)
* [Options](#options)

<a name="#getting-started"></a>
<a name="#getting-started-android"></a>

## Getting started: Android

The Android library is hosted on Bintray, jcenter, and Maven Central. The Bintray [lightstep-tracer-android](https://bintray.com/lightstep/maven/lightstep-tracer-android/view) project contains additional installation and setup information for using the library with various build systems such as Ivy and Maven.

### Gradle

In most cases, modifying your `build.gradle` with the below is all that is required:

```
repositories {
jcenter() // OR mavenCentral()
}
dependencies {
compile 'com.lightstep.tracer:lightstep-tracer-android:VERSION'
}
```

* Be sure to replace `VERSION` with the current version of the library
* The artifact is published to both `jcenter()` and `mavenCentral()`. Use whichever you prefer.

### Update your AndroidManifest.xml

Ensure the app's `AndroidManifest.xml` has the following (under the `<manifest>` tag):

```xml
<!-- Permissions required to make http calls -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

### Initializing the LightStep Tracer


```java
// Import the OpenTracing interfaces
import io.opentracing.Span;
import io.opentracing.Tracer;

// ...

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Initialize LightStep tracer implementation in the main activity
// (or anywhere with a valid android.content.Context).
this.tracer = new com.lightstep.tracer.android.Tracer(
this,
new com.lightstep.tracer.shared.Options.OptionsBuilder()
.withAccessToken("{your_access_token}")
.build()
);

// Start and finish a Span
Span span = this.tracer.buildSpan("my_span").start();
this.doSomeWorkHere();
span.finish();
```

<a name="#getting-started-jre"></a>

## Getting started: JRE
Expand Down Expand Up @@ -137,7 +76,6 @@ Tracing instrumentation should use the OpenTracing APIs to stay portable and in

For reference, the generated LightStep documentation is also available:

* [lightstep-tracer-android (javadoc)](http://javadoc.io/doc/com.lightstep.tracer/lightstep-tracer-android)
* [lightstep-tracer-jre (javadoc)](http://javadoc.io/doc/com.lightstep.tracer/lightstep-tracer-jre)

## Options
Expand Down Expand Up @@ -169,7 +107,7 @@ To then manually flush by using the LightStep tracer object directly:

```java
// Flush any buffered tracing data
((com.lightstep.tracer.android.Tracer)tracer).flush();
((com.lightstep.tracer.jre.JRETracer)tracer).flush();
```

### Flushing the report at exit
Expand Down
1 change: 0 additions & 1 deletion common/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions common/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions common/README.md

This file was deleted.

204 changes: 0 additions & 204 deletions common/build.gradle

This file was deleted.

Loading

0 comments on commit 4bc623f

Please sign in to comment.