[Ikvm-developers] Question about using the OpenJDK 8 JDeps tool with IKVMC
Brought to you by:
jfrijters
|
From: Richard C. <ri...@lu...> - 2015-11-03 14:05:19
|
Hi, I'm emailing the list with three questions (in three messages) today. Here's the first question: I am experimenting with the JDeps tool, released for the first time with OpenJDK 8, which analyzes the dependency relationships among JAR files and produces a dependency graph in the form of text output. (JDeps provides the option to specify entire JAR files as the nodes in such a graph, or to specify classes using its "verbose" option. For me, the nodes are currently JAR files.) My assumption is that because the developers of OpenJDK maintain both the Javac compiler and JDeps, then if a Java project correctly compiles with Javac, then some subgraph of the dependency graph produced by JDeps should be a directed acyclic graph that is used by the Java compiler when it actually walks through the project's dependencies during the build process - and no edges walked by the compiler should not be in the JDeps graph. This is not the right forum to ask if this assumption is true, so let's assume for the moment that it is gospel truth. Then, let's suppose that one were to know ahead of time at least one graph structure associated with a batch file containing a set of IKVMC commands that, when executed, would correctly convert a Java application and all of its associated functions (even those that reference external libraries) to a DLL file. (Note that multiple solutions to this problem likely exist, so let's just call such a graph structure a solution to the problem, not the solution to the problem.) Is the graph associated with that IKVM batch file always a subgraph of the JDeps graph? If the answer is yes, then even though JDeps can produce graphs containing cycles, I should be able to write an algorithm to correctly produce a batch file for IKVMC. If the answer is no, then that's disappointing. Thanks very much! (Also, if anyone reading has suggestions for a tool to determine the structure of dependencies in a large directory of JAR files that is better than JDeps or Jar2Ikvmc, this would probably be a great thread to post to.) Excuse me if I'm asking a question that's been partly answered before - I did search around but may have missed something. Best, Richard Background: like at least one other person<http://sourceforge.net/p/ikvm/mailman/message/6714655/> who posted previously, I have a large Java application that I would like to convert to a DLL while correctly preserving, in the new DLL file, all the functions that reference external libraries. That means, of course, that I first need to at least partially convert those external JAR libraries to DLL files as well. The problem quickly becomes quite difficult, and I have seen others post horror stories about taking quite some time to manually determine the set of references to include in a batch file to feed to IKVMC. I am attempting to use a tool to automate this approach, and have tried Jar2Ikvmc<https://code.google.com/p/jar2ikvmc/> for this purpose but it simply falls short for complicated projects, as it uses a crude, greedy algorithm to attempt to create a dependency structure that often is simply wrong. |