Skip to content

Commit

Permalink
Update versions: Android Sdk -> v25, Gradle Plugin -> v2.2.0, Kotlin …
Browse files Browse the repository at this point in the history
…-> v1.1.1, Groovy -> 2.4.10
  • Loading branch information
SidneyXu committed Mar 30, 2017
1 parent 7663942 commit c7a20f5
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 136 deletions.
16 changes: 8 additions & 8 deletions GroovyAndroid/app/build.gradle
Expand Up @@ -3,24 +3,24 @@ buildscript {
jcenter()
}
dependencies {
classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.10'
classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'groovyx.grooid.groovy-android'
apply plugin: 'groovyx.android'

repositories {
jcenter()
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.bookislife.android.groovydemo"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand Down Expand Up @@ -54,10 +54,10 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'org.codehaus.groovy:groovy:2.4.6:grooid'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'org.codehaus.groovy:groovy:2.4.10:grooid'
// necessary when using groovy json api
compile('org.codehaus.groovy:groovy-json:2.4.6') {
compile('org.codehaus.groovy:groovy-json:2.4.10') {
transitive = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion GroovyAndroid/build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Binary file modified GroovyAndroid/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions GroovyAndroid/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon Jan 25 13:09:20 CST 2016
#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
8 changes: 4 additions & 4 deletions JavaAndroid/app/build.gradle
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.2"

lintOptions {
abortOnError false
Expand All @@ -11,7 +11,7 @@ android {
defaultConfig {
applicationId "com.bookislife.android.javademo"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -33,7 +33,7 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:appcompat-v7:25.2.0'
}

apply from: 'timetracker.gradle'
2 changes: 1 addition & 1 deletion JavaAndroid/build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-rc1'
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
6 changes: 3 additions & 3 deletions JavaAndroid/build.sbt
@@ -1,7 +1,7 @@
lazy val app = project.in(file("app")).settings(androidBuild).settings(
platformTarget := "android-23",
buildToolsVersion := Option("23.0.3"),
platformTarget := "android-25",
buildToolsVersion := Option("25.0.2"),
minSdkVersion := "16",
libraryDependencies += "com.android.support" % "appcompat-v7" % "23.3.0",
libraryDependencies += "com.android.support" % "appcompat-v7" % "25.2.0",
javacOptions in Compile ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil
)
2 changes: 1 addition & 1 deletion JavaAndroid/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
10 changes: 5 additions & 5 deletions KotlinAndroid/app/build.gradle
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.0.2'
ext.kotlin_version = '1.1.1'
repositories {
jcenter()
mavenCentral()
Expand All @@ -19,8 +19,8 @@ repositories {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.2"

lintOptions {
abortOnError false
Expand All @@ -29,7 +29,7 @@ android {
defaultConfig {
applicationId "com.bookislife.android.kotlindemo"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -54,7 +54,7 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

Expand Down
4 changes: 2 additions & 2 deletions KotlinAndroid/build.gradle
Expand Up @@ -5,11 +5,11 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-rc1'
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "net.rdrei.android.buildtimetracker:gradle-plugin:0.5.+"
classpath "net.rdrei.android.buildtimetracker:gradle-plugin:0.5.0"
}
}

Expand Down
6 changes: 3 additions & 3 deletions KotlinAndroid/build.sbt
@@ -1,10 +1,10 @@
lazy val androidClasspath = taskKey[Classpath]("android classpath")

lazy val app = project.in(file("app")).settings(androidBuild).settings(
platformTarget := "android-23",
buildToolsVersion := Option("23.0.3"),
platformTarget := "android-25",
buildToolsVersion := Option("25.0.2"),
minSdkVersion := "16",
libraryDependencies += "com.android.support" % "appcompat-v7" % "23.3.0",
libraryDependencies += "com.android.support" % "appcompat-v7" % "25.2.0",
javacOptions in Compile ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil,
kotlincPluginOptions in Compile ++= {
val plugin = KotlinPluginOptions("org.jetbrains.kotlin.android")
Expand Down
2 changes: 1 addition & 1 deletion KotlinAndroid/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
59 changes: 26 additions & 33 deletions README.md
Expand Up @@ -7,6 +7,7 @@ A simple Android application written in Java, Groovy, Scala and Kotlin in order

## ChangeLog

- 2017-03-30 Update versions: Android Sdk -> v25, Gradle Plugin -> v2.2.0, Kotlin -> v1.1.1, Groovy -> 2.4.10
- 2016-07-30 Update Scala, SBT, sbt-android versions
- 2016-05-19 Update Kotlin from v1.0.0 to v1.0.2

Expand All @@ -17,54 +18,46 @@ Only import the minimal dependencies.
## Dependence Report

- In Java
- Import `com.android.support:appcompat-v7:23.3.0`
- Import `com.android.support:appcompat-v7:25.2.0`
- In Groovy
- Import `com.android.support:appcompat-v7:23.3.0`
- Import `org.codehaus.groovy:groovy:2.4.6:grooid`
- Import `org.codehaus.groovy:groovy-json:2.4.6`
- Import `com.android.support:appcompat-v7:25.2.0`
- Import `org.codehaus.groovy:groovy:2.4.10:grooid`
- Import `org.codehaus.groovy:groovy-json:2.4.10`
- In Scala
- Import `com.android.support:appcompat-v7:23.3.0`
- Import `org.scala-lang:scala-library:2.11.7`
- Import `com.android.support:appcompat-v7:25.2.0`
- Import `org.scala-lang:scala-library:2.11.8`
- In Kotlin
- Import `com.android.support:appcompat-v7:23.3.0`
- Import `org.jetbrains.kotlin:kotlin-stdlib:1.0.2`
- Import `com.android.support:appcompat-v7:25.2.0`
- Import `org.jetbrains.kotlin:kotlin-stdlib:1.1.1`

## Analysis Report

Line Counter

| Language | Files | Blank Lines | Comment Lines | Code Lines |
| :------: | :---: | :---------: | :-----------: | :--------: |
| Java | 3 | 20 | 0 | 157 |
| Java | 3 | 20 | 9 | 157 |
| Groovy | 3 | 23 | 9 | 140 |
| Scala | 3 | 32 | 9 | 127 |
| Kotlin | 3 | 23 | 9 | 136 |

Size Counter

| Language | Disable Proguard (bytes) | Enable Proguard (bytes) |
|:--------:|-------------------------:|------------------------:|
| Java | 1,228,376 | 772,571 |
| Groovy | 3,003,235 | 1,759,722 |
| Scala | 3,277,007 | 1,008,929 |
| Kotlin | 1,525,725 | 736,843 |
| :------: | :----------------------: | :---------------------: |
| Java | 1,438,673 | 893,137 |
| Groovy | 3,395,936 | 1,982,125 |
| Scala | 3,277,007 | 1,349,352 |
| Kotlin | 1,833,258 | 903,566 |

Method Counter

| Language | Disable Proguard | Enable Proguard |
|:--------:|-----------------:|----------------:|
| Java | 16,306 | 7,065 |
| Groovy | 46,791 | 23,775 |
| Scala | 67,608 | 11,671 |
| Kotlin | 21,776 | 7,198 |

>Notice
>Update Kotlin version
>v1.0.0 -> v1.0.2
>method 23236 -> 21776
>method(proguard) 7124 -> 7198
>size 1,594,619 -> 1,525,725
>size(proguard) 776.281 -> 736,843
| :------: | :--------------: | :-------------: |
| Java | 17,416 | 7,608 |
| Groovy | 47,982 | 24,379 |
| Scala | 67,608 | 20,109 |
| Kotlin | 23,587 | 7,656 |

Build Speed

Expand All @@ -73,12 +66,12 @@ Test on MacBook Pro (Retina, 15-inch, Mid 2014 & APPLE SSD SM0256F Media)
Gradle task: `./gradlew :app:clean :app:assembleDebug`
SBT task: `sbt app/clean app/android:package`

| Language | Gradle Plugin | Time (secs) | SBT | Time (secs) |
|:--------:|:-------------:|------------:|:--------:|------------:|
| Java | 2.1.0-rc1 | ≈ 7 | 0.13.12 | ≈ 9 |
| Groovy | 1.5.0 | ≈ 21 | 0.13.12 | - |
| Scala | 1.3.1 | ≈ 23 | 0.13.12 | ≈ 17 |
| Kotlin | 2.1.0-rc1 | ≈ 8 | 0.13.12 | ≈ 16 |
| Language | Gradle Plugin | Time (secs) | SBT | Time (secs) |
| :------: | :-----------: | :---------: | :-----: | :---------: |
| Java | 2.2.0 | ≈ 8 | 0.13.12 | ≈ 10 |
| Groovy | 2.2.0 | ≈ 20 | 0.13.12 | - |
| Scala | 1.3.1 | ≈ 28 | 0.13.12 | ≈ 17 |
| Kotlin | 2.2.0 | ≈ 9 | 0.13.12 | ≈ 20 |


## Coding Comparison
Expand Down
64 changes: 32 additions & 32 deletions README_CN.md
Expand Up @@ -9,46 +9,46 @@
## 依赖情况报告

- Java
- 导入 `com.android.support:appcompat-v7:23.3.0`
- 导入 `com.android.support:appcompat-v7:25.2.0`
- Groovy
- 导入 `com.android.support:appcompat-v7:23.3.0`
- 导入 `org.codehaus.groovy:groovy:2.4.6:grooid`
- 导入 `org.codehaus.groovy:groovy-json:2.4.6`
- 导入 `com.android.support:appcompat-v7:25.2.0`
- 导入 `org.codehaus.groovy:groovy:2.4.10:grooid`
- 导入 `org.codehaus.groovy:groovy-json:2.4.10`
- Scala
- 导入 `com.android.support:appcompat-v7:23.3.0`
- 导入 `org.scala-lang:scala-library:2.11.7`
- 导入 `com.android.support:appcompat-v7:25.2.0`
- 导入 `org.scala-lang:scala-library:2.11.8`
- Kotlin
- 导入 `com.android.support:appcompat-v7:23.3.0`
- 导入 `org.jetbrains.kotlin:kotlin-stdlib:1.0.2`
- 导入 `com.android.support:appcompat-v7:25.2.0`
- 导入 `org.jetbrains.kotlin:kotlin-stdlib:1.1.1`

## 分析报告

行数统计

| 语言 | 文件数 | 空行数 | 注释行数 | 代码行数 |
|:--------:|:--------:|:--------:|:--------:|:--------:|
| Java | 3 | 20 | 0 | 157 |
| Groovy | 3 | 23 | 9 | 140 |
| Scala | 3 | 32 | 9 | 127 |
| Kotlin | 3 | 23 | 9 | 136 |
| 语言 | 文件数 | 空行数 | 注释行数 | 代码行数 |
| :----: | :--: | :--: | :--: | :--: |
| Java | 3 | 20 | 9 | 157 |
| Groovy | 3 | 23 | 9 | 140 |
| Scala | 3 | 32 | 9 | 127 |
| Kotlin | 3 | 23 | 9 | 136 |

大小统计

| 语言 | 不使用 Proguard (字节) | 使用 Proguard (字节) |
|:--------:|:--------:|:--------:|
| Java | 1,228,376 | 772,571
| Groovy | 3,003,235 | 1,759,722
| Scala | 3,277,007 | 1,008,929
| Kotlin | 1,595,108 | 778,629
| 语言 | 不使用 Proguard (字节) | 使用 Proguard (字节) |
| :----: | :---------------: | :--------------: |
| Java | 1,438,673 | 893,137 |
| Groovy | 3,395,936 | 1,982,125 |
| Scala | 3,277,007 | 1,349,352 |
| Kotlin | 1,833,258 | 903,566 |

方法数量

| 语言 | 不使用 Proguard | 使用 Proguard |
|:--------:|:--------:|:--------:|
| Java | 163,06 | 7,065
| Groovy | 46,791 | 23,775
| Scala | 67,608 | 11,671
| Kotlin | 23,236 | 7,198
| 语言 | 不使用 Proguard | 使用 Proguard |
| :----: | :----------: | :---------: |
| Java | 17,416 | 7,608 |
| Groovy | 47,982 | 24,379 |
| Scala | 67,608 | 20,109 |
| Kotlin | 23,587 | 7,656 |

编译速度

Expand All @@ -58,12 +58,12 @@ Gradle 测试命令: `./gradlew :app:clean :app:assembleDebug`
SBT 测试命令: `sbt app/clean app/android:package`


| 语言 | Gradle Plugin 版本 | 耗时 (秒) | SBT | 耗时 (秒)
|:--------:|:--------:|:--------:|:--------:|:--------:|
| Java | 2.1.0-rc1 | ≈ 7 | 0.13.12 | ≈ 9
| Groovy | 1.5.0 | ≈ 21 | 0.13.12 | -
| Scala | 1.3.1 | ≈ 23 | 0.13.12 | ≈ 17
| Kotlin | 2.1.0-rc1 | ≈ 8 | 0.13.12 | ≈ 16
| 语言 | Gradle Plugin 版本 | 耗时 (秒) | SBT | 耗时 (秒) |
| :----: | :--------------: | :----: | :-----: | :----: |
| Java | 2.2.0 | ≈ 8 | 0.13.12 | ≈ 10 |
| Groovy | 2.2.0 | ≈ 20 | 0.13.12 | - |
| Scala | 1.3.1 | ≈ 28 | 0.13.12 | ≈ 17 |
| Kotlin | 2.2.0 | ≈ 9 | 0.13.12 | ≈ 20 |

## 代码对比

Expand Down

0 comments on commit c7a20f5

Please sign in to comment.