Mix.install([
  {:rustler_precompiled, "~> 0.1.0"}
])

File.write!("checksum-Elixir.RustlerPrecompilationExample.Native.exs", """
%{
  "example-v0.2.0-nif-2.14-x86_64-pc-windows-gnu.dll.tar.gz" =>         "sha256:3fb02bc1b1afe2ca6c00c3072ddfa893c216279141b1a1ee44e96d20b45e27a0",
  "example-v0.2.0-nif-2.14-x86_64-pc-windows-msvc.dll.tar.gz" =>        "sha256:5af67c9506294d01678c0825de848d2ce6e35ef30ea6b708a776733c3e7b14bc",
  "example-v0.2.0-nif-2.15-x86_64-pc-windows-gnu.dll.tar.gz" =>         "sha256:105307ddad3bf76916ff93e95256031682e00d136cee6bb047ba62c9ae7fe2b5",
  "example-v0.2.0-nif-2.15-x86_64-pc-windows-msvc.dll.tar.gz" =>        "sha256:169b116c0700cf1b69176218cef5fbc6cd91c8d8fa7143c8b67352cb57838e27",
  "example-v0.2.0-nif-2.16-x86_64-pc-windows-gnu.dll.tar.gz" =>         "sha256:709ef6578f682504ea7cab6c9fa1fc085de5e92a82d84341b0f003a945f5dc8d",
  "example-v0.2.0-nif-2.16-x86_64-pc-windows-msvc.dll.tar.gz" =>        "sha256:6cb381505722f2a6f153fddb1790085b1fb7a9358df3bf4f527840caaa584eaf",
  "libexample-v0.2.0-nif-2.14-aarch64-apple-darwin.so.tar.gz" =>        "sha256:48e9ab32052e2188697122d99e03c2eb2215134788a30d9670374248cc23ced7",
  "libexample-v0.2.0-nif-2.14-aarch64-unknown-linux-gnu.so.tar.gz" =>   "sha256:97a36abd34d781b0aef36d21c80f88f134728a49d0a181ef77ebdca41f882cd6",
  "libexample-v0.2.0-nif-2.14-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:55bed297ffc0d2a6356c5871ff815d7e6f0b1b1e697b3a2b2d76af29def4f6b3",
  "libexample-v0.2.0-nif-2.14-x86_64-apple-darwin.so.tar.gz" =>         "sha256:b8b4965aad388708063f2be1b0a2cf2851a3b364f9bcd201ddf7490127fe3abb",
  "libexample-v0.2.0-nif-2.14-x86_64-unknown-linux-gnu.so.tar.gz" =>    "sha256:a1cb2d6e6c3edaca9b57b4c381aaff5f4dca519d395fc89bc791b3ef8ba5acfb",
  "libexample-v0.2.0-nif-2.14-x86_64-unknown-linux-musl.so.tar.gz" =>   "sha256:1d0bea3204eb67292fbe5fa312650f4d19080cdc1fe4f30c3b0a7066d9cfb27c",
  "libexample-v0.2.0-nif-2.15-aarch64-apple-darwin.so.tar.gz" =>        "sha256:cc88e63f236daff14e0b92d2cacccd0e5d41bc3b46e3fb18c31e2bcb91b204ee",
  "libexample-v0.2.0-nif-2.15-aarch64-unknown-linux-gnu.so.tar.gz" =>   "sha256:b33cdc850747fcb1df185c3d50c75f6f5fd2dd819e8f51b39534e36738b03036",
  "libexample-v0.2.0-nif-2.15-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:f871d5095f65f377ca1dc35bb8f6f7d26e4540164ab5858512374c4dcf1e7a2d",
  "libexample-v0.2.0-nif-2.15-x86_64-apple-darwin.so.tar.gz" =>         "sha256:f45ec7bf6fefa8dc71400cde18e49e39c5b0630b3b8af347192154ff6c97f7a5",
  "libexample-v0.2.0-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz" =>    "sha256:6018f356654faadd84d4faa5d842f447fbc8cc89192f9843b00e15329f8e8d71",
  "libexample-v0.2.0-nif-2.15-x86_64-unknown-linux-musl.so.tar.gz" =>   "sha256:af59f3eeb8798f3bebd85b89ca5dae3b6e80a86d625a1fc24589280056b8eec5",
  "libexample-v0.2.0-nif-2.16-aarch64-apple-darwin.so.tar.gz" =>        "sha256:c779bc59760be7fc6b9cd830944316d41e23713e43591a965c666145ae69017b",
  "libexample-v0.2.0-nif-2.16-aarch64-unknown-linux-gnu.so.tar.gz" =>   "sha256:36df67cdfccd825e7ede5b91af3a339fd4d288dc7a9b44f6ef677109fe22e888",
  "libexample-v0.2.0-nif-2.16-arm-unknown-linux-gnueabihf.so.tar.gz" => "sha256:6d680f92a6a0a5cfdc950e42c10cf2a8e47aa8a9e459649979e93e0a3710e1d8",
  "libexample-v0.2.0-nif-2.16-x86_64-apple-darwin.so.tar.gz" =>         "sha256:75acb8daa6bfc7af51ec60dd660e1bdcf544e154f412cfe681c95e4966132df4",
  "libexample-v0.2.0-nif-2.16-x86_64-unknown-linux-gnu.so.tar.gz" =>    "sha256:d024aa41d4e3fe5c07ab758e0940cd74dfd9d047ee9ab734a1fa04f7bdde1f1f",
  "libexample-v0.2.0-nif-2.16-x86_64-unknown-linux-musl.so.tar.gz" =>   "sha256:db1cdf03518d6993de01c30a45f780e7fe9850ae6fecc0cedd1d194c310e2edb",
}
""")

defmodule RustlerPrecompilationExample.Native do
  version = "0.2.0"

  use RustlerPrecompiled,
    otp_app: :elixir,
    crate: "example",
    base_url:
      "https://github.com/philss/rustler_precompilation_example/releases/download/v#{version}",
    version: version

  def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded)
end

IO.inspect(RustlerPrecompilationExample.Native.add(1, 2))
