Skip to content

Commit 0bef2b9

Browse files
committed
Update example Android apps toolchain (AGP 3.5.0, AndroidX)
* Gradle 5.4.1 * AGP 3.5.0 * Migrated to AndroidX * Updated versions of all dependencies to the most recent ones * Removed proguard rules
1 parent c8a720a commit 0bef2b9

File tree

17 files changed

+112
-78
lines changed

17 files changed

+112
-78
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
apply plugin: 'com.android.application'
26
apply plugin: 'kotlin-android'
37
apply plugin: 'kotlin-android-extensions'
48

59
android {
6-
compileSdkVersion 27
10+
compileSdkVersion 29
711
defaultConfig {
812
applicationId "org.jetbrains.kotlinx.animation"
913
minSdkVersion 14
10-
targetSdkVersion 27
14+
targetSdkVersion 29
1115
versionCode 1
1216
versionName "1.0"
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14-
}
15-
buildTypes {
16-
release {
17-
minifyEnabled false
18-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19-
}
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2018
}
2119
}
2220

2321
dependencies {
24-
implementation 'com.android.support:appcompat-v7:27.1.1'
25-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
26-
implementation 'com.android.support:design:27.1.1'
27-
implementation 'android.arch.lifecycle:extensions:1.1.1'
22+
implementation 'androidx.appcompat:appcompat:1.0.2'
23+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
24+
implementation 'com.google.android.material:material:1.0.0'
25+
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
2826

2927
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
3028
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
3129

3230
testImplementation 'junit:junit:4.12'
33-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
34-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
31+
androidTestImplementation 'androidx.test:runner:1.2.0'
32+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3533
}

ui/kotlinx-coroutines-android/animation-app/app/proguard-rules.pro

-8
This file was deleted.

ui/kotlinx-coroutines-android/animation-app/app/src/main/java/org/jetbrains/kotlinx/animation/Animation.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package org.jetbrains.kotlinx.animation
26

3-
import android.arch.lifecycle.LifecycleOwner
4-
import android.arch.lifecycle.MutableLiveData
5-
import android.arch.lifecycle.Observer
6-
import android.arch.lifecycle.ViewModel
7+
import androidx.lifecycle.LifecycleOwner
8+
import androidx.lifecycle.MutableLiveData
9+
import androidx.lifecycle.Observer
10+
import androidx.lifecycle.ViewModel
711
import android.content.Context
812
import android.graphics.Canvas
913
import android.graphics.Color

ui/kotlinx-coroutines-android/animation-app/app/src/main/java/org/jetbrains/kotlinx/animation/MainActivity.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package org.jetbrains.kotlinx.animation
26

3-
import android.arch.lifecycle.ViewModelProviders
7+
import androidx.lifecycle.ViewModelProviders
48
import android.os.Bundle
5-
import android.support.v7.app.AppCompatActivity
9+
import androidx.appcompat.app.AppCompatActivity
610
import kotlinx.android.synthetic.main.activity_main.*
711
import kotlinx.android.synthetic.main.content_main.*
812

Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<!--
3+
~ Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
4+
-->
5+
6+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
37
xmlns:app="http://schemas.android.com/apk/res-auto"
48
xmlns:tools="http://schemas.android.com/tools"
59
android:layout_width="match_parent"
610
android:layout_height="match_parent"
711
tools:context="org.jetbrains.kotlinx.animation.MainActivity">
812

9-
<android.support.design.widget.AppBarLayout
13+
<com.google.android.material.appbar.AppBarLayout
1014
android:layout_width="match_parent"
1115
android:layout_height="wrap_content"
1216
android:theme="@style/AppTheme.AppBarOverlay">
1317

14-
<android.support.v7.widget.Toolbar
18+
<androidx.appcompat.widget.Toolbar
1519
android:id="@+id/toolbar"
1620
android:layout_width="match_parent"
1721
android:layout_height="?attr/actionBarSize"
1822
android:background="?attr/colorPrimary"
1923
app:popupTheme="@style/AppTheme.PopupOverlay" />
2024

21-
</android.support.design.widget.AppBarLayout>
25+
</com.google.android.material.appbar.AppBarLayout>
2226

2327
<include layout="@layout/content_main" />
2428

25-
<android.support.design.widget.FloatingActionButton
29+
<com.google.android.material.floatingactionbutton.FloatingActionButton
2630
android:id="@+id/addButton"
2731
android:layout_width="wrap_content"
2832
android:layout_height="wrap_content"
@@ -31,7 +35,7 @@
3135
app:backgroundTint="@color/colorPrimary"
3236
app:srcCompat="@android:drawable/ic_input_add" />
3337

34-
<android.support.design.widget.FloatingActionButton
38+
<com.google.android.material.floatingactionbutton.FloatingActionButton
3539
android:id="@+id/removeButton"
3640
android:layout_width="wrap_content"
3741
android:layout_height="wrap_content"
@@ -40,4 +44,4 @@
4044
app:backgroundTint="@color/colorPrimary"
4145
app:srcCompat="@android:drawable/ic_delete" />
4246

43-
</android.support.design.widget.CoordinatorLayout>
47+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

ui/kotlinx-coroutines-android/animation-app/app/src/main/res/layout/content_main.xml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<!--
3+
~ Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
4+
-->
5+
6+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
37
xmlns:app="http://schemas.android.com/apk/res-auto"
48
xmlns:tools="http://schemas.android.com/tools"
59
android:layout_width="match_parent"
@@ -17,4 +21,4 @@
1721
app:layout_constraintRight_toRightOf="parent"
1822
app:layout_constraintTop_toTopOf="parent" />
1923

20-
</android.support.constraint.ConstraintLayout>
24+
</androidx.constraintlayout.widget.ConstraintLayout>

ui/kotlinx-coroutines-android/animation-app/build.gradle

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
// Top-level build file where you can add configuration options common to all sub-projects/modules.
26

37
buildscript {
@@ -6,7 +10,7 @@ buildscript {
610
jcenter()
711
}
812
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.4.1'
13+
classpath 'com.android.tools.build:gradle:3.5.0'
1014
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1115

1216
// NOTE: Do not place your application dependencies here; they belong

ui/kotlinx-coroutines-android/animation-app/gradle.properties

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#
2+
# Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
15
# Project-wide Gradle settings.
26

37
# IDE (e.g. Android Studio) users:
@@ -16,8 +20,9 @@ org.gradle.jvmargs=-Xmx1536m
1620
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1721
# org.gradle.parallel=true
1822

19-
kotlin.coroutines=enable
20-
2123
kotlin_version=1.3.50
2224
coroutines_version=1.3.1
2325

26+
android.useAndroidX=true
27+
android.enableJetifier=true
28+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#
2+
# Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
15
distributionBase=GRADLE_USER_HOME
26
distributionPath=wrapper/dists
37
zipStoreBase=GRADLE_USER_HOME
48
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
9+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
apply plugin: 'com.android.application'
26
apply plugin: 'kotlin-android'
37
apply plugin: 'kotlin-android-extensions'
48

59
android {
6-
compileSdkVersion 27
10+
compileSdkVersion 29
711
defaultConfig {
812
applicationId "com.example.app"
913
minSdkVersion 14
10-
targetSdkVersion 27
14+
targetSdkVersion 29
1115
versionCode 1
1216
versionName "1.0"
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14-
}
15-
buildTypes {
16-
release {
17-
minifyEnabled false
18-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19-
}
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2018
}
2119
}
2220

2321
dependencies {
24-
implementation 'com.android.support:appcompat-v7:27.1.1'
25-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
26-
implementation 'com.android.support:design:27.1.1'
22+
implementation 'androidx.appcompat:appcompat:1.0.2'
23+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
24+
implementation 'com.google.android.material:material:1.0.0'
2725

2826
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2927
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
3028

3129
testImplementation 'junit:junit:4.12'
32-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
33-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
30+
androidTestImplementation 'androidx.test:runner:1.2.0'
31+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3432
}

ui/kotlinx-coroutines-android/example-app/app/proguard-rules.pro

-8
This file was deleted.

ui/kotlinx-coroutines-android/example-app/app/src/main/java/com/example/app/MainActivity.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
package com.example.app
26

37
import android.os.Bundle
4-
import android.support.design.widget.FloatingActionButton
5-
import android.support.v7.app.AppCompatActivity
8+
import com.google.android.material.floatingactionbutton.FloatingActionButton
9+
import androidx.appcompat.app.AppCompatActivity
610
import android.view.Menu
711
import android.view.MenuItem
812
import android.widget.TextView
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<!--
3+
~ Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
4+
-->
5+
6+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
37
xmlns:app="http://schemas.android.com/apk/res-auto"
48
xmlns:tools="http://schemas.android.com/tools"
59
android:layout_width="match_parent"
610
android:layout_height="match_parent"
711
tools:context="com.example.app.MainActivity">
812

9-
<android.support.design.widget.AppBarLayout
13+
<com.google.android.material.appbar.AppBarLayout
1014
android:layout_width="match_parent"
1115
android:layout_height="wrap_content"
1216
android:theme="@style/AppTheme.AppBarOverlay">
1317

14-
<android.support.v7.widget.Toolbar
18+
<androidx.appcompat.widget.Toolbar
1519
android:id="@+id/toolbar"
1620
android:layout_width="match_parent"
1721
android:layout_height="?attr/actionBarSize"
1822
android:background="?attr/colorPrimary"
1923
app:popupTheme="@style/AppTheme.PopupOverlay" />
2024

21-
</android.support.design.widget.AppBarLayout>
25+
</com.google.android.material.appbar.AppBarLayout>
2226

2327
<include layout="@layout/content_main" />
2428

25-
<android.support.design.widget.FloatingActionButton
29+
<com.google.android.material.floatingactionbutton.FloatingActionButton
2630
android:id="@+id/fab"
2731
android:layout_width="wrap_content"
2832
android:layout_height="wrap_content"
2933
android:layout_gravity="bottom|end"
3034
android:layout_margin="@dimen/fab_margin"
3135
app:srcCompat="@android:drawable/ic_dialog_email" />
3236

33-
</android.support.design.widget.CoordinatorLayout>
37+
</androidx.coordinatorlayout.widget.CoordinatorLayout>

ui/kotlinx-coroutines-android/example-app/app/src/main/res/layout/content_main.xml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<!--
3+
~ Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
4+
-->
5+
6+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
37
xmlns:app="http://schemas.android.com/apk/res-auto"
48
xmlns:tools="http://schemas.android.com/tools"
59
android:layout_width="match_parent"
@@ -18,4 +22,4 @@
1822
app:layout_constraintRight_toRightOf="parent"
1923
app:layout_constraintTop_toTopOf="parent" />
2024

21-
</android.support.constraint.ConstraintLayout>
25+
</androidx.constraintlayout.widget.ConstraintLayout>

ui/kotlinx-coroutines-android/example-app/build.gradle

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
// Top-level build file where you can add configuration options common to all sub-projects/modules.
26

37
buildscript {
@@ -6,7 +10,7 @@ buildscript {
610
jcenter()
711
}
812
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.4.1'
13+
classpath 'com.android.tools.build:gradle:3.5.0'
1014
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1115

1216
// NOTE: Do not place your application dependencies here; they belong

ui/kotlinx-coroutines-android/example-app/gradle.properties

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#
2+
# Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
15
# Project-wide Gradle settings.
26

37
# IDE (e.g. Android Studio) users:
@@ -16,8 +20,9 @@ org.gradle.jvmargs=-Xmx1536m
1620
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1721
# org.gradle.parallel=true
1822

19-
kotlin.coroutines=enable
20-
2123
kotlin_version=1.3.50
2224
coroutines_version=1.3.1
2325

26+
android.useAndroidX=true
27+
android.enableJetifier=true
28+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#
2+
# Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
15
distributionBase=GRADLE_USER_HOME
26
distributionPath=wrapper/dists
37
zipStoreBase=GRADLE_USER_HOME
48
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
9+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

0 commit comments

Comments
 (0)