0
我想打包一个非托管jar以及一些Scala代码。我使用IntelliJ编程,我不确定包是否正确构建。这是build.sbt包装好吗?
我build.sbt
如下:
name := "InvokeCompiler"
version := "1.0"
scalaVersion := "2.11.8"
exportJars := true
val parserLocation = "lib/parser-0.0.1.jar"
mappings in (Compile, packageBin) ~= {
_.filter(!_._1.getName.startsWith("Main"))
}
//unmanagedJars in Compile += file(parserLocation)
mappings in (Compile, packageBin) <+= baseDirectory map { base =>
(base/parserLocation) -> "parser-0.0.1.jar"
}
我要让包含非托管的罐子,我写的代码一个新的jar文件。这个jar将被转换为.dll
在C#中使用它。但是,当这样做时,IKVMC会发出各种警告。当我添加.dll
时,它生成.dll
只包含我自己写的类。
编辑: 阅读福特先生的评论后,这里的警告和错误,我从生成的JAR运行ikvmc得到:
PROMPT:> ikvmc -target:library compiled.jar
IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/
note IKVMC0002: Output file is "compiled.dll"
warning IKVMC0100: Class "org.nlogo.core.FrontEndInterface" not found
warning IKVMC0100: Class "scala.Tuple2" not found
warning IKVMC0100: Class "scala.reflect.ScalaSignature" not found
warning IKVMC0100: Class "scala.Option" not found
warning IKVMC0100: Class "org.nlogo.core.Program" not found
warning IKVMC0100: Class "scala.collection.immutable.ListMap" not found
warning IKVMC0100: Class "org.nlogo.core.ExtensionManager" not found
warning IKVMC0100: Class "org.nlogo.core.CompilationEnvironment" not found
warning IKVMC0100: Class "org.nlogo.core.Femto$" not found
warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in "Interface.ASTSingleton$.getFrontEndCompiledAsJSON(Ljava.lang.String;)Lscala.Tuple2;"
("org.nlogo.core.FrontEndInterface")
warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in "Interface.ASTSingleton$.getFrontEndSingletion()Lorg.nlogo.core.FrontEndInterface;"
("org.nlogo.core.Femto$")
我不希望jar有一个主要方法,我希望它是一个lib,就是这样。通过提取生成的jar的内容,似乎所有的依赖关系都被添加了。那么问题依然是为什么ikvmc无法将其转换为dll。谢谢,至少看起来我的感觉没问题。 :) – Marin
@Marin乐于帮忙!请记住点赞和/或接受帮助您找到解决方案的答案,或阐明这种情况。通过这样做,人们将来会更有可能帮助你!我还会更新您的原始文章,并提供您收到的警告,因为它可能会提供更多线索,让我们为您提供帮助。 –