Skip to content

Commit

Permalink
Fix a bug in core_settings.gradle with relative paths
Browse files Browse the repository at this point in the history
I think this has been broken since 617267b (which was trying to fix
the same problem).

This change initializes `rootDir` to always be the current project (i.e. ExoPlayer)
directory. From the [Gradle docs](https://docs.gradle.org/current/userguide/working_with_files.html#sec:single_file_paths):
> What happens in the case of multi-project builds? The file() method
> will always turn relative paths into paths that are relative to the
> current project directory, which may be a child project.

We can also then remove exoplayerRoot completely and simplify the local
dependency instructions.

* #minor-release
* #exofixit
* Issue: #9403

PiperOrigin-RevId: 395478121
  • Loading branch information
icbaker committed Sep 8, 2021
1 parent 837667d commit bd38c28
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ Next, add the following to your project's `settings.gradle` file, replacing
`path/to/exoplayer` with the path to your local copy:

```gradle
gradle.ext.exoplayerRoot = 'path/to/exoplayer'
gradle.ext.exoplayerModulePrefix = 'exoplayer-'
apply from: file("$gradle.ext.exoplayerRoot/core_settings.gradle")
apply from: file("path/to/exoplayer/core_settings.gradle")
```

You should now see the ExoPlayer modules appear as part of your project. You can
Expand Down
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* Fix `NullPointerException` being thrown from `CacheDataSource` when
reading a fully cached resource with `DataSpec.position` equal to the
resource length.
* Fix a bug when [depending on ExoPlayer locally](README.md#locally) with
a relative path
([#9403](https://github.com/google/ExoPlayer/issues/9403)).
* Extractors:
* Support TS packets without PTS flag
([#9294](https://github.com/google/ExoPlayer/issues/9294)).
Expand Down
2 changes: 1 addition & 1 deletion core_settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
def rootDir = file(gradle.ext.exoplayerRoot)
def rootDir = file(".")
if (!gradle.ext.has('exoplayerSettingsDir')) {
gradle.ext.exoplayerSettingsDir = rootDir.getCanonicalPath()
}
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
gradle.ext.exoplayerRoot = rootDir
gradle.ext.exoplayerModulePrefix = ''

def modulePrefix = ':'
Expand Down

0 comments on commit bd38c28

Please sign in to comment.