Skip to content

Commit

Permalink
feat: upgrade dependencies and API compliance in C# client (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpierrefortune authored Sep 20, 2024
1 parent 9cfffe1 commit 579c52b
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code from ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node JS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Update permissions
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
### Fixed
- Android client build.
### Upgraded
- Keyple components
- keyple-service-java-lib `3.2.1` -> `3.3.1`
- keyple-service-resource-java-lib `3.0.1` -> `3.1.0`
- keyple-distributed-network-java-lib `2.3.1` -> `2.5.1`
- keyple-distributed-remote-java-lib `2.3.1` -> `2.5.1`
- keyple-distributed-local-java-lib `2.3.1` -> `2.5.1`
- keyple-card-calypso-java-lib `3.1.1` -> `3.1.3`
- keyple-card-calypso-crypto-legacysam-java-lib `0.7.0` -> `0.8.0`
- keyple-plugin-pcsc-java-lib `2.2.1` -> `2.2.3`
- C# application to comply with the **Keyple Distributed JSON API** 2.1

## [2024.04.23]
### Upgraded
Expand Down
12 changes: 6 additions & 6 deletions client/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ android {
minSdk = 24
//noinspection ExpiredTargetSdkVersion
targetSdk = 31
versionCode = 6
versionName = project.version.toString()
versionCode = versionName!!.replace(".", "").toIntOrNull() ?: 1
}

buildTypes {
getByName("release") {
isMinifyEnabled = true // Enables code shrinking for the release build type.
isMinifyEnabled = false // Disables code shrinking for the release build type.
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down Expand Up @@ -123,10 +123,10 @@ dependencies {
implementation("org.eclipse.keypop:keypop-calypso-card-java-api:2.1.0")
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.1")
implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.0")
implementation("org.eclipse.keyple:keyple-service-java-lib:3.2.1")
implementation("org.eclipse.keyple:keyple-distributed-network-java-lib:2.3.1")
implementation("org.eclipse.keyple:keyple-distributed-local-java-lib:2.3.1")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:3.1.1")
implementation("org.eclipse.keyple:keyple-service-java-lib:3.3.1")
implementation("org.eclipse.keyple:keyple-distributed-network-java-lib:2.5.1")
implementation("org.eclipse.keyple:keyple-distributed-local-java-lib:2.5.1")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:3.1.3")
implementation("org.eclipse.keyple:keyple-plugin-android-nfc-java-lib:2.2.0")
implementation("org.eclipse.keyple:keyple-plugin-android-omapi-java-lib:2.1.0")
// End Keyple configuration
Expand Down
2 changes: 1 addition & 1 deletion client/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = YYYY.MM.DD
version = 2024.09.20
archivesBaseName = keyple-demo-remote-client-android

# Project-wide Gradle settings.
Expand Down
3 changes: 2 additions & 1 deletion client/dotnet/domain/api/MainServiceApiAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ private string ExecuteRemoteService(string serviceId, InputData inputData)
ExecuteRemoteServiceBody bodyContent = new ExecuteRemoteServiceBody
{
ServiceId = serviceId,
InputData = inputData
InputData = inputData,
IsReaderContactless = true
};

// Create and fill RemoteServiceDto object
Expand Down
2 changes: 1 addition & 1 deletion client/dotnet/domain/data/ApiInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace App.domain.data
{
internal class ApiInfo
{
public const int API_LEVEL = 2;
public const int API_LEVEL = 3;
public const int CORE_API_LEVEL = 2;
}
}
4 changes: 2 additions & 2 deletions client/dotnet/domain/data/command/CardRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CardRequest
/// <summary>
/// A value indicating whether status codes verification is enabled.
/// </summary>
[JsonProperty("isStatusCodesVerificationEnabled")]
public bool IsStatusCodesVerificationEnabled { get; set; }
[JsonProperty("stopOnUnsuccessfulStatusWord")]
public bool StopOnUnsuccessfulStatusWord { get; set; }
}
}
4 changes: 2 additions & 2 deletions client/dotnet/domain/data/command/CardSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class CardSelector
/// <summary>
/// Card protocol.
/// </summary>
[JsonProperty("cardProtocol")]
public string? CardProtocol { get; set; }
[JsonProperty("logicalProtocolName")]
public string? LogicalProtocolName { get; set; }

/// <summary>
/// Power On Data regular expression filter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class ExecuteRemoteServiceBody
[JsonProperty("serviceId")]
public required string ServiceId { get; set; }

/// <summary>
/// A value indicating whether the reader is contactless.
/// </summary>
[JsonProperty("isReaderContactless")]
public bool IsReaderContactless { get; set; }

/// <summary>
/// Input data.
/// </summary>
Expand Down
14 changes: 7 additions & 7 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ dependencies {
implementation("org.eclipse.keypop:keypop-calypso-crypto-legacysam-java-api:0.6.0")
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.1")
implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.0")
implementation("org.eclipse.keyple:keyple-service-java-lib:3.2.1")
implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.0.1")
implementation("org.eclipse.keyple:keyple-distributed-network-java-lib:2.3.1")
implementation("org.eclipse.keyple:keyple-distributed-remote-java-lib:2.3.1")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:3.1.1")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-legacysam-java-lib:0.7.0")
implementation("org.eclipse.keyple:keyple-plugin-pcsc-java-lib:2.2.1")
implementation("org.eclipse.keyple:keyple-service-java-lib:3.3.1")
implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.0")
implementation("org.eclipse.keyple:keyple-distributed-network-java-lib:2.5.1")
implementation("org.eclipse.keyple:keyple-distributed-remote-java-lib:2.5.1")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:3.1.3")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-legacysam-java-lib:0.8.0")
implementation("org.eclipse.keyple:keyple-plugin-pcsc-java-lib:2.2.3")
// End Keyple configuration

// Quarkus
Expand Down
2 changes: 1 addition & 1 deletion server/dashboard-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashboard-app",
"version": "YYYY.MM.DD",
"version": "2024.09.20",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.3",
Expand Down
2 changes: 1 addition & 1 deletion server/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# don't forget to keep the version string in server/dashboard-app/src/package.json synchronized with the following
version = YYYY.MM.DD
version = 2024.09.20
title = "Keyple Reload Demo - Remote Server"
archivesBaseName = keyple-demo-remote-server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ SelectAppAndReadContractsOutputDto selectAppAndReadContracts(CardReader cardRead
.getCardResource(CardConfigurator.SAM_RESOURCE_PROFILE_NAME);

Card card = cardRepository.readCard(cardReader, calypsoCard, samResource);
logger.info("{}", card);
// logger.info("{}", card); deactivate until LocalDate is properly processed by KeypleUtil
activityService.push(
new Activity()
.setPlugin(CUSTOM_PLUGIN)
Expand Down Expand Up @@ -201,7 +201,7 @@ SelectAppAndIncreaseContractCounterOutputDto selectAppAndIncreaseContractCounter
.getCardResource(CardConfigurator.SAM_RESOURCE_PROFILE_NAME);

Card card = cardRepository.readCard(cardReader, calypsoCard, samResource);
logger.info("{}", card);
// logger.info("{}", card); deactivate until LocalDate is properly processed by KeypleUtil
activityService.push(
new Activity()
.setPlugin(CUSTOM_PLUGIN)
Expand Down Expand Up @@ -256,7 +256,7 @@ AnalyzeContractsOutputDto analyzeContracts(
.getCardResource(CardConfigurator.SAM_RESOURCE_PROFILE_NAME);
try {
Card card = cardRepository.readCard(cardReader, calypsoCard, samResource);
logger.info("{}", card);
// logger.info("{}", card); deactivate until LocalDate is properly processed by KeypleUtil
List<ContractStructure> validContracts = findValidContracts(card);
activityService.push(
new Activity()
Expand Down Expand Up @@ -319,7 +319,7 @@ WriteContractOutputDto writeContract(
// If card has not been read previously, throw error
return new WriteContractOutputDto(3);
}
logger.info("{}", card);
// logger.info("{}", card); deactivate until LocalDate is properly processed by KeypleUtil
insertNewContract(inputData.getContractTariff(), inputData.getTicketToLoad(), card);
int statusCode = cardRepository.writeCard(cardReader, calypsoCard, samResource, card);
activityService.push(
Expand Down

0 comments on commit 579c52b

Please sign in to comment.