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

47
LINES

< > BotCompany Repo | #1010564 // Test sharing library with hotwired module v1 [doesn't work, main classes conflict]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 12233K of libraries. Click here for Pure Java version (3388L/24K).

!7

import org.openimaj.image.processing.edges.*;

static Class module;

p {
  module = hotwireSharingLibraries(#1010058);
  
  callMain(module);
}

svoid test {
  MBFImage image = readMBF(loadImageAsFile(#1002132));
  call(module, 'processImage, image);
}

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);
}

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: #1010564
Snippet name: Test sharing library with hotwired module v1 [doesn't work, main classes conflict]
Eternal ID of this version: #1010564/8
Text MD5: 3e728705bab501ff3eca4394b6668bab
Transpilation MD5: 941932bed27c72616897d50ddb9f9d0a
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-21 17:32:36
Source code size: 1164 bytes / 47 lines
Pitched / IR pitched: No / No
Views / Downloads: 500 / 1185
Version history: 7 change(s)
Referenced in: #1010567 - Test sharing library with hotwired module v2 [OK!]