-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Updated kotlin example #1928
Updated kotlin example #1928
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| buildscript { | ||
| ext.kotlin_version = '1.0.6' | ||
|
|
||
| repositories { | ||
| jcenter() | ||
| } | ||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:2.1.0' | ||
| classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.2' | ||
| classpath 'com.android.tools.build:gradle:2.2.3' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when updating versions in this sample we should also update the versions in the gradle sample (and if necessary in the maven samples too). |
||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why changed from ' to " ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed because of string interpolation.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay. do we want to be consistent and update the other lines too? if it is no noticeable performance drawback?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should use double quotes in all Gradle scripts for strings, yes. It looks better for consistency. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -15,28 +17,32 @@ repositories { | |
|
|
||
| apply plugin: 'com.android.application' | ||
| apply plugin: 'kotlin-android' | ||
| def AAVersion = '4.3.0-SNAPSHOT' // change this to your desired version, for example the latest stable: 4.2.0 | ||
|
|
||
| dependencies { | ||
| kapt "org.androidannotations:androidannotations:$AAVersion" | ||
| compile "org.androidannotations:androidannotations-api:$AAVersion" | ||
| compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.2' | ||
| } | ||
| apply plugin: 'kotlin-kapt' | ||
|
|
||
| android { | ||
| compileSdkVersion 23 | ||
| buildToolsVersion "23.0.3" | ||
| compileSdkVersion 25 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when updating versions in this sample we should also update the versions in the gradle sample (and if necessary in the maven samples too). |
||
| buildToolsVersion "25.0.2" | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion 9 | ||
| targetSdkVersion 23 | ||
| targetSdkVersion 25 | ||
| } | ||
| sourceSets { | ||
| main.java.srcDirs += 'src/main/kotlin' | ||
| } | ||
| } | ||
|
|
||
| kapt { | ||
| generateStubs = true | ||
|
|
||
| arguments { | ||
| arg("androidManifestFile", variant.outputs[0].processResourcesTask.manifestFile) | ||
| } | ||
| } | ||
|
|
||
| def AAVersion = '4.3.0-SNAPSHOT' // change this to your desired version, for example the latest stable: 4.2.0 | ||
|
|
||
| dependencies { | ||
| kapt "org.androidannotations:androidannotations:$AAVersion" | ||
| compile "org.androidannotations:androidannotations-api:$AAVersion" | ||
| compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #Tue Dec 09 11:11:25 CET 2014 | ||
| #Fri Dec 30 13:14:19 CET 2016 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ import org.androidannotations.gradle.R | |
| import java.util.Date | ||
|
|
||
| @EActivity(R.layout.main) | ||
| open public class HelloAndroidActivity : Activity() { | ||
| open class HelloAndroidActivity : Activity() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Classes with no access modifier are always public in kotlin. There is no need to type public.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know, thx. |
||
|
|
||
| @StringRes | ||
| protected lateinit var hello: String | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line after this.