local lsk = asset.syncedResource({
  Name = "General LSK Kernels",
  Type = "HttpSynchronization",
  Identifier = "general_lsk",
  Version = 1
})

local pck = asset.syncedResource({
  Name = "General PCK Kernels",
  Type = "HttpSynchronization",
  Identifier = "general_pck",
  Version = 1
})

local spk = asset.syncedResource({
  Name = "General SPK Kernels",
  Type = "HttpSynchronization",
  Identifier = "general_spk",
  Version = 2
})


local kernels = {
  lsk .. "naif0012.tls",
  pck .. "pck00011.tpc",
  spk .. "de430.bsp"
}


asset.onInitialize(function()
  openspace.spice.loadKernel(lsk .. "naif0012.tls")
  openspace.spice.loadKernel(pck .. "pck00011.tpc")
  openspace.spice.loadKernel(spk .. "de430.bsp")
end)

asset.onDeinitialize(function()
  openspace.spice.unloadKernel(spk .. "de430.bsp")
  openspace.spice.unloadKernel(pck .. "pck00011.tpc")
  openspace.spice.unloadKernel(lsk .. "naif0012.tls")
end)



asset.meta = {
  Name = "SPICE Base",
  Version = "1.1",
  Description = [[This asset contains the spice base kernels necessary for any space
    application. Includes positions for Solar System bodies from 1850 to 2150]],
  Author = "OpenSpace Team",
  URL = "https://naif.jpl.nasa.gov/naif/data_generic.html",
  License = "NASA"
}
