Skip to content

Commit

Permalink
Merge pull request #25 from membraneframework/fix/common-file-impl-co…
Browse files Browse the repository at this point in the history
…nfig

Fix missing default value for `:file_impl` config
  • Loading branch information
bblaszkow06 authored Apr 25, 2022
2 parents 40d4776 + 3af9252 commit 768f3a0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_file_plugin` to your list of de
```elixir
def deps do
[
{:membrane_file_plugin, "~> 0.11.0"}
{:membrane_file_plugin, "~> 0.11.1"}
]
end
```
Expand Down
9 changes: 9 additions & 0 deletions lib/membrane_file/common_file_behaviour.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ defmodule Membrane.File.CommonFileBehaviour do
alias Membrane.Buffer
alias Membrane.File.SeekEvent

@common_file_impl Application.compile_env(
:membrane_file_plugin,
:file_impl,
Membrane.File.CommonFile
)

@spec get_impl() :: module()
def get_impl(), do: @common_file_impl

@type posix_error_t :: {:error, File.posix()}
@type generic_error_t :: {:error, File.posix() | :badarg | :terminated}

Expand Down
2 changes: 1 addition & 1 deletion lib/membrane_file/sink.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Membrane.File.Sink do

alias Membrane.File.SeekEvent

@common_file Application.compile_env(:membrane_file_plugin, :file_impl)
@common_file Membrane.File.CommonFileBehaviour.get_impl()

def_options location: [
spec: Path.t(),
Expand Down
2 changes: 1 addition & 1 deletion lib/membrane_file/sink_multi.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Membrane.File.Sink.Multi do
"""
use Membrane.Sink

@common_file Application.compile_env(:membrane_file_plugin, :file_impl)
@common_file Membrane.File.CommonFileBehaviour.get_impl()

def_options location: [
spec: Path.t(),
Expand Down
2 changes: 1 addition & 1 deletion lib/membrane_file/source.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Membrane.File.Source do

alias Membrane.{Buffer, RemoteStream}

@common_file Application.compile_env(:membrane_file_plugin, :file_impl)
@common_file Membrane.File.CommonFileBehaviour.get_impl()

def_options location: [
spec: Path.t(),
Expand Down
11 changes: 4 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.File.Plugin.Mixfile do
use Mix.Project

@version "0.11.0"
@version "0.11.1"
@github_url "https://github.com/membraneframework/membrane_file_plugin"

def project do
Expand Down Expand Up @@ -49,15 +49,13 @@ defmodule Membrane.File.Plugin.Mixfile do

defp dialyzer() do
opts = [
plt_local_path: "priv/plts",
flags: [:error_handling]
]

if System.get_env("CI") == "true" do
# Store core PLTs in cacheable directory for CI
# For development it's better to stick to default, $MIX_HOME based path
# to allow sharing core PLTs between projects
[plt_core_path: "priv/plts"] ++ opts
# Store PLTs in a directory cacheable on CI
File.mkdir_p!(Path.join([__DIR__, "priv", "plts"]))
[plt_local_path: "priv/plts", plt_core_path: "priv/plts"] ++ opts
else
opts
end
Expand All @@ -67,7 +65,6 @@ defmodule Membrane.File.Plugin.Mixfile do
[
maintainers: ["Membrane Team"],
licenses: ["Apache-2.0"],
files: ["lib", ".formatter.exs", "mix.exs", "README*", "LICENSE*"],
links: %{
"GitHub" => @github_url,
"Membrane Framework Homepage" => "https://membraneframework.org"
Expand Down
Empty file removed priv/plts/.gitkeep
Empty file.

0 comments on commit 768f3a0

Please sign in to comment.