Skip to content

Commit

Permalink
Release 316
Browse files Browse the repository at this point in the history
  • Loading branch information
mtomko-clover committed Oct 10, 2024
1 parent 771e578 commit fee44de
Show file tree
Hide file tree
Showing 265 changed files with 18,500 additions and 16,894 deletions.
11 changes: 7 additions & 4 deletions app.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'com.android.application'
apply from: file("${project.rootDir}/common.gradle")
apply from: file("${project.rootDir}/list-dependencies.gradle")

/**
* Gets the full path of the proguard file specified by `name`.
Expand Down Expand Up @@ -80,8 +81,14 @@ android {

matchingFallbacks = ['release']
}

}

buildFeatures {
buildConfig = true
}


compileSdkVersion COMPILE_SDK_VERSION

useLibrary HTTP_LIBRARY
Expand All @@ -103,8 +110,4 @@ android {
lintOptions {
abortOnError false
}

dexOptions {
preDexLibraries = Boolean.valueOf(System.getProperty("androidPreDex", "true"))
}
}
13 changes: 13 additions & 0 deletions assets/clover.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.theme-dark {
--sidemenu-section-active-color: rgba(34, 136, 0, 0.5) !important;
}
html:not(.theme-dark) {
--sidemenu-section-active-color: rgba(34, 136, 0, 0.09) !important;
}
html:not(.theme-dark) .sideMenuPart[data-active] > .overview > a {
color: #1c6e00 !important;
}

html:not(.theme-dark) .sideMenuPart[data-active] > .overview .navButtonContent::before {
background-color: var(--default-font-color);
}
1 change: 1 addition & 0 deletions assets/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 69 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.gradle.api.internal.project.DefaultProject
buildscript {
if (!project.hasProperty('androidBuild')) {
def likelyAndroidBuild = file('../android-build')
Expand All @@ -32,6 +33,9 @@ buildscript {
}
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
Expand All @@ -42,10 +46,74 @@ buildscript {
}
}

plugins {
id("org.jetbrains.dokka") version "1.9.20"
}

repositories {
mavenCentral()
}

defaultTasks 'clean', 'install'

// SonarQube static analysis configuration

// Adding detekt tasks to all the sub-modules
subprojects {
tasks.withType(DokkaTaskPartial.class).configureEach {
dependsOn compileReleaseAidl
moduleName.set(project.name)
moduleVersion.set(project.version.toString())

String config = """
{
"customAssets": ["${file("assets/logo-icon.svg")}"],
"customStyleSheets": ["${file("assets/clover.css")}"]
}
"""
pluginsMapConfiguration.set([
"org.jetbrains.dokka.base.DokkaBase": config
])
dokkaSourceSets {
named("main") {
// https://slack-chats.kotlinlang.org/t/484637/hi-all-i-m-trying-to-get-dokka-to-include-documentation-for-#3fae1eb4-6f24-4765-8803-687e6c5819be
sourceRoots.from(file("build/generated/aidl_source_output_dir/release/out"))
suppressGeneratedFiles.set(false)
sourceLink {
// FIXME: source linking just doesn't seem to work
localDirectory.set(rootDir)
remoteUrl.set(new URL("https://github.com/clover/clover-android-sdk/tree/master"))
remoteLineSuffix.set("#L")
}
externalDocumentationLink {
url.set(new URL("https://square.github.io/retrofit/2.x/retrofit/"))
}
externalDocumentationLink {
url.set(new URL("https://square.github.io/okhttp/3.x/okhttp/"))
}
if(project.name == "clover-android-sdk") includes.from("overview.md")
}
}

dependencies {
dokkaPlugin('org.jetbrains.dokka:kotlin-as-java-plugin:1.9.20')
}
}
}
tasks.dokkaHtmlMultiModule {
moduleName.set("Clover Android SDK")
moduleVersion.set("r"+(project(":clover-android-sdk") as DefaultProject).evaluate().version)

String config = """
{
"customAssets": ["${file("assets/logo-icon.svg")}"],
"customStyleSheets": ["${file("assets/clover.css")}"]
}
"""
pluginsMapConfiguration.set([
"org.jetbrains.dokka.base.DokkaBase": config
])
}
dependencies {
dokkaPlugin('org.jetbrains.dokka:kotlin-as-java-plugin:1.9.20')
}
36 changes: 34 additions & 2 deletions clover-android-connector-sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/**
* Copyright (C) 2016 Clover Network, Inc.
*
Expand All @@ -14,15 +16,45 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
version = '306'
version = '316'


apply from: file("${project.rootDir}/lib.gradle")
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'

android {

buildTypes.configureEach {
consumerProguardFiles 'proguard-rules.pro'
}

buildFeatures {
aidl true
}

namespace 'com.clover.android.connector.sdk'

compileOptions {
sourceCompatibility = 8
targetCompatibility = 8
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = '1.8'
}
}

}

dependencies {
implementation project(':clover-android-sdk')
implementation "androidx.annotation:annotation:$ANDROIDX_ANNOTATION_VERSION"
implementation "com.google.code.gson:gson:$GSON_VERSION"
implementation ("com.google.code.gson:gson") {
version {
strictly "$GSON_VERSION"
}
}
}

ext {
Expand Down
1 change: 0 additions & 1 deletion clover-android-connector-sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clover.android.connector.sdk"
android:versionCode="1"
android:versionName="1.0">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
public class CardEntryMethods {
private static int KIOSK_CARD_ENTRY_METHODS = 1 << 15;

public static int CARD_ENTRY_METHOD_MAG_STRIPE = 0b0001 | 0b000100000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33026
public static int CARD_ENTRY_METHOD_MAG_STRIPE = 0b0001 | 0b000100000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33025
public static int CARD_ENTRY_METHOD_ICC_CONTACT = 0b0010 | 0b001000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33282
public static int CARD_ENTRY_METHOD_NFC_CONTACTLESS = 0b0100 | 0b010000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 33796
public static int CARD_ENTRY_METHOD_MANUAL = 0b1000 | 0b100000000000 | CardEntryMethods.KIOSK_CARD_ENTRY_METHODS; // 34824

public static int DEFAULT =
CardEntryMethods.CARD_ENTRY_METHOD_MAG_STRIPE |
CardEntryMethods.CARD_ENTRY_METHOD_ICC_CONTACT |
CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS; // | CARD_ENTRY_METHOD_MANUAL;
CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS; // 34567;

public static int ALL =
CardEntryMethods.CARD_ENTRY_METHOD_MAG_STRIPE |
CardEntryMethods.CARD_ENTRY_METHOD_ICC_CONTACT |
CardEntryMethods.CARD_ENTRY_METHOD_NFC_CONTACTLESS |
CardEntryMethods.CARD_ENTRY_METHOD_MANUAL;
CardEntryMethods.CARD_ENTRY_METHOD_MANUAL; // 32768
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.clover.connector.sdk.v3.session;

import com.clover.sdk.v1.merchant.Merchant;
import com.clover.sdk.v3.customers.CustomerInfo;
import com.clover.sdk.v3.employees.Employee;
import com.clover.sdk.v3.order.DisplayOrder;
import com.clover.sdk.v3.payments.Transaction;

Expand Down Expand Up @@ -47,8 +45,6 @@ public class SessionConnector implements Serializable, SessionListener {
public static final String QUERY_PARAMETER_VALUE = "value";
public static final String QUERY_PARAMETER_NAME = "name";
public static final String QUERY_PARAMETER_SRC = "src";
public static final String BUNDLE_KEY_MERCHANT = "Merchant";
public static final String BUNDLE_KEY_EMPLOYEE = "Employee";
public static final String BUNDLE_KEY_TYPE = "TYPE";
public static final String BUNDLE_KEY_DATA = "DATA";
public static final String BUNDLE_KEY_MESSAGE = "MESSAGE";
Expand Down Expand Up @@ -189,48 +185,6 @@ public void setDisplayOrder(DisplayOrder displayOrder, boolean isOrderModificati
}
}

public Map<String, String> getProperties() {
Map<String, String> properties = new HashMap<>();
try {
if (connect()) {
try (Cursor cursor = sessionContentProviderClient.query(SessionContract.PROPERTIES_URI, null, null, null, null)) {
if (null != cursor && cursor.moveToFirst()) {
do {
String key = cursor.getString(0);
String value = cursor.getString(1);
properties.put(key, value);
} while (cursor.moveToNext());
}
}
}
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
}
return properties;
}

public Merchant getMerchantInfo() {
try {
Log.d(TAG, "Calling getMerchant");
Bundle result = sessionContentProviderClient.call(SessionContract.CALL_METHOD_GET_MERCHANT, null, null);
return result == null ? null : (Merchant) result.getParcelable(BUNDLE_KEY_MERCHANT);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public Employee getEmployee() {
try {
Log.d(TAG, "Calling getEmployee");
Bundle result = sessionContentProviderClient.call(SessionContract.CALL_METHOD_GET_EMPLOYEE, null, null);
return result == null ? null : (Employee) result.getParcelable(BUNDLE_KEY_EMPLOYEE);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public void setProperty(String key, String value) {
try {
if (connect()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@ public class SessionContract {
matcher.addURI(SessionContract.AUTHORITY, SessionContract.SESSION_EVENT + "/*", SessionContract.EVENT);
}


public static final String CALL_METHOD_ON_EVENT = "onEvent";
public static final String CALL_METHOD_CLEAR_SESSION = "clearSession";
public static final String CALL_METHOD_GET_MERCHANT = "getMerchant";
public static final String CALL_METHOD_GET_EMPLOYEE = "getEmployee";
public static final String CALL_METHOD_SET_ORDER = "setOrder";
public static final String CALL_METHOD_SET_CUSTOMER_INFO = "setCustomerInfo";
public static final String CALL_METHOD_SET_PROPERTY = "setProperty";
public static final String CALL_METHOD_SET_TRANSACTION = "setTransaction";
public static final String CALL_METHOD_ANNOUNCE_CUSTOMER_PROVIDED_DATA = "announceCustomerProvidedData";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_manual_line_item_name">Transação manual</string>
<string name="authorization_line_item_name">Autorização</string>
</resources>
34 changes: 33 additions & 1 deletion clover-android-loyalty-kit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/**
* Copyright (C) 2016 Clover Network, Inc.
*
Expand All @@ -14,14 +16,44 @@
* limitations under the License.
*/
group = 'com.clover.sdk'
version = '306'
version = '316'


apply from: file("${project.rootDir}/lib.gradle")
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'

android {

buildTypes.configureEach {
consumerProguardFiles 'proguard-rules.pro'
}

buildFeatures {
aidl true
}

namespace "com.clover.android.loyalty"

compileOptions {
sourceCompatibility = 8
targetCompatibility = 8
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = '1.8'
}
}
}

dependencies {
implementation project(':clover-android-sdk')
implementation "androidx.annotation:annotation:$ANDROIDX_ANNOTATION_VERSION"
implementation ("com.google.code.gson:gson") {
version {
strictly "$GSON_VERSION"
}
}
}

ext{
Expand Down
1 change: 0 additions & 1 deletion clover-android-loyalty-kit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.clover.android.loyalty"
android:versionCode="1"
android:versionName="1.0">

Expand Down
Loading

0 comments on commit fee44de

Please sign in to comment.