Created
January 31, 2012 06:07
-
-
Save loganj/1709186 to your computer and use it in GitHub Desktop.
Sample config for android-plugin/library pull request
This file contains hidden or 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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.github.gist.apklibsample"> | |
<application | |
android:icon="@drawable/android:star_big_on" | |
android:label="@string/app_name" | |
android:debuggable="true"> | |
<activity android:label="@string/app_name" android:name=".MainActivity" android:theme="@style/Theme.Sherlock"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN"/> | |
<category android:name="android.intent.category.LAUNCHER"/> | |
</intent-filter> | |
</activity> | |
</application> | |
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/> | |
</manifest> |
This file contains hidden or 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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.github.gist.apklibsample.tests"> | |
<application> | |
<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> | |
<uses-library android:name="android.test.runner"/> | |
</application> | |
<instrumentation android:label="Tests" | |
android:targetPackage="com.github.gist.apklibsample" | |
android:name="android.test.InstrumentationTestRunner"/> | |
<uses-sdk android:minSdkVersion="15"/> | |
</manifest> |
This file contains hidden or 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 AndroidKeys._ | |
object General { | |
val settings = Defaults.defaultSettings ++ Seq ( | |
name := "Apklib Sample", | |
version := "0.1", | |
versionCode := 0, | |
scalaVersion := "2.9.1", | |
platformName in Android := "android-15", | |
resolvers += "ActionBarSherlock snapshots" at "http://r.jakewharton.com/maven/snapshot/" | |
) | |
val proguardSettings = Seq ( | |
useProguard in Android := true | |
) | |
lazy val fullAndroidSettings = | |
General.settings ++ | |
AndroidProject.androidSettings ++ | |
TypedResources.settings ++ | |
proguardSettings ++ | |
AndroidManifestGenerator.settings ++ | |
AndroidMarketPublish.settings ++ Seq ( | |
keyalias in Android := "change-me", | |
libraryDependencies += "org.scalatest" %% "scalatest" % "1.7.RC1" % "test" | |
) | |
} | |
object AndroidBuild extends Build { | |
lazy val main = Project ( | |
"Apklib Sample", | |
file("."), | |
settings = General.fullAndroidSettings | |
) | |
lazy val tests = Project ( | |
"tests", | |
file("tests"), | |
settings = General.settings ++ | |
AndroidTest.settings ++ | |
General.proguardSettings ++ Seq ( | |
name := "Apklib SampleTests" | |
) | |
) dependsOn main | |
} |
This file contains hidden or 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 AndroidKeys._ | |
libraryDependencies ++= Seq( | |
"com.actionbarsherlock" % "library" % "4.0.0-SNAPSHOT" artifacts(Artifact("library", "apklib", "apklib")), | |
"android" % "compatibility-v4" % "r3-SNAPSHOT" | |
) | |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/textview" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"/> | |
</LinearLayout> |
This file contains hidden or 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
package com.github.gist.apklibsample | |
import _root_.android.app.Activity | |
import _root_.android.os.Bundle | |
import com.actionbarsherlock.app.SherlockActivity | |
class MainActivity extends SherlockActivity with TypedActivity { | |
override def onCreate(bundle: Bundle) { | |
super.onCreate(bundle) | |
setContentView(R.layout.main) | |
findView(TR.textview).setText("hello, world!") | |
} | |
} |
This file contains hidden or 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
resolvers += "nexus snapshots" at "http://nexus.scala-tools.org/content/repositories/snapshots" | |
addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.1-SNAPSHOT") | |
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/" | |
addSbtPlugin("com.github.mpeltonen" %% "sbt-idea" % "1.0.0") |
This file contains hidden or 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 com.github.gist.apklibsample | |
import org.scalatest.matchers.ShouldMatchers | |
import org.scalatest.FunSpec | |
class Specs extends FunSpec with ShouldMatchers { | |
describe("a spec") { | |
it("should do something") { | |
} | |
} | |
} |
This file contains hidden or 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
<resources> | |
<string name="app_name">Apklib Sample</string> | |
</resources> |
This file contains hidden or 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
<resources> | |
<string name="app_name">Apklib Sample</string> | |
</resources> |
This file contains hidden or 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
package com.github.gist.apklibsample.tests | |
import com.github.gist.apklibsample._ | |
import junit.framework.Assert._ | |
import _root_.android.test.AndroidTestCase | |
import _root_.android.test.ActivityInstrumentationTestCase2 | |
class AndroidTests extends AndroidTestCase { | |
def testPackageIsCorrect() { | |
assertEquals("com.github.gist.apklibsample", getContext.getPackageName) | |
} | |
} | |
class ActivityTests extends ActivityInstrumentationTestCase2(classOf[MainActivity]) { | |
def testHelloWorldIsShown() { | |
val activity = getActivity | |
val textview = activity.findView(TR.textview) | |
assertEquals(textview.getText, "hello, world!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment