     end
   end
 
+  defp modules_changed?(mods, target) do
+    case :file.consult(target) do
+      { :ok, { :application, _app, properties } } ->
+        properties[:registered] == mods
+      _ ->
+        false
+    end
+  end
+
   defp validate_app(app) when is_atom(app), do: :ok
   defp validate_app(_), do: raise(Mix.Error, message: "Expected :app to be an atom")
 

    validate_app(app)
    validate_version(version)

    path    = Mix.Project.compile_path
    beams   = Path.wildcard('#{path}/*.beam')

    target  = Path.join(path, "#{app}.app")
    sources = Mix.Project.config_files ++ beams

    if opts[:force] || Mix.Utils.stale?(sources, [target]) do
      best_guess = [
        vsn: to_char_list(version),
        modules: modules_from(beams),
        applications: [:kernel, :stdlib, :elixir]
      ]

      properties = if function_exported?(project, :application, 0) do
        Mix.Utils.config_merge(best_guess, project.application)
      else
        best_guess
      end

      _ ->
        :ok
    end

    properties
  end

  defp invalid(message) do
