Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1010566 // hotwireSharingLibraries_v1 [doesn't work]

JavaX fragment (include)

static Class<?> hotwireSharingLibraries(S progID) ctex {
  Pair<File, S> p = CompilerBot.compileSnippet2(progID);
  File jar = p.a;
  assertTrue(f2s(jar), jar.isFile());
  
  // collect files (program + libraries)
  
  L<File> files = ll(jar);
  S dehlibs = unnull(loadTextFileFromZip(jar, "libraries"));
  
  L<File> myLibraries = myLibraryFiles();
  print("My libraries: " + myLibraries);
  
  Matcher matcher = Pattern.compile("\\d+").matcher(dehlibs);
  while (matcher.find()) {
    S libID = matcher.group();
    File lib = loadLibrary(libID);
    if (myLibraries.contains(lib))
      print("Skipping lib " + lib);
    else {
      print("Adding lib " + lib);
      files.add(lib);
    }
  }

  // make class loader
  JavaXClassLoader classLoader = new JavaXClassLoader(progID, files, myClassLoader());
  
  ret hotwire_finish(classLoader, progID, p.b);
}

Author comment

Began life as a copy of #1010562

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1010566
Snippet name: hotwireSharingLibraries_v1 [doesn't work]
Eternal ID of this version: #1010566/1
Text MD5: 5e9215580af4341bbc62e23d6aa007a5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-21 17:32:07
Source code size: 889 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 388 / 411
Referenced in: