Skip to content

Commit

Permalink
Merge v1.0-beta-16 changes from develop
Browse files Browse the repository at this point in the history
Merge changes for v1.0-beta-16.
  • Loading branch information
KotlinGeekDev authored Feb 20, 2025
2 parents 0807168 + 24516dd commit be28a1e
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# push:
# branches: ["develop"]
release:
types: [released]
types: [released, prereleased]

concurrency:
group: ${{ github.ref }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can include the library from either Maven Central or Jitpack.
You can include the library in the common source set like this:
```kotlin
dependencies {
implementation("io.github.kotlingeekdev:rhodium:1.0-beta-15")
implementation("io.github.kotlingeekdev:rhodium:1.0-beta-16")

}
```
Expand Down Expand Up @@ -74,7 +74,7 @@ then, in your module's `build.gradle(.kts)`, you need to add:
// build.gradle.kts
dependencies {
//...
implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-15")
implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-16")


}
Expand All @@ -85,7 +85,7 @@ If you're including it in an Android app, you can just add:
// app/build.gradle.kts
dependencies {
//...
implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-15")
implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-16")

}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ allprojects {
val isJitpack = System.getenv("JITPACK") == "true"

group = "io.github.kotlingeekdev"
version = "1.0-beta-15"
version = "1.0-beta-16"


// val javadocJar = tasks.register<Jar>("javadocJar") {
Expand Down
89 changes: 37 additions & 52 deletions rhodium-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ plugins {
// `maven-publish`
}

android {
namespace = "io.github.kotlingeekdev.rhodium.android"
compileSdk = 34
defaultConfig {
minSdk = 21
targetSdk = 34
compileSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

compileOptions {
isCoreLibraryDesugaringEnabled = false
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

}


kotlin {
//explicitApi()
Expand All @@ -45,7 +66,7 @@ kotlin {
}


androidTarget {
androidTarget() {

publishAllLibraryVariants()
@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand Down Expand Up @@ -78,7 +99,6 @@ kotlin {
iosArm64()
iosSimulatorArm64()


applyDefaultHierarchyTemplate()

sourceSets {
Expand Down Expand Up @@ -119,7 +139,6 @@ kotlin {
}

val commonJvmMain by getting {
dependsOn(commonMain.get())

dependencies {
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:$kotlinCryptoVersion")
Expand All @@ -132,7 +151,6 @@ kotlin {
}

val commonJvmTest by getting {
dependsOn(commonTest.get())

dependencies {
implementation(kotlin("test-junit5"))
Expand All @@ -148,20 +166,29 @@ kotlin {



val androidMain by getting {
androidMain.configure {

dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
// coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3")
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:$kotlinCryptoVersion")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-android:0.15.0")
}
}

androidInstrumentedTest.configure {
// dependsOn(commonJvmTest)
androidUnitTest.configure {
dependencies {
implementation("junit:junit:4.13.2")
}
}

val androidUnitTest by getting {
// dependsOn(commonJvmTest)
androidInstrumentedTest.configure {
dependencies {
implementation("androidx.test.ext:junit:1.2.1")
implementation("androidx.test.espresso:espresso-core:3.6.1")
}
}

linuxMain.configure {
Expand All @@ -180,6 +207,7 @@ kotlin {
}

appleMain.configure {
dependsOn(commonMain.get())
dependencies {
implementation("io.ktor:ktor-client-darwin:$ktorVersion")
implementation("dev.whyoleg.cryptography:cryptography-provider-apple:$kotlinCryptoVersion")
Expand All @@ -191,49 +219,6 @@ kotlin {
}
}

android {
namespace = "io.github.kotlingeekdev.rhodium.android"
compileSdk = 34
defaultConfig {
minSdk = 21
targetSdk = 34
compileSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
aarMetadata {

}
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
isMinifyEnabled = true
}
debug {
aarMetadata {

}
isMinifyEnabled = false
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = false
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {
// coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}

}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>() {
compilerOptions {
Expand Down
24 changes: 24 additions & 0 deletions rhodium-core/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# preserve the line number information for debugging stack traces.
-dontobfuscate
-keepattributes LocalVariableTable
-keepattributes LocalVariableTypeTable
-keepattributes *Annotation*
-keepattributes SourceFile
-keepattributes LineNumberTable
-keepattributes Signature
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes EnclosingMethod
-keepattributes MethodParameters
-keepparameternames


# Keep all names
-keepnames class ** { *; }

# Keep All enums
-keep enum ** { *; }

# preserve access to native classses
-keep class fr.acinq.secp256k1.** { *; }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package rhodium.crypto

import dev.whyoleg.cryptography.CryptographyProvider
import dev.whyoleg.cryptography.providers.jdk.JDK
import dev.whyoleg.cryptography.random.CryptographyRandom
import dev.whyoleg.cryptography.random.asCryptographyRandom
import java.security.SecureRandom

actual fun SecureRandom() : CryptographyRandom = SecureRandom().asCryptographyRandom()

actual fun getCryptoProvider(): CryptographyProvider {
return CryptographyProvider.JDK
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package rhodium.net

import io.ktor.client.*
import io.ktor.client.engine.okhttp.*

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(OkHttp) {
config(this)

}

0 comments on commit be28a1e

Please sign in to comment.