-
-
Save i-am-the-slime/fc207e61d50e29fe2837 to your computer and use it in GitHub Desktop.
Where do I add: sound.play(compile in Compile, Sounds.Basso) ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import sbtandroid._ | |
import sbtandroid.AndroidKeys._ | |
object General { | |
val settings = Defaults.defaultSettings ++ Seq ( | |
name := "Nyx", | |
version := "0.1", | |
versionCode := 0, | |
scalaVersion := "2.10.1", | |
platformName in Android := "android-17" | |
) | |
val proguardSettings = Seq ( | |
useProguard in Android := true, | |
proguardOption in Android := """ | |
-keep class scala.Function1 | |
-keep class scala.collection.SeqLike { public protected *; } | |
""" | |
) | |
lazy val fullAndroidSettings = | |
General.settings ++ | |
AndroidProject.androidSettings ++ | |
TypedResources.settings ++ | |
proguardSettings ++ | |
AndroidManifestGenerator.settings ++ | |
AndroidMarketPublish.settings ++ Seq ( | |
keyalias in Android := "change-me", | |
libraryDependencies += "com.squareup" % "otto" % "1.3.3", | |
libraryDependencies += "org.scaloid" %% "scaloid" % "2.0-8" | |
// libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % "test" | |
// ,libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.0.1" % "test" | |
) | |
} | |
object AndroidBuild extends Build { | |
lazy val main = Project ( | |
"Nyx", | |
file("."), | |
settings = General.fullAndroidSettings | |
) | |
lazy val tests = Project ( | |
"tests", | |
file("tests"), | |
settings = General.settings ++ | |
AndroidTest.androidSettings ++ | |
General.proguardSettings ++ Seq ( | |
name := "NyxTests" | |
) | |
) dependsOn main | |
} |
...
lazy val fullAndroidSettings =
General.settings ++
AndroidProject.androidSettings ++
TypedResources.settings ++
proguardSettings ++
AndroidManifestGenerator.settings ++
AndroidMarketPublish.settings ++ Seq (
keyalias in Android := "change-me",
libraryDependencies += "com.squareup" % "otto" % "1.3.3",
libraryDependencies += "org.scaloid" %% "scaloid" % "2.0-8"
// libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % "test"
// ,libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.0.1" % "test"
) ++
sound.play(installDevice in AndroidKeys.Android, "/Users/mark/Documents/Quatsch/Hoo.wav")
}
...
After quite a while of brute forcing I found how to play a sound when everything is done in Android. You might want to add this to the README. It could be of quite some help if any of the other 3 scala+android developers wants to use your plugin as well.
All the best,
Mark
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to your
plugins.sbt
:Then you can add it to the
General
object undersettings
(for example):To configure which sounds play when see Configuration.
Hope this helps – let me know if you need more help.
Cheers,
Orr