Skip to content

Commit

Permalink
Fixes #58 : Upgrade all dependencies (#59)
Browse files Browse the repository at this point in the history
* Upgrade all dependencies

* fixed build fail

* Updated jdk to 17 in cicd
  • Loading branch information
Aditya-gupta99 authored Aug 5, 2023
1 parent 7df7cdb commit 7849760
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 50 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ jobs:
~/.gradle/wrapper
key: ${{ runner.OS }}-gradle-cache-${{ hashFiles('**/build.gradle') }}

# jdk 17
- name: Set Up JDK
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17

- name: Run test
run: ./gradlew check
Expand Down
31 changes: 18 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand All @@ -27,28 +26,32 @@ android {
abortOnError false
}

packagingOptions {
exclude 'META-INF/core_release.kotlin_module'
}

}

dependencies {
//implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.multidex:multidex:2.0.0'
implementation "androidx.multidex:multidex:$rootProject.multidexVersion"
implementation ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"){
force true
}
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.appcompat:appcompat:$rootProject.appCompatVersion"
testImplementation "junit:junit:$rootProject.jUnitVersion"
androidTestImplementation "androidx.test.ext:junit:$rootProject.androidJUnitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.androidEsspressoVersion"

// RecyclerView and CardView
implementation 'androidx.cardview:cardview:1.0.0'
// RecyclerView and CardView dependencies
implementation "androidx.cardview:cardview:$rootProject.cardviewVersion"

implementation "io.reactivex:rxandroid:$rxAndroidVersion"
implementation "io.reactivex:rxjava:$rxJavaVersion"
// rx Java dependencies
implementation "io.reactivex:rxandroid:$rootProject.rxAndroidVersion"
implementation "io.reactivex:rxjava:$rootProject.rxJavaVersion"

// Lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
// Lifecycle dependency
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"

//Square dependencies
implementation("com.squareup.retrofit2:retrofit:$retrofitVersionLatest") {
Expand All @@ -62,5 +65,7 @@ dependencies {
implementation "com.squareup.okhttp3:logging-interceptor:$okHttp3Version"

implementation project(path: ':core')

// fineract dependency
implementation ("com.github.openMF:fineract-client:$fineractClientVersion")
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".ui.HomeActivity">
<activity android:name=".ui.HomeActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/org/mifos/ui/HomeActivity.kt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
package org.mifos.ui

import android.os.Build
import android.os.Bundle
import android.util.Log
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import org.apache.fineract.client.models.*
import org.mifos.R
import org.mifos.core.apimanager.BaseApiManager
import org.mifos.core.apimanager.BaseUrl.Companion.API_ENDPOINT
import org.mifos.core.apimanager.BaseUrl.Companion.API_PATH
import org.mifos.core.apimanager.BaseUrl.Companion.PROTOCOL_HTTPS
import rx.Subscriber
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import java.util.*

class HomeActivity : AppCompatActivity(){

val base_url = "https://10.0.2.2:8443/fineract-provider/api/v1/"
val tenant = "default"
lateinit var baseApiManager: BaseApiManager
private val baseUrl = PROTOCOL_HTTPS+ API_ENDPOINT+ API_PATH
private val tenant = "default"
private lateinit var baseApiManager: BaseApiManager

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)


baseApiManager = BaseApiManager.getInstance()
baseApiManager.createService("mifos", "password", base_url, tenant, false)
baseApiManager.createService("mifos", "password", baseUrl, tenant, false)

val body = "{\"username\": \"mifos\", \"password\": \"password\"}"

Expand Down
59 changes: 48 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.31'
ext.kotlin_version = '1.8.20'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -17,27 +17,64 @@ buildscript {

ext {
// Sdk and tools
minSdkVersion = 15
targetSdkVersion = 28
compileSdkVersion = 28
minSdkVersion = 26
targetSdkVersion = 33
compileSdkVersion = 33
buildToolsVersion = '28.0.3'

// multidex version
multidexVersion = '2.0.1'

// cardView dependency
cardviewVersion = '1.0.0'

//
lifecycleVersion = '2.2.0'

// appcompat version
appCompatVersion = '1.6.1'

// jUnit version
jUnitVersion = '4.13.2'

// androidJunit
androidJUnitVersion = '1.1.5'

// android espresso
androidEsspressoVersion = '3.5.1'

// App dependencies
supportLibraryVersion = '27.1.1'

// espresso version
espressoVersion = '2.2.2'
retrofitVersionLatest = '2.1.0'
okHttp3Version = '3.5.0'
preference = '1.1.0'
rxJavaVersion = '1.1.4'

// retrofit version
retrofitVersionLatest = '2.9.0'

// okHttp3 version
okHttp3Version = '4.9.2'

// preference version
preference = '1.2.1'

// rxJava version
rxJavaVersion = '1.3.8'

// rxJavaAndroid version
rxAndroidVersion = '1.1.0'

// fineract version
fineractClientVersion = '2.0.3'

// truth version
truthVersion = '1.1.3'
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Expand Down
32 changes: 18 additions & 14 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
compileSdkVersion 33
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 15
targetSdkVersion 29
minSdkVersion 26
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand All @@ -23,24 +22,28 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

packagingOptions {
exclude 'META-INF/core_release.kotlin_module'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.appcompat:appcompat:$rootProject.appCompatVersion"
testImplementation "junit:junit:$rootProject.jUnitVersion"
androidTestImplementation "androidx.test.ext:junit:$rootProject.androidJUnitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.androidEsspressoVersion"


//testing dependency
androidTestImplementation "com.google.truth:truth:1.1.3"
androidTestImplementation "com.google.truth:truth:$rootProject.truthVersion"

implementation ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"){
force true
}
// Kotlin standard library dependency
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation 'io.reactivex:rxjava:1.1.4'
// rxJava dependency
implementation "io.reactivex:rxjava:$rxJavaVersion"

//Square dependencies
implementation("com.squareup.retrofit2:retrofit:$retrofitVersionLatest") {
Expand All @@ -53,9 +56,10 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:$okHttp3Version"
implementation "com.squareup.okhttp3:logging-interceptor:$okHttp3Version"

//Shared Preferences
//Shared Preferences dependency
implementation "androidx.preference:preference:$preference"

// fineractClient dependency
implementation ("com.github.openMF:fineract-client:$fineractClientVersion")

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object MifosOkHttpClient {
sslContext.init(null, trustAllCerts, SecureRandom())
val builder = OkHttpClient.Builder()

builder.sslSocketFactory(sslContext.socketFactory)
builder.sslSocketFactory(sslContext.socketFactory,trustAllCerts[0] as X509TrustManager)
builder.hostnameVerifier(HostnameVerifier { _, _ -> true })

//Enable Full Body Logging
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 --add-opens java.base/java.io=ALL-UNNAMED
# added --add-opens java.base/java.io=ALL-UNNAMED to resolve error module java.base does not "opens java.io" to unnamed module
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
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-6.7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip

0 comments on commit 7849760

Please sign in to comment.