2
pom.xml
には、実行中のオペレーティングシステムをチェックし、オペレーティングシステムに基づいて変数を変更するプロファイルが定義されています。 SBTのこのような振る舞いに相当するものはありますか?SBTのMavenプロファイルに相当する
The pom.xml I'm looking at (it's the LWJGL one)
pom.xml
には、実行中のオペレーティングシステムをチェックし、オペレーティングシステムに基づいて変数を変更するプロファイルが定義されています。 SBTのこのような振る舞いに相当するものはありますか?SBTのMavenプロファイルに相当する
The pom.xml I'm looking at (it's the LWJGL one)
一般的な、あなたはあなたの心を変更する必要があります。 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
を使用することができます。