Skip to content
Merged
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
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

buildscript {
ext {
androidGradlePluginVersion = '8.11.1'
androidGradlePluginVersion = '8.12.0'
kotlinVersion = '2.1.20'
kspVersion = '2.1.20-1.0.32'
dokkaVersion = '1.9.20'
androidxNavigationVersion = '2.9.2'
secretsVaultPluginVersion = '0.1.3'
nexusPublishPluginVersion = '2.0.0'
}
dependencies {
Expand All @@ -21,6 +22,7 @@ plugins {
id 'org.jetbrains.kotlin.plugin.compose' version "$kotlinVersion" apply false
id 'org.jetbrains.dokka' version "$dokkaVersion" apply true
id 'com.google.devtools.ksp' version "$kspVersion" apply false
id 'com.commencis.secretsvaultplugin' version "$secretsVaultPluginVersion" apply false
id 'io.github.gradle-nexus.publish-plugin' version "$nexusPublishPluginVersion" apply true
}

Expand All @@ -33,6 +35,9 @@ ext {
targetSdkVersion = 36
compileSdkVersion = 36

ndkVersion = '28.2.13676358'
cmakeVersion = '4.0.3'

publishGroupId = 'com.processout'
publishVersion = file('version.resolved').getText().trim()

Expand Down Expand Up @@ -65,7 +70,10 @@ ext {
commonMarkVersion = '0.25.0'
libphonenumberVersion = '9.0.10'
zxingVersion = '3.5.3'
bouncyCastleVersion = '1.79'
slf4jVersion = '1.7.36'

netcetera3dsSdkVersion = '2.5.3.0'
checkout3dsSdkVersion = '3.2.6'
adyen3dsSdkVersion = '2.2.15'

Expand Down
1 change: 1 addition & 0 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ kotlin {
jvmTarget.set(JvmTarget.JVM_17)
optIn.add("com.processout.sdk.core.annotation.ProcessOutInternalApi")
optIn.add("com.processout.sdk.ui.core.annotation.ProcessOutInternalApi")
optIn.add("com.processout.sdk.netcetera.threeds.core.annotation.ProcessOutInternalApi")
}
}

Expand Down
8 changes: 8 additions & 0 deletions netcetera-3ds-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/build
secrets.json

/src/main/cpp/common
/src/main/cpp/CMakeLists.txt
/src/main/cpp/secrets.cpp

/src/main/kotlin/com/processout/sdk/netcetera/threeds/core/MainSecrets.kt
138 changes: 138 additions & 0 deletions netcetera-3ds-core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import groovy.json.JsonOutput
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'com.commencis.secretsvaultplugin'
}

ext {
publishArtifactId = 'processout-android-netcetera-3ds-core'
publishVersion = rootProject.ext.netcetera3dsSdkVersion
publishDescription = 'ProcessOut Android SDK - Netcetera 3DS Core'
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
namespace 'com.processout.sdk.netcetera.threeds.core'
compileSdk rootProject.ext.compileSdkVersion

ndkVersion rootProject.ext.ndkVersion
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
version rootProject.ext.cmakeVersion
}
}

defaultConfig {
minSdk rootProject.ext.minSdkVersion
targetSdk rootProject.ext.targetSdkVersion
setBuildConfig(it)
consumerProguardFiles 'consumer-rules.pro', 'netcetera-consumer-rules.pro'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
getIsDefault().set(true)
}
}

flavorDimensions = ['environment']
productFlavors {
production {
dimension 'environment'
}
staging {
getIsDefault().set(true)
dimension 'environment'
}
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

publishing {
singleVariant('productionRelease')
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
optIn.add("com.processout.sdk.netcetera.threeds.core.annotation.ProcessOutInternalApi")
}
}

@SuppressWarnings('GrMethodMayBeStatic')
def setBuildConfig(buildType) {
buildType.buildConfigField("String", "LIBRARY_NAME", "\"ProcessOut Android SDK - Netcetera 3DS Core\"")
buildType.buildConfigField("String", "LIBRARY_VERSION", "\"$publishVersion\"")
}

tasks.register('beforeKeepSecrets') {
doLast {
File secrets = project.file("secrets.json")
def content = [[key: "apiKey", value: getApiKey()]]
secrets.text = JsonOutput.toJson(content)
}
}

def getApiKey() {
File localProperties = rootProject.file("local.properties")
if (localProperties.exists()) {
def properties = new Properties()
properties.load(new FileInputStream(localProperties))
String apiKey = properties.getProperty("netcetera.apiKey", "").trim()
if (!apiKey) {
throw new GradleException("Missing or blank 'netcetera.apiKey' in 'local.properties' file.")
}
return apiKey
}
throw new GradleException("File not found: 'local.properties'.")
}

tasks.register('afterKeepSecrets') {
doLast {
copyCMakeLists()
copyMainSecretsClass()
}
}

def copyCMakeLists() {
File source = project.file("src/main/cpp/CMakeLists.copy")
File target = project.file("src/main/cpp/CMakeLists.txt")
target.text = source.text
}

def copyMainSecretsClass() {
String packagePath = "com/processout/sdk/netcetera/threeds/core"
File source = project.file("src/main/kotlin/${packagePath}/MainSecrets.copy")
File target = project.file("src/main/kotlin/${packagePath}/MainSecrets.kt")
target.text = source.text
}

keepSecrets.dependsOn beforeKeepSecrets
afterKeepSecrets.dependsOn keepSecrets
preBuild.dependsOn afterKeepSecrets

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api "org.bouncycastle:bcprov-jdk15to18:$bouncyCastleVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
}
11 changes: 11 additions & 0 deletions netcetera-3ds-core/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-keep class com.processout.sdk.netcetera.threeds.core.MainSecrets {
<init>();
}

-keepclassmembers class com.processout.sdk.netcetera.threeds.core.MainSecrets {
native <methods>;
}

-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.slf4j.impl.StaticMDCBinder
-dontwarn org.slf4j.impl.StaticMarkerBinder
Binary file added netcetera-3ds-core/libs/classes.jar
Binary file not shown.
Loading