Move Android compiler plugin tests to android-compiler-plugin module

This commit is contained in:
Yan Zhulanow
2014-11-06 15:20:20 +03:00
parent efff642635
commit fa62d3bcec
63 changed files with 70 additions and 79 deletions
@@ -0,0 +1,33 @@
package com.myapp
import android.app.Activity
import android.view.View
import android.widget.*
import org.my.cool.MyButton
class R {
class id {
class object {
val login = 5
}
}
}
class MyActivity(): Activity() {
val buttonWidget = MyButton(this)
override fun findViewById(id: Int): View? {
return when (id) {
R.id.login -> buttonWidget
else -> null
}
}
public fun box(): String {
return if (login.toString() == "MyButton") "OK" else ""
}
}
fun box(): String {
return MyActivity().box()
}
@@ -0,0 +1,29 @@
package com.myapp
import android.app.Activity
import android.view.View
import android.widget.*
import org.my.cool.MyButton
class R {
class id {
class object {
val login = 5
}
}
}
class MyActivity(): Activity() {
val buttonWidget = MyButton(this)
override fun findViewById(id: Int): View? {
return when (id) {
R.id.login -> buttonWidget
else -> null
}
}
}
fun box(): String {
return "OK"
}
@@ -0,0 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
<permission android:name="android"></permission>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sample" >
<activity
android:name="com.example.android.basiccontactables.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop">
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,8 @@
package org.my.cool
import android.widget.Button
import android.app.Activity
class MyButton(ctx: Activity): Button(ctx) {
override fun toString(): String {return "MyButton"}
}
@@ -0,0 +1,15 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<view
class="org.my.cool.MyButton"
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>