2017-03-09 14 views

答えて

1

一般的な、あなたはあなたの心を変更する必要があります。 SBTでは、すべてのライブラリでプレーン・スカラを使用します。

<profiles> 
    <profile> 
     <id>lwjgl-natives-linux></id> 
     <activation> 
      <os><family>unix</family></os> 
     </activation> 
     <properties> 
      <lwjgl.natives>natives-linux</lwjgl.natives> 
     </properties> 
    </profile> 
    <profile> 
     <id>lwjgl-natives-macos></id> 
     <activation> 
      <os><family>mac</family></os> 
     </activation> 
     <properties> 
      <lwjgl.natives>natives-macos</lwjgl.natives> 
     </properties> 
    </profile> 
    <profile> 
     <id>lwjgl-natives-windows></id> 
     <activation> 
      <os><family>windows</family></os> 
     </activation> 
     <properties> 
      <lwjgl.natives>natives-windows</lwjgl.natives> 
     </properties> 
    </profile> 
</profiles> 

あなたの例によると、変数を定義します。 (How do I programmatically determine operating system in Java?を参照してください):

val lwjglNatives = sys.props("os.name").toLowerCase match { 
    case os if os.contains("uni") => 
      "natives-linux" 
    case os if os.contains("mac") | os.contains("darwin") => 
     "natives-macos" 
    case os if os.contains("win") => 
     "natives-windows"  
} 

その後は、OSに依存lwjglNativesを使用することができます。

関連する問題