diff --git a/.github/scripts/prepare_javadoc.sh b/.github/scripts/prepare_javadoc.sh index 13c1a64..9cede99 100755 --- a/.github/scripts/prepare_javadoc.sh +++ b/.github/scripts/prepare_javadoc.sh @@ -30,22 +30,15 @@ rm -rf $version-rc* echo "Create target directory $version..." mkdir $version -echo "Copy javadoc and uml files..." +echo "Copy javadoc files..." cp -rf ../build/docs/javadoc/* $version/ -cp -rf ../src/main/uml/api_*.svg $version/ echo "Update versions list..." echo "| Version | Documents |" > list_versions.md echo "|:---:|---|" >> list_versions.md for directory in `ls -rd [0-9]*/ | cut -f1 -d'/'` do - diagrams="" - for diagram in `ls $directory/api_*.svg | cut -f2 -d'/'` - do - name=`echo "$diagram" | tr _ " " | cut -f1 -d'.' | sed -r 's/^api/API/g'` - diagrams="$diagrams
[$name]($directory/$diagram)" - done - echo "| $directory | [API documentation]($directory)$diagrams |" >> list_versions.md + echo "| $directory | [API documentation]($directory) |" >> list_versions.md done echo "Computed all versions:" diff --git a/.github/workflows/java-publish.yml b/.github/workflows/java-publish.yml index 712fe0a..ab0b2ac 100644 --- a/.github/workflows/java-publish.yml +++ b/.github/workflows/java-publish.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' @@ -25,6 +25,9 @@ jobs: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import gpg --pinentry-mode loopback --passphrase "${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}" --export-secret-key 568FD16F857171A0EC6D2C40742C84722FD2B235 > ~/.gradle/maven-central.gpg gpg --list-secret-keys --keyid-format LONG + - name: Update permissions + working-directory: . + run: chmod +x ./gradlew ./.github/scripts/*.sh - name: Check version working-directory: . run: ./.github/scripts/check_version.sh diff --git a/.github/workflows/java-release.yml b/.github/workflows/java-release.yml index 7ac7456..638d6ce 100644 --- a/.github/workflows/java-release.yml +++ b/.github/workflows/java-release.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' @@ -25,6 +25,9 @@ jobs: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import gpg --pinentry-mode loopback --passphrase "${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}" --export-secret-key 568FD16F857171A0EC6D2C40742C84722FD2B235 > ~/.gradle/maven-central.gpg gpg --list-secret-keys --keyid-format LONG + - name: Update permissions + working-directory: . + run: chmod +x ./gradlew ./.github/scripts/*.sh - name: Check version working-directory: . run: ./.github/scripts/check_version.sh $(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,") diff --git a/.github/workflows/java-test.yml b/.github/workflows/java-test.yml index 3f08cf3..8e68f7e 100644 --- a/.github/workflows/java-test.yml +++ b/.github/workflows/java-test.yml @@ -10,12 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository code from ${{ github.repository }}/${{ github.ref }} - uses: actions/checkout@v2 - - name: Set up JDK 8 - uses: actions/setup-java@v2 + uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '11' distribution: 'adopt' + - name: Update permissions + working-directory: . + run: chmod +x ./gradlew ./.github/scripts/*.sh - name: Check version working-directory: . run: ./.github/scripts/check_version.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index c55aed1..c901da4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- "CHANGELOG.md" file (issue [#8]). +- `CHANGELOG.md` file (issue [#8]). - CI: Forbid the publication of a version already released (issue [#6]). +### Changed +- UML diagrams moved to a dedicated repository (see `README.md` file). ## [1.0.0] - 2021-10-06 This is the initial release. diff --git a/README.md b/README.md index eb7c688..4a189f8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is the repository for the **Calypso Networks Association**'s reference **Terminal Card API** for Java. -API documentation & class diagram is available online: [calypsonet.github.io/calypsonet-terminal-card-java-api](https://calypsonet.github.io/calypsonet-terminal-card-java-api) +API documentation is available online: [calypsonet.github.io/calypsonet-terminal-card-java-api](https://calypsonet.github.io/calypsonet-terminal-card-java-api) + +UML diagrams are available online: [github.com/calypsonet/calypsonet-terminal-card-uml-api](https://github.com/calypsonet/calypsonet-terminal-card-uml-api) More information can be found on [calypsonet.org](http://calypsonet.org). diff --git a/src/main/uml/api_class_diagram.puml b/src/main/uml/api_class_diagram.puml deleted file mode 100644 index 0488d3f..0000000 --- a/src/main/uml/api_class_diagram.puml +++ /dev/null @@ -1,217 +0,0 @@ -@startuml -title - Calypsonet - calypsonet-terminal-card-java-api - 1.0.+ (15/06/2021) -end title - -' == THEME == - -'Couleurs issues de : https://htmlcolorcodes.com/fr/tableau-de-couleur/tableau-de-couleur-design-plat/ -!define C_GREY1 F8F9F9 -!define C_GREY2 F2F3F4 -!define C_GREY3 E5E7E9 -!define C_GREY4 D7DBDD -!define C_GREY5 CACFD2 -!define C_GREY6 BDC3C7 -!define C_LINK 3498DB -!define C_USE 27AE60 - -skinparam Shadowing false -skinparam ClassFontStyle italic -skinparam ClassBorderColor #D4AC0D -skinparam stereotypeABorderColor #A9DCDF -skinparam stereotypeIBorderColor #B4A7E5 -skinparam stereotypeCBorderColor #ADD1B2 -skinparam stereotypeEBorderColor #EB93DF -' Red -skinparam ClassBackgroundColor<> #FDEDEC -skinparam ClassBorderColor<> #E74C3C -hide <> stereotype -' Purple -skinparam ClassBackgroundColor<> #F4ECF7 -skinparam ClassBorderColor<> #8E44AD -hide <> stereotype -' blue -skinparam ClassBackgroundColor<> #EBF5FB -skinparam ClassBorderColor<> #3498DB -hide <> stereotype -' Green -skinparam ClassBackgroundColor<> #E9F7EF -skinparam ClassBorderColor<> #27AE60 -hide <> stereotype -' Grey -skinparam ClassBackgroundColor<> #EAECEE -skinparam ClassBorderColor<> #2C3E50 -hide <> stereotype - -' == CONTENT == - -package "org.calypsonet.terminal.card" as api { - ' SPI - package spi { - +interface CardSelectionSpi { - +CardSelectionRequestSpi getCardSelectionRequest () - +SmartCardSpi parse (CardSelectionResponseApi cardSelectionResponseApi) - } - +interface CardSelectorSpi { - +String getCardProtocol () - +String getPowerOnDataRegex () - +byte[] getAid () - +FileOccurrence getFileOccurrence () - +FileControlInformation getFileControlInformation () - +Set getSuccessfulSelectionStatusWords () - } - +enum FileOccurrence { - FIRST - LAST - NEXT - PREVIOUS - } - +enum FileControlInformation { - FCI - FCP - FMD - NO_RESPONSE - } - +interface SmartCardSpi { - } - ' REQUEST - together { - +interface CardSelectionRequestSpi { - +CardSelectorSpi getCardSelector () - +CardRequestSpi getCardRequest () - } - +interface CardRequestSpi { - +List getApduRequests () - +boolean stopOnUnsuccessfulStatusWord () - } - +interface ApduRequestSpi { - +byte[] getApdu () - +Set getSuccessfulStatusWords () - +String getInfo () - } - } - +class "<>\nParseException" as ParseException { - +ParseException (String message) - +ParseException (String message, Throwable cause) - } - } - +interface ProxyReaderApi { - -- - +CardResponseApi transmitCardRequest ( - \tCardRequestSpi cardRequest, - \tChannelControl channelControl) - - +void releaseChannel () - } - +enum ChannelControl { - KEEP_OPEN - CLOSE_AFTER - } - ' RESPONSE - together { - +class "**final** CardApiProperties" as ApiProperties { - +{static} **final** String VERSION - } - +interface CardSelectionResponseApi { - +String getPowerOnData () - +ApduResponseApi getSelectApplicationResponse () - +boolean hasMatched () - +CardResponseApi getCardResponse () - } - +interface "<>\nCardResponseApi" as CardResponseApi { - +List getApduResponses () - +boolean isLogicalChannelOpen () - } - +interface "<>\nApduResponseApi" as ApduResponseApi { - +byte[] getApdu () - +byte[] getDataOut () - +int getStatusWord () - } - } - +abstract class "<>\nAbstractApduException" as AbstractApduException { - -- - #AbstractApduException ( - \tCardResponseApi cardResponseApi, - \tboolean isCardResponseComplete, - \tString message) - #AbstractApduException ( - \tCardResponseApi cardResponseApi, - \tboolean isCardResponseComplete, - \tString message, - \tThrowable cause) - - +CardResponseApi getCardResponse () - +boolean isCardResponseComplete () - } - +class ReaderBrokenCommunicationException extends AbstractApduException { - -- - +ReaderBrokenCommunicationException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message) - +ReaderBrokenCommunicationException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message, Throwable cause) - } - +class CardBrokenCommunicationException extends AbstractApduException { - -- - +CardBrokenCommunicationException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message) - +CardBrokenCommunicationException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message, Throwable cause) - } - +class UnexpectedStatusWordException extends AbstractApduException { - -- - +UnexpectedStatusWordException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message) - +UnexpectedStatusWordException (CardResponseApi cardResponseApi - \tboolean isCardResponseComplete, String message, Throwable cause) - } -} - -' Associations - -CardSelectionSpi ..> SmartCardSpi #C_LINK : provide > -CardSelectionSpi ..> CardSelectionRequestSpi #C_LINK : provide > -CardSelectionSpi ..> CardSelectionResponseApi #C_USE : use > -CardSelectionSpi .left.> ParseException #C_LINK : throw > - -CardSelectionRequestSpi .left.> CardSelectorSpi #C_LINK : provide > -CardSelectionRequestSpi ..> CardRequestSpi #C_LINK : provide > - -CardSelectorSpi +-- FileOccurrence -CardSelectorSpi ..> FileOccurrence #C_LINK : provide > -CardSelectorSpi +-- FileControlInformation -CardSelectorSpi ..> FileControlInformation #C_LINK : provide > - -CardRequestSpi ..> ApduRequestSpi #C_LINK : provide > - -CardSelectionResponseApi ..> ApduResponseApi #C_LINK : provide > -CardSelectionResponseApi ..> CardResponseApi #C_LINK : provide > - -CardResponseApi ..> ApduResponseApi #C_LINK : provide > - -AbstractApduException *-up- "0..1" CardResponseApi #C_LINK - -ProxyReaderApi .left.> CardRequestSpi #C_USE : use > -ProxyReaderApi .up.> ChannelControl #C_USE : use > - -ProxyReaderApi .right.> CardResponseApi #C_LINK : provide > -ProxyReaderApi ..> AbstractApduException #C_LINK : throw > - -' == LAYOUT == - -ApiProperties -[hidden]left- CardSelectionResponseApi -spi -[hidden]- CardSelectionResponseApi - -' == STYLE == - -package api #C_GREY1 {} -package spi #C_GREY2 {} - -interface CardSelectionResponseApi <> -interface CardResponseApi <> -interface ApduResponseApi <> -abstract class AbstractApduException <> -class ReaderBrokenCommunicationException <> -class CardBrokenCommunicationException <> -class UnexpectedStatusWordException <> - -@enduml \ No newline at end of file diff --git a/src/main/uml/api_class_diagram.svg b/src/main/uml/api_class_diagram.svg deleted file mode 100644 index 4f13dff..0000000 --- a/src/main/uml/api_class_diagram.svg +++ /dev/null @@ -1,468 +0,0 @@ -Calypsonet - calypsonet-terminal-card-java-api - 1.0.+ (15/06/2021)org.calypsonet.terminal.cardspiProxyReaderApiCardResponseApi transmitCardRequest (CardRequestSpi cardRequest,ChannelControl channelControl)void releaseChannel ()ChannelControlKEEP_OPENCLOSE_AFTER<<Exception>>AbstractApduExceptionAbstractApduException (CardResponseApi cardResponseApi,boolean isCardResponseComplete,String message)AbstractApduException (CardResponseApi cardResponseApi,boolean isCardResponseComplete,String message,Throwable cause)CardResponseApi getCardResponse ()boolean isCardResponseComplete ()ReaderBrokenCommunicationExceptionReaderBrokenCommunicationException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message)ReaderBrokenCommunicationException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message, Throwable cause)CardBrokenCommunicationExceptionCardBrokenCommunicationException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message)CardBrokenCommunicationException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message, Throwable cause)UnexpectedStatusWordExceptionUnexpectedStatusWordException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message)UnexpectedStatusWordException (CardResponseApi cardResponseApiboolean isCardResponseComplete, String message, Throwable cause)CardSelectionSpiCardSelectionRequestSpi getCardSelectionRequest ()SmartCardSpi parse (CardSelectionResponseApi cardSelectionResponseApi)CardSelectorSpiString getCardProtocol ()String getPowerOnDataRegex ()byte[] getAid ()FileOccurrence getFileOccurrence ()FileControlInformation getFileControlInformation ()Set<Integer> getSuccessfulSelectionStatusWords ()FileOccurrenceFIRSTLASTNEXTPREVIOUSFileControlInformationFCIFCPFMDNO_RESPONSESmartCardSpi<<Exception>>ParseExceptionParseException (String message)ParseException (String message, Throwable cause)CardSelectionRequestSpiCardSelectorSpi getCardSelector ()CardRequestSpi getCardRequest ()CardRequestSpiList<ApduRequestSpi> getApduRequests ()boolean stopOnUnsuccessfulStatusWord ()ApduRequestSpibyte[] getApdu ()Set<Integer> getSuccessfulStatusWords ()String getInfo ()finalCardApiPropertiesfinalString VERSIONCardSelectionResponseApiString getPowerOnData ()ApduResponseApi getSelectApplicationResponse ()boolean hasMatched ()CardResponseApi getCardResponse ()<<Serializable>>CardResponseApiList<ApduResponseApi> getApduResponses ()boolean isLogicalChannelOpen ()<<Serializable>>ApduResponseApibyte[] getApdu ()byte[] getDataOut ()int getStatusWord ()provideprovideusethrowprovideprovideprovideprovideprovideprovideprovideprovide0..1useuseprovidethrow \ No newline at end of file