Skip to content

Instantly share code, notes, and snippets.

@haxney
Created August 22, 2011 00:53
Show Gist options
  • Save haxney/1161421 to your computer and use it in GitHub Desktop.
Save haxney/1161421 to your computer and use it in GitHub Desktop.
Scala on Android with Eclipse support
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src_managed"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Renown</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
lazy val android = "org.scala-tools.sbt" % "sbt-android-plugin" % "0.5.1"
}
import sbt._
import Process._
trait Defaults {
def androidPlatformName = "android-8"
}
class MainProject(info: ProjectInfo) extends AndroidProject(info) with Defaults with MarketPublish with TypedResources {
override def shouldCheckOutputDirectories = false
override def updateAction = task { None }
val keyalias = "change-me"
override def androidManifestPath = androidManifestName
override def mainResPath = resDirectoryName
override def mainJavaSourcePath = "src"
override def mainScalaSourcePath = "src"
override def mainAssetsPath = assetsDirectoryName
// Put generated Java files (R.java) in their own directory. Don't pollute any
// directories containing static Java files.
def javaGeneratedSourcePath = "gen"
override def aaptGenerateTask = execTask {<x>
{aaptPath.absolutePath} package -m -M {androidManifestPath.absolutePath} -S {mainResPath.absolutePath}
-I {androidJarPath.absolutePath} -J {javaGeneratedSourcePath.absolutePath}
</x>} dependsOn directory(javaGeneratedSourcePath)
override def mainSourceRoots = super.mainSourceRoots +++ javaGeneratedSourcePath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment