anchor.diff:        "  {vsn, \"", Vsn, "\"}, "
         "  {modules, [",Name,"]}, "
         "  {registered, []}, "
  -      "  {applications, [stdlib, kernel]} "
  +      "  {applications, [" ++ AppsStr ++ "]} "
         " ]}. "],
   
       ok = file:write_file(filename:join([OutDir, <<Name/binary, ".app">>]), AppFile),
  
positive.code:     EPlug = fake_app(<<"rp_e">>, <<"1.0.0">>,
                       InDir("_build/default/plugins/lib/rp_e/")),
  
      S0 = rebar_state:new(),
      S1 = rebar_state:all_deps(S0, [ADep, BDep, CDep, DDep, RelxDep]),
      S2 = rebar_state:all_plugin_deps(S1, [APlug, RelxPlug]),
      S3 = rebar_state:code_paths(S2, default, code:get_path()),
      S4 = rebar_state:code_paths(
          S3,
          all_deps,
          [rebar_app_info:ebin_dir(A) || A <- [ADep, BDep, CDep, DDep, RelxDep]]
      ),
      S5 = rebar_state:code_paths(
          S4,
          all_plugin_deps,
          [rebar_app_info:ebin_dir(A) || A <- [APlug, RelxPlug, EPlug]]
      ),
      [{base_paths, BasePaths}, {root_dir, Dir}, {state, S5} | Config].
  
  end_per_testcase(_, Config) ->
      %% this is deeply annoying because we interfere with rebar3's own
  
negative.code: 
  fake_app(Name, Vsn, OutDir) ->
      {ok, App} = rebar_app_info:new(Name, Vsn, OutDir),
      compile_fake_appmod(App, []),
      App.
  
  fake_app(Name, Vsn, OutDir, Apps) ->
      {ok, App} = rebar_app_info:new(Name, Vsn, OutDir),
      compile_fake_appmod(App, Apps),
      App.
  
  compile_fake_appmod(App, Apps) ->
      OutDir = rebar_app_info:ebin_dir(App),
      Vsn = rebar_app_info:original_vsn(App),
      Name = rebar_app_info:name(App),
      AppsStr = apps_to_str(Apps),
  
      ok = filelib:ensure_dir(filename:join([OutDir, ".touch"])),
  
  