This file contains 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
buildscript { | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.2.3' | |
classpath 'jp.leafytree.gradle:gradle-android-scala-plugin:1.4' | |
} | |
} |
This file contains 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
// 在最上面加入 apply plugin | |
apply plugin: "com.android.application" | |
apply plugin:"jp.leafytree.android-scala" |
This file contains 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
compile 'org.scala-lang:scala-library:2.11.7' |
This file contains 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.example.rayshih.scala_example | |
import android.app.Activity | |
import android.os.Bundle | |
import android.widget.TextView | |
class MainActivity extends Activity { | |
override def onCreate(savedInstanceState: Bundle): Unit = { | |
super.onCreate(savedInstanceState) |
This file contains 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
buildTypes { | |
debug { | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
release { | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} |
This file contains 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
-dontoptimize | |
-dontobfuscate | |
-dontpreverify | |
-dontwarn scala.** | |
-ignorewarnings | |
# temporary workaround; see Scala issue SI-5397 | |
-keep class scala.collection.SeqLike { | |
public protected *; | |
} |
This file contains 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
android { | |
defaultConfig { | |
// other setting | |
// minSdkVersion 15 // 這行要拿掉 | |
multiDexEnabled true // 設定啟動 multidex | |
} | |
productFlavors { | |
dev { | |
minSdkVersion 21 // only apply after android 5.0 |
This file contains 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
<application | |
android:name="android.support.multidex.MultiDexApplication"> | |
// other config | |
</application> |
This file contains 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.rayshih.scala_example | |
import android.app.Application | |
import android.content.Context | |
import android.support.multidex.MultiDex | |
class MyApp extends Application { | |
// add this | |
override protected def attachBaseContext(base: Context) = { |
This file contains 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
'use strict'; | |
const m = -2; | |
function prepare(n) { | |
let b = 1; | |
let min = 0; | |
let max = 1; | |
const bs = [1]; |