Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Conversation

@WeaponMan
Copy link
Contributor

I updated to last eap version of kotlin, because 1.0.5-3 with kapt2 is unable to find AndroidManifest.
I added shared preferences example that is not working with kotlin.

@WonderCsabo
Copy link
Member

@WeaponMan thanks for updating the sample. Can you remove the non-working Pref from this PR? I want to merge this, but we should not commit non-working example code.

We want to send the non-working code to kotlin devs ofc.

@dodgex
Copy link
Member

dodgex commented Dec 30, 2016

also i'm not sure if we want to use kotlin EAP in the sample project?

@WonderCsabo
Copy link
Member

WonderCsabo commented Dec 30, 2016 via email

@WeaponMan
Copy link
Contributor Author

WeaponMan commented Dec 30, 2016

I updated to EAP, because kapt2 was unable to find AndroidManifest file.
EAP version containts new kapt3 code that works mostly ok.
But it seams that generated code is not added to classpath of kapt gradle task.
I tried this without plugin (kotlin-kapt) which brings back the first version of kapt.
The build errors at generating stubs. (Unable to compile Cl class generated by kapt).

I will revert non working stuff and remove eap version from this PR tomorrow.

@WeaponMan WeaponMan changed the title Updated kotlin example and added non working @Pref Updated kotlin example Dec 31, 2016
@WeaponMan
Copy link
Contributor Author

WeaponMan commented Dec 31, 2016

Updated to 1.0.6 which was released on Dec 27. Totally missed that.

@@ -1,10 +1,11 @@
buildscript {
ext.kotlin_version = '1.0.6'
Copy link
Member

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.


@EActivity(R.layout.main)
open public class HelloAndroidActivity : Activity() {
open class HelloAndroidActivity : Activity() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove public?

Copy link
Contributor Author

@WeaponMan WeaponMan Jan 4, 2017

Choose a reason for hiding this comment

The 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.
https://kotlinlang.org/docs/reference/visibility-modifiers.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, thx.

@WonderCsabo
Copy link
Member

@WeaponMan pls next time use a topic branch, not just develop as a target branch.

Copy link
Member

@WonderCsabo WonderCsabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash the commits.

@WeaponMan
Copy link
Contributor Author

Squashed into one commit.

@WonderCsabo WonderCsabo merged commit 3e0621e into androidannotations:develop Jan 5, 2017
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'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changed from ' to " ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because of string interpolation.

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The 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.

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'
Copy link
Member

Choose a reason for hiding this comment

The 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).

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
Copy link
Member

Choose a reason for hiding this comment

The 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).

@dodgex
Copy link
Member

dodgex commented Jan 5, 2017

Thank you for your contribution @WeaponMan .

I added some additional comments. Unfortunately the PR is already merged.

@WonderCsabo could you have a look at those comments? i think at least for the updated versions in the other samples we should have another PR.

@WonderCsabo
Copy link
Member

WonderCsabo commented Jan 5, 2017

Yes, we should update all samples (include the Maven one), to use latest and greatest plugin and dependency versions.

@dodgex
Copy link
Member

dodgex commented Jan 5, 2017

Added new issue for updating the samples #1932

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants