Skip to content

Commit

Permalink
Update README and dev guide with Java 8 config for Kotlin.
Browse files Browse the repository at this point in the history
Setting the target conpatibility only seems to work for Java. Added the
equivalent Kotlin config options to the docs.

Issue:#5276
PiperOrigin-RevId: 228482496
  • Loading branch information
tonihei authored and ojw28 committed Jan 14, 2019
1 parent e0c6f53 commit 8792c20
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ repository and depend on the modules locally.

### From JCenter ###

#### 1. Add repositories ####

The easiest way to get started using ExoPlayer is to add it as a gradle
dependency. You need to make sure you have the Google and JCenter repositories
included in the `build.gradle` file in the root of your project:
Expand All @@ -38,22 +40,16 @@ repositories {
}
```

#### 2. Add ExoPlayer module dependencies ####

Next add a dependency in the `build.gradle` file of your app module. The
following will add a dependency to the full library:

```gradle
implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
```

where `2.X.X` is your preferred version. If not enabled already, you also need
to turn on Java 8 support in all `build.gradle` files depending on ExoPlayer, by
adding the following to the `android` section:

```gradle
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
```
where `2.X.X` is your preferred version.

As an alternative to the full library, you can depend on only the library
modules that you actually need. For example the following will add dependencies
Expand Down Expand Up @@ -87,6 +83,32 @@ JCenter can be found on [Bintray][].
[extensions directory]: https://github.com/google/ExoPlayer/tree/release-v2/extensions/
[Bintray]: https://bintray.com/google/exoplayer

#### 3. Turn on Java 8 support ####

If not enabled already, you also need to turn on Java 8 support in all
`build.gradle` files depending on ExoPlayer, by adding the following to the
`android` section:

```gradle
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
```

Note that if you want to use Java 8 features in your own code, the following
additional options need to be set:

```gradle
// For Java compilers:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin compilers:
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
```

### Locally ###

Cloning the repository and depending on the modules locally is required when
Expand Down

0 comments on commit 8792c20

Please sign in to comment.