Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated all dependencies in Pr/40 #47

Open
wants to merge 5 commits into
base: pr/40
Choose a base branch
from
Open
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
72 changes: 36 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
/**
* The buildscript block is where you configure the repositories and
* dependencies for Gradle itself—meaning, you should not include dependencies
* for your modules here. For example, this block includes the Android plugin for
* Gradle as a dependency because it provides the additional instructions Gradle
* needs to build Android app modules.
*/
buildscript {
ext {
versions = [
kotlin : "1.4.31",
moshi : '1.8.0',
okhttp : '3.11.0',
jupiter : '5.7.0',
kotlin : "1.5.31",
moshi : '1.12.0',
okhttp : '4.9.1',
jupiter : '5.8.1',

'minSdk' : 14,
'compileSdk' : 28,
'buildTools' : '28.0.3',
'androidPlugin' : '4.0.0',
'minSdk' : 28,
'compileSdk' : 31,

androidx_app_compat : '1.0.2',
androidx_card_view : '1.0.0',
androidx_constraint_layout: '1.1.3',
androidx_lifecycle : '2.0.0',
androidx_test_ext : '1.1.0',
androidx_recycler_view : '1.0.0',
androidx_room : '2.0.0',
androidx_app_compat : '1.3.1',
androidx_card_view : '1.0.0',
androidx_constraint_layout: '1.1.3',
androidx_lifecycle : '2.0.0',
androidx_test_ext : '1.1.0',
androidx_recycler_view : '1.0.0',
androidx_room : '2.0.0',

multidex : '2.0.1',
khex : '1.1.2'
]

ext.deps = [
android: [
'runtime' : 'com.google.android:android:4.1.1.4',
'gradlePlugin': "com.android.tools.build:gradle:${versions.androidPlugin}",
]
]
versions.kotlin = '1.3.72'
}

repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
}

/**
* The dependencies block configures the dependencies Gradle needs to use
* to build your project. The following line adds Android plugin for Gradle
* version 4.2.0 as a classpath dependency.
*/
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
// How can we move this to the sample folder
//classpath deps.android.gradlePlugin
}
repositories {
google()
}
}

apply plugin: "com.github.ben-manes.versions"
// By default, the plugins {} DSL resolves plugins from the public Gradle Plugin Portal. Apply not
// needed when using this.
plugins {
// Checks for newer lib versions.
id "com.github.ben-manes.versions" version "0.39.0"
}
21 changes: 21 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# 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=-Xmx2048m -Dfile.encoding=UTF-8
# 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
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
49 changes: 36 additions & 13 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,57 @@
apply plugin: "kotlin"
apply plugin: 'maven'

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
plugins {
id 'java-library'
id 'kotlin'
id 'maven-publish'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"

implementation "com.github.komputing:khex:1.1.0"
// KHex is a Kotlin multiplatform library to deal with hexadecimal encoding and decoding.
implementation "com.github.komputing:khex:$versions.khex"

implementation "org.bouncycastle:bcprov-jdk15to18:1.68"
implementation "org.bouncycastle:bcprov-jdk15to18:1.69"

implementation 'com.squareup.moshi:moshi:1.8.0'
implementation "com.squareup.moshi:moshi:${versions.moshi}"
// TODO: it would be better to use the generated adapter by moshi
// but for that we should move the implementations in different modules
//kapt "com.squareup.moshi:moshi-kotlin-codegen:$versions.moshi"
implementation "com.squareup.moshi:moshi-kotlin:$versions.moshi"

implementation "com.squareup.okhttp3:okhttp:$versions.okhttp"

testImplementation 'org.assertj:assertj-core:3.19.0'

// (Required) Writing and executing Unit Tests on the JUnit Platform
testImplementation "org.junit.jupiter:junit-jupiter-api:${versions.jupiter}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${versions.jupiter}"
testRuntime "org.junit.jupiter:junit-jupiter-engine:${versions.jupiter}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.jupiter}"

// (Optional) If you need "Parameterized Tests"
testImplementation "org.junit.jupiter:junit-jupiter-params:${versions.jupiter}"

testImplementation "com.squareup.okhttp3:mockwebserver:$versions.okhttp"
}

test {
useJUnitPlatform()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

afterEvaluate {
publishing {
publications {
// Creates a Maven publication called “walletconnectPublication”.
walletconnectPublication(MavenPublication) {
// Applies the component for the debug build variant.
from components.java

groupId = 'com.github.WalletConnect'
artifactId = 'kotlin-walletconnect-lib'
version = '0.9.7'
}
}
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.walletconnect

import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import okhttp3.OkHttpClient
import org.junit.Test
import org.walletconnect.impls.FileWCSessionStore
Expand All @@ -19,7 +20,7 @@ class WalletConnectBridgeRepositoryIntegrationTest {
//@Test
fun approveSession() {
val client = OkHttpClient.Builder().pingInterval(1000, TimeUnit.MILLISECONDS).build()
val moshi = Moshi.Builder().build()
val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
val sessionDir = File("build/tmp/").apply { mkdirs() }
val sessionStore = FileWCSessionStore(File(sessionDir, "test_store.json").apply { createNewFile() }, moshi)
val uri =
Expand Down
61 changes: 38 additions & 23 deletions sample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand All @@ -19,49 +17,66 @@ android {
versionName '1.0.0'
}

dexOptions {
jumboMode = true
}

lintOptions {
textReport true
textOutput 'stdout'
checkDependencies true
}

/**
* The buildTypes block is where you can configure multiple build types.
* By default, the build system defines two build types: debug and release. The
* debug build type is not explicitly shown in the default build configuration,
* but it includes debugging tools and is signed with the debug key. The release
* build type applies Proguard settings and is not signed by default.
*/
buildTypes {

/**
* By default, Android Studio configures the release build type to enable code
* shrinking, using minifyEnabled, and specifies the default Proguard rules file.
*/
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
minifyEnabled false
}

release {
minifyEnabled true // Enables code shrinking for the release build type.
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

// The kotlinx-coroutines-core artifact contains a resource file that is not required for the coroutines to operate normally and is only used by the debugger. To exclude it at no loss of functionality, add the following snippet to the android block in your Gradle file for the application subproject:
// https://github.com/Kotlin/kotlinx.coroutines
packagingOptions {
resources.excludes += "DebugProbesKt.bin"
}
}

repositories {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://www.jitpack.io' }
buildFeatures {
viewBinding true
}
}

dependencies {
implementation project(":lib")
// Instead of adding ":lib" you could add the url below:
//implementation 'com.github.WalletConnect:kotlin-walletconnect-lib:0.9.6'

implementation "org.java-websocket:Java-WebSocket:1.4.0"
implementation "org.java-websocket:Java-WebSocket:1.5.2"

implementation "com.github.komputing:khex:1.0.0-RC6"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
// KHex is a Kotlin multiplatform library to deal with hexadecimal encoding and decoding.
implementation "com.github.komputing:khex:$versions.khex"

implementation "androidx.appcompat:appcompat:$versions.androidx_app_compat"
implementation "androidx.multidex:multidex:$versions.multidex"

implementation 'com.squareup.moshi:moshi:1.8.0'
implementation 'com.squareup.moshi:moshi:1.12.0'
implementation "com.squareup.moshi:moshi-kotlin:$versions.moshi"

implementation "com.squareup.okhttp3:okhttp:$versions.okhttp"

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'

}
6 changes: 4 additions & 2 deletions sample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:name=".ExampleApplication">
<activity android:name=".MainActivity">
android:name=".ExampleApplication"
android:networkSecurityConfig="@xml/network_config">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.walletconnect.example

import androidx.multidex.MultiDexApplication
import android.app.Application
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import io.walletconnect.example.server.BridgeServer
import okhttp3.OkHttpClient
import org.komputing.khex.extensions.toNoPrefixHexString
Expand All @@ -11,7 +12,7 @@ import org.walletconnect.nullOnThrow
import java.io.File
import java.util.*

class ExampleApplication : MultiDexApplication() {
class ExampleApplication : Application() {
override fun onCreate() {
super.onCreate()
initMoshi()
Expand All @@ -25,7 +26,7 @@ class ExampleApplication : MultiDexApplication() {
}

private fun initMoshi() {
moshi = Moshi.Builder().build()
moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
}


Expand Down
Loading