Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

create project

  • Loading branch information...
commit 5611c0466a03c44969f4640e2dac01423b1b3be1 1 parent 9638b26
@yoshihiro503 authored
View
36 project/build.scala
@@ -0,0 +1,36 @@
+import sbt._
+
+import Keys._
+import AndroidKeys._
+
+object General {
+ val settings = Defaults.defaultSettings ++ Seq (
+ name := "NfcDemo_scala",
+ version := "0.1",
+ scalaVersion := "2.9.0-1",
+ platformName in Android := "android-10"
+ )
+
+ lazy val fullAndroidSettings =
+ General.settings ++
+ AndroidProject.androidSettings ++
+ TypedResources.settings ++
+ AndroidMarketPublish.settings ++ Seq (
+ keyalias in Android := "change-me",
+ libraryDependencies += "org.scalatest" %% "scalatest" % "1.6.1" % "test"
+ )
+}
+
+object AndroidBuild extends Build {
+ lazy val main = Project (
+ "NfcDemo_scala",
+ file("."),
+ settings = General.fullAndroidSettings
+ )
+
+ lazy val tests = Project (
+ "tests",
+ file("tests"),
+ settings = General.settings ++ AndroidTest.androidSettings
+ ) dependsOn main
+}
View
1  project/plugins/build.sbt
@@ -0,0 +1 @@
+libraryDependencies += "org.scala-tools.sbt" %% "sbt-android-plugin" % "0.6.0-SNAPSHOT"
View
12 src/main/AndroidManifest.xml
@@ -0,0 +1,12 @@
+<manifest
+android:versionName="0.1" android:versionCode="1" package="org.proofcafe" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="10"></uses-sdk>
+ <application android:icon="@drawable/android:star_big_on" 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>
View
3  src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+<resources>
+ <string name="app_name">NfcDemo_scala</string>
+</resources>
View
14 src/main/scala/Activity.scala
@@ -0,0 +1,14 @@
+package org.proofcafe
+
+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")
+ })
+ }
+}
View
10 src/test/scala/Specs.scala
@@ -0,0 +1,10 @@
+import org.proofcafe
+import org.scalatest.matchers.ShouldMatchers
+import org.scalatest.Spec
+
+class Specs extends Spec with ShouldMatchers {
+ describe("a spec") {
+ it("should do something") {
+ }
+ }
+}
View
15 tests/src/main/AndroidManifest.xml
@@ -0,0 +1,15 @@
+<manifest package="org.proofcafe.tests" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="10"></uses-sdk>
+ <application>
+ <uses-library android:name="android.test.runner"></uses-library>
+ <activity android:name=".MainActivity" android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+ <instrumentation
+ android:label="Tests" android:targetPackage="org.proofcafe" android:name="android.test.InstrumentationTestRunner">
+</instrumentation>
+</manifest>
View
3  tests/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+<resources>
+ <string name="app_name">NfcDemo_scala</string>
+</resources>
View
10 tests/src/main/scala/UnitTests.scala
@@ -0,0 +1,10 @@
+package org.proofcafe.tests
+
+import junit.framework.Assert._
+import _root_.android.test.AndroidTestCase
+
+class UnitTests extends AndroidTestCase {
+ def testPackageIsCorrect {
+ assertEquals("org.proofcafe", getContext.getPackageName)
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.