Download Jar. Uses 12233K of libraries. Click here for Pure Java version (3388L/24K).
1 | !7 |
2 | |
3 | import org.openimaj.image.processing.edges.*; |
4 | |
5 | static Class module; |
6 | |
7 | p {
|
8 | module = hotwireSharingLibraries(#1010058); |
9 | |
10 | callMain(module); |
11 | } |
12 | |
13 | svoid test {
|
14 | MBFImage image = readMBF(loadImageAsFile(#1002132)); |
15 | call(module, 'processImage, image); |
16 | } |
17 | |
18 | static Class<?> hotwireSharingLibraries(S progID) ctex {
|
19 | Pair<File, S> p = CompilerBot.compileSnippet2(progID); |
20 | File jar = p.a; |
21 | assertTrue(f2s(jar), jar.isFile()); |
22 | |
23 | // collect files (program + libraries) |
24 | |
25 | L<File> files = ll(jar); |
26 | S dehlibs = unnull(loadTextFileFromZip(jar, "libraries")); |
27 | |
28 | L<File> myLibraries = myLibraryFiles(); |
29 | print("My libraries: " + myLibraries);
|
30 | |
31 | Matcher matcher = Pattern.compile("\\d+").matcher(dehlibs);
|
32 | while (matcher.find()) {
|
33 | S libID = matcher.group(); |
34 | File lib = loadLibrary(libID); |
35 | if (myLibraries.contains(lib)) |
36 | print("Skipping lib " + lib);
|
37 | else {
|
38 | print("Adding lib " + lib);
|
39 | files.add(lib); |
40 | } |
41 | } |
42 | |
43 | // make class loader |
44 | JavaXClassLoader classLoader = new JavaXClassLoader(progID, files, myClassLoader()); |
45 | |
46 | ret hotwire_finish(classLoader, progID, p.b); |
47 | } |
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: | 733 / 1745 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |