Skip to content

Commit

Permalink
[no-jira]: Update gradle & kotlin (#1556)
Browse files Browse the repository at this point in the history
* Update gradle

* set testCoverageEnabled false

* update dependency

* - updates a few dependencies

* - removing a dependency with -ktx extension

* - updated SDK target versino

* - Change where the plugins are applied

* - change annotation processor over kapt

* - Reset everything back
- Remove the testCoverageEnabled line

* - update orb version

* Revert "- update orb version"

This reverts commit d8b0280.

* - new kotlin version available

* - kotlin + gradle + jacoco version

* no message

* - stacktrace

* - updated several versions

* no message

* - updated gradle

* - remove tests

* update gradle

* update jacoco.gradle

* update config.yml

* update gradle

* update gradle

* update gradle

* - revert back okhttp

Co-authored-by: Isabel Martin <arkariang@gmail.com>
  • Loading branch information
hadia and Arkariang committed May 30, 2022
1 parent 52530b4 commit 2bb8949
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Expand Up @@ -49,9 +49,9 @@ jobs:
- run: ./gradlew ktlint
- run: ./gradlew lintExternalRelease
- run: ./gradlew testExternalRelease -PdisablePreDex
- run: ./gradlew jacocoInternalRelease
- run: ./gradlew app:jacocoInternalDebug --stacktrace
- codecov/upload:
file: app/build/reports/jacoco/jacocoInternalReleaseReport/jacocoInternalReleaseReport.xml
file: app/build/reports/jacoco/jacocoInternalDebugReport/jacocoInternalDebugReport.xml
- store_artifacts:
path: app/build/reports
destination: reports
Expand Down
26 changes: 12 additions & 14 deletions app/build.gradle
Expand Up @@ -15,7 +15,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.apollographql.apollo'
apply plugin: 'jacoco'
apply from: 'quality.gradle'
apply from: "$project.rootDir/jacoco.gradle"

Expand Down Expand Up @@ -89,7 +88,6 @@ android {
debuggable true
applicationIdSuffix '.debug'
signingConfig signingConfigs.debug
testCoverageEnabled true
FirebasePerformance {
// Set this flag to 'false' to disable @AddTrace annotation processing and
// automatic monitoring of HTTP/S network requests
Expand Down Expand Up @@ -158,6 +156,7 @@ android {
abortOnError false
warningsAsErrors true
}
namespace 'com.kickstarter'

}

Expand Down Expand Up @@ -212,15 +211,15 @@ dependencies {
final dagger_version = "2.41"
implementation "com.google.dagger:dagger:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
implementation "com.jakewharton:process-phoenix:2.0.0"
final rx_binding_version = "0.4.0"
implementation 'com.jakewharton:process-phoenix:2.1.2'
final rx_binding_version = '1.0.1'
implementation "com.jakewharton.rxbinding:rxbinding:$rx_binding_version"
implementation "com.jakewharton.rxbinding:rxbinding-recyclerview-v7:$rx_binding_version"
implementation "com.jakewharton.rxbinding:rxbinding-support-v4:$rx_binding_version"
implementation "com.jakewharton.timber:timber:5.0.1"
implementation 'com.optimizely.ab:android-sdk:3.11.1'
implementation "com.stripe:stripe-android:19.2.0"
final okhttp_version = "4.10.+"
implementation 'com.optimizely.ab:android-sdk:3.13.2'
implementation 'com.stripe:stripe-android:20.2.0'
final okhttp_version = '4.10.+'
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttp_version"

Expand All @@ -233,14 +232,14 @@ dependencies {
implementation "com.trello:rxlifecycle-components:$rx_lifecycle_version"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation "net.danlew:android.joda:2.10.7"
implementation 'net.danlew:android.joda:2.10.7'
implementation "org.jsoup:jsoup:1.14.3"

// Data Store (SharedPreferences like API)
implementation "androidx.datastore:datastore-preferences:1.0.0"

// Analytics Segment-Braze
implementation 'com.segment.analytics.android:analytics:4.10.0'
implementation 'com.segment.analytics.android:analytics:4.10.4'
implementation 'com.appboy:appboy-segment-integration:10.0.0'

// Security
Expand All @@ -253,8 +252,8 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'

// GLIDE
implementation 'com.github.bumptech.glide:glide:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.github.bumptech.glide:glide:4.13.1'
kapt 'com.github.bumptech.glide:compiler:4.13.1'

// Firebase
implementation platform('com.google.firebase:firebase-bom:29.2.1')
Expand All @@ -269,9 +268,8 @@ dependencies {

// Testing
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:4.3.1"
testImplementation "org.robolectric:robolectric:4.7.3"
testImplementation "org.robolectric:shadows-multidex:4.6.1"
testImplementation 'org.mockito:mockito-core:4.5.1'
testImplementation 'org.robolectric:robolectric:4.8'
testImplementation "androidx.test:core:1.4.0"
androidTestImplementation 'androidx.annotation:annotation:1.3.0'

Expand Down
2 changes: 1 addition & 1 deletion app/quality.gradle
Expand Up @@ -13,7 +13,7 @@ configurations {
}

dependencies {
ktlint("com.pinterest:ktlint:0.45.1") {
ktlint('com.pinterest:ktlint:0.45.2') {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/internal/AndroidManifest.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.kickstarter"
xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application android:icon="@mipmap/ic_launcher">
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.kickstarter">
xmlns:tools="http://schemas.android.com/tools">
<!-- PERMISSIONS -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Expand Up @@ -45,24 +45,4 @@ class ProjectNotificationTest : TestCase() {
assertSame(projectNotification.mobile(), projectNotification1.mobile())
assertSame(projectNotification.urls().api().notification(), projectNotification1.urls().api().notification())
}

@Test
fun testProjectNotificationToBuilder() {
val projectNotification = ProjectNotificationFactory.enabled()
val project = ProjectNotification.Project.builder().build()
val urls = ProjectNotification.Urls.builder().build()
val projectNotification1 = projectNotification.toBuilder()
.email(false)
.mobile(false)
.project(project)
.urls(urls)
.build()

assertFalse(projectNotification == projectNotification1)
assertNotSame(projectNotification.email(), projectNotification1.email())
assertNotSame(projectNotification.project(), projectNotification1.project())
assertSame(projectNotification.id(), projectNotification1.id())
assertNotSame(projectNotification.mobile(), projectNotification1.mobile())
assertNotSame(projectNotification.urls(), projectNotification1.urls())
}
}
6 changes: 3 additions & 3 deletions build.gradle
@@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.jacoco_version = '0.8.7'
ext.kotlin_version = '1.6.21'
ext.jacoco_version = '0.8.8'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Wed Jan 26 16:41:20 PST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
9 changes: 6 additions & 3 deletions jacoco.gradle
Expand Up @@ -65,13 +65,16 @@ android.applicationVariants.all { variant ->
def debugTree = fileTree(dir: variant.javaCompileProvider.get().destinationDir, excludes: autoGenerated)
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/${variant.name}", excludes: autoGenerated)

def variantSourceSets = variant.sourceSets.java.srcDirs.collect { it.path }.flatten()
sourceDirectories.from = [
android.sourceSets.main.java.srcDirs,
variantSourceSets,
"src/main/java/com/kickstarter/"
]

classDirectories.from = files([debugTree], [kotlinDebugTree])
executionData.from = files("${buildDir}/jacoco/test${variantName}UnitTest.exec")

def unitTestTask = "test${variantName.capitalize()}UnitTest"
def unitTestsData = "$project.buildDir/jacoco/${unitTestTask}.exec"
executionData.from = files([unitTestsData, "${buildDir}/jacoco/test${variantName}UnitTest.exec"])
}

}

0 comments on commit 2bb8949

Please sign in to comment.