Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions 34 examples/kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
buildscript {
ext.kotlin_version = '1.0.6'

Copy link
Copy Markdown
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.


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'

Copy link
Copy Markdown
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).

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

}
}

Expand All @@ -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

Copy link
Copy Markdown
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).

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"
}

4 changes: 2 additions & 2 deletions 4 examples/kotlin/gradle/wrapper/gradle-wrapper.properties
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
Expand Up @@ -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() {

Copy link
Copy Markdown
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?

@WeaponMan WeaponMan Jan 4, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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.


@StringRes
protected lateinit var hello: String
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.