Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 35c5384241e3cdc17743e3f3685c0a9bf78c4aee 0 parents
@gseitz gseitz authored
10 .gitignore
@@ -0,0 +1,10 @@
+project/plugins/project/build.properties
+target
+project/plugins/target
+project/boot
+project/plugins/boot
+lib_managed
+project/plugins/lib_managed
+.DS_Store
+src_managed
+project/plugins/src_managed
6 project/build.properties
@@ -0,0 +1,6 @@
+project.organization=com.example
+project.name=android-sbt-project
+sbt.version=0.7.4
+project.version=0.1.0
+build.scala.versions=2.7.7
+project.initialize=false
7 project/build/project.scala
@@ -0,0 +1,7 @@
+import sbt._
+
+class TemplateProject(info: ProjectInfo) extends DefaultProject(info) with giter8.Template {
+
+ override def templateSources = super.templateSources --- (descendents(templateSourcePath, "*.png"))
+
+}
5 project/plugins/plugins.scala
@@ -0,0 +1,5 @@
+import sbt._
+
+class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
+ val giter8 = "net.databinder" % "giter8-plugin" % "0.1.0"
+}
3  src/main/g8/default.properties
@@ -0,0 +1,3 @@
+name=My Android Project
+platform=4
+description=Creates an Android SBT project.
6 src/main/g8/project/build.properties
@@ -0,0 +1,6 @@
+project.name=$name$
+sbt.version=0.7.4
+project.version=0.1
+def.scala.version=2.7.7
+build.scala.versions=2.8.0
+project.initialize=false
20 src/main/g8/project/build/project.scala
@@ -0,0 +1,20 @@
+import sbt._
+
+trait Defaults {
+ def androidPlatformName = "android-$platform$"
+}
+class Parent(info: ProjectInfo) extends ParentProject(info) with IdeaProject {
+ override def shouldCheckOutputDirectories = false
+ override def updateAction = task { None }
+
+ lazy val main = project(".", "$name$", new MainProject(_))
+ lazy val tests = project("tests", "tests", new TestProject(_), main)
+
+ class MainProject(info: ProjectInfo) extends AndroidProject(info) with Defaults with MarketPublish with TypedResources
+ with IdeaProject {
+ val keyalias = "change-me"
+ val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test"
+ }
+
+ class TestProject(info: ProjectInfo) extends AndroidTestProject(info) with Defaults with IdeaProject
+}
8 src/main/g8/project/plugins/plugins.scala
@@ -0,0 +1,8 @@
+import sbt._
+
+class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
+ val android = "org.scala-tools.sbt" % "sbt-android-plugin" % "0.5.0"
+
+ val sbtIdeaRepo = "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
+ val sbtIdea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT"
+}
12 src/main/g8/src/main/AndroidManifest.xml
@@ -0,0 +1,12 @@
+<manifest
+android:versionName="0.1" android:versionCode="1" package="my.package" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="7"></uses-sdk>
+ <application android:icon="@drawable/app_icon" android:label="@string/app_name">
+ <activity android:label="@string/app_name" android:name=".MainActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"></action>
+ <category android:name="android.intent.category.LAUNCHER"></category>
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
BIN  src/main/g8/src/main/res/drawable/app_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3  src/main/g8/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+<resources>
+ <string name="app_name">Myproject</string>
+</resources>
14 src/main/g8/src/main/scala/Activity.scala
@@ -0,0 +1,14 @@
+package my.package
+
+import _root_.android.app.Activity
+import _root_.android.os.Bundle
+import _root_.android.widget.TextView
+
+class MainActivity extends Activity {
+ override def onCreate(savedInstanceState: Bundle) {
+ super.onCreate(savedInstanceState)
+ setContentView(new TextView(this) {
+ setText("hello, world")
+ })
+ }
+}
10 src/main/g8/src/test/scala/Specs.scala
@@ -0,0 +1,10 @@
+import my.package
+import org.scalatest.matchers.ShouldMatchers
+import org.scalatest.Spec
+
+class Specs extends Spec with ShouldMatchers {
+ describe("a spec") {
+ it("should do something") {
+ }
+ }
+}
9 src/main/g8/tests/src/main/AndroidManifest.xml
@@ -0,0 +1,9 @@
+<manifest package="my.package.tests" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="7"></uses-sdk>
+ <application>
+ <uses-library android:name="android.test.runner"></uses-library>
+ </application>
+ <instrumentation
+ android:label="Tests" android:targetPackage="my.package" android:name="android.test.InstrumentationTestRunner">
+</instrumentation>
+</manifest>
10 src/main/g8/tests/src/main/scala/UnitTests.scala
@@ -0,0 +1,10 @@
+package my.package.tests
+
+import junit.framework.Assert._
+import _root_.android.test.AndroidTestCase
+
+class UnitTests extends AndroidTestCase {
+ def testPackageIsCorrect {
+ assertEquals("my.package", getContext.getPackageName)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.