Commit 9046124f by ibaker Committed by Christos Tsilopoulos

Fix a bug in core_settings.gradle with relative paths

I think this has been broken since https://github.com/google/ExoPlayer/commit/617267bfcf20c500fb4a3cfdff7104e4d88261a7 (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
parent 036039fb
...@@ -115,9 +115,8 @@ Next, add the following to your project's `settings.gradle` file, replacing ...@@ -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: `path/to/exoplayer` with the path to your local copy:
```gradle ```gradle
gradle.ext.exoplayerRoot = 'path/to/exoplayer'
gradle.ext.exoplayerModulePrefix = '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 You should now see the ExoPlayer modules appear as part of your project. You can
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* Fix `NullPointerException` being thrown from `CacheDataSource` when * Fix `NullPointerException` being thrown from `CacheDataSource` when
reading a fully cached resource with `DataSpec.position` equal to the reading a fully cached resource with `DataSpec.position` equal to the
resource length. 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: * Extractors:
* Support TS packets without PTS flag * Support TS packets without PTS flag
([#9294](https://github.com/google/ExoPlayer/issues/9294)). ([#9294](https://github.com/google/ExoPlayer/issues/9294)).
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
def rootDir = file(gradle.ext.exoplayerRoot) def rootDir = file(".")
if (!gradle.ext.has('exoplayerSettingsDir')) { if (!gradle.ext.has('exoplayerSettingsDir')) {
gradle.ext.exoplayerSettingsDir = rootDir.getCanonicalPath() gradle.ext.exoplayerSettingsDir = rootDir.getCanonicalPath()
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
gradle.ext.exoplayerRoot = rootDir
gradle.ext.exoplayerModulePrefix = '' gradle.ext.exoplayerModulePrefix = ''
def modulePrefix = ':' def modulePrefix = ':'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment