From ca5053cf0c3aaf0892a704ca4da62fe6ae5e1273 Mon Sep 17 00:00:00 2001 From: Sreenadh S <32409698+sree96@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:18:49 +0530 Subject: [PATCH 1/4] JAVA version downgrade to 17 (#69) * [INJIVER-644] - update API with its own functionality only and throw proper errors Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-644] - update readme Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [NOJIRA] - java21 to java17 for wallet support Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --------- Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --- kotlin/PixelPass/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kotlin/PixelPass/build.gradle.kts b/kotlin/PixelPass/build.gradle.kts index 916d383..daa9b4c 100644 --- a/kotlin/PixelPass/build.gradle.kts +++ b/kotlin/PixelPass/build.gradle.kts @@ -22,11 +22,11 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "21" + jvmTarget = "17" } } From 5b547f7dd5c0608b0efe403939a44f9db7422e23 Mon Sep 17 00:00:00 2001 From: Sreenadh S <32409698+sree96@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:30:16 +0530 Subject: [PATCH 2/4] [INJIVER-718] - update readme (#78) * [INJIVER-718] - update readme Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIVER-718] - update readme Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --------- Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --- js/Readme.md | 14 ++++++++------ kotlin/PixelPass/build.gradle.kts | 4 ++-- kotlin/Readme.md | 23 +++++++++++++++++++---- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/js/Readme.md b/js/Readme.md index e3de2e4..8b70b58 100644 --- a/js/Readme.md +++ b/js/Readme.md @@ -7,10 +7,12 @@ Pixelpass is a library which can do multiple things which are listed below, - Given a JSON String → `generateQRData` → Gives back CBOR encoded data. - Given a CBOR encoded data as byte array → `decode` → Gives back JSON String. + +- Given data as byteArray → `decodeBinary` → Gives back JSON String. -- Given a JSON and Mapper → `getMappedCborData` → Gives back CBOR encoded data. +- Given a JSON and Mapper → `getMappedData` → Gives back CBOR encoded data. -- Given a CBOR encoded data and Mapper → `decodeMappedCborData` → Gives back a JSON. +- Given a CBOR encoded data and Mapper → `decodeMappedData` → Gives back a JSON. ## Features @@ -22,7 +24,7 @@ Pixelpass is a library which can do multiple things which are listed below, - When JSON and a Mapper is given, it maps the JSON with Mapper and then does the CBOR encode/decode which further reduces the size of the data. -## Installation +## Usage `npm i @mosip/pixelpass` [npm](https://www.npmjs.com/package/@mosip/pixelpass) @@ -91,7 +93,7 @@ const jsonString = decode(b45EncodedData); ``` The `decode` will take a `string` as parameter and gives us decoded JSON string which is Base45 `Decoded > CBOR Decoded > Decompressed`. -### decode( data ) +### decodeBinary( data ) - `data` - Data needs to be decoded and decompressed without header. @@ -101,7 +103,7 @@ import { decodeBinary } from '@mosip/pixelpass'; const zipdata = ; const decompressedData = decodeBinary(zipdata); ``` -The `decode` will take a `UInt8ByteArray` as parameter and gives us unzipped string. Currently only zip binary data is only supported. +The `decodeBinary` will take a `UInt8ByteArray` as parameter and gives us unzipped string. Currently only zip binary data is only supported. ### getMappedData( jsonData, mapper, cborEnable ); @@ -158,4 +160,4 @@ The example of the returned JSON would look like, `{"name": "Jhon", "id": "207", ## License -MIT +MPL-2.0 diff --git a/kotlin/PixelPass/build.gradle.kts b/kotlin/PixelPass/build.gradle.kts index daa9b4c..290ef5e 100644 --- a/kotlin/PixelPass/build.gradle.kts +++ b/kotlin/PixelPass/build.gradle.kts @@ -58,10 +58,10 @@ tasks.register("jarRelease") { } manifest { attributes["Implementation-Title"] = project.name - attributes["Implementation-Version"] = "1.5-SNAPSHOT" + attributes["Implementation-Version"] = "0.5.0-SNAPSHOT" } archiveBaseName.set("${project.name}-release") - archiveVersion.set("1.5-SNAPSHOT") + archiveVersion.set("0.5.0-SNAPSHOT") destinationDirectory.set(layout.buildDirectory.dir("libs")) } apply(from = "publish-artifact.gradle") diff --git a/kotlin/Readme.md b/kotlin/Readme.md index 8f0743e..b0b56c0 100644 --- a/kotlin/Readme.md +++ b/kotlin/Readme.md @@ -6,9 +6,24 @@ - Uses zlib compression and base45 encoding - Decode QR data encoded by PixelPass -## Installation +## Usage + +Both Kotlin and Java packages are compiled from same Kotlin codebase. They are also deployed as aar and jar packages to maven. Below is how to use them. + +### Kotlin + +`implementation("io.mosip:pixelpass:0.5.0")` + +### Java + +```xml + + io.mosip + pixelpass + 0.5.0 + +``` -todo :: add maven link ## APIs @@ -51,7 +66,7 @@ returns a unzipped string return a hex string which is a CBOR encoded JSON with given mapper if `cborEnable` is set to true. Or returns a JSON remapped string. -`decodeMappeData( data, mapper )` +`decodeMappedData( data, mapper )` - `data` - A CBOR Encoded string or JSON string which needs to be re mapped. - `mapper` - A Map which is used to map with the JSON.Which is a Map @@ -59,4 +74,4 @@ return a hex string which is a CBOR encoded JSON with given mapper if `cborEnabl return a JSONObject which mapped with given mapper. ## License -MIT \ No newline at end of file +MPL-2.0 \ No newline at end of file From ec1c79dbd3f9f8bb24ee5065e08724afcc395d10 Mon Sep 17 00:00:00 2001 From: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:43:20 +0530 Subject: [PATCH 3/4] [DSD-6411] injiverify 0.10.0 release changes (#80) Signed-off-by: techno-467 --- .github/workflows/kotlin-artifacts-build.yml | 2 +- kotlin/PixelPass/publish-artifact.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/kotlin-artifacts-build.yml b/.github/workflows/kotlin-artifacts-build.yml index 659616a..4fe2237 100644 --- a/.github/workflows/kotlin-artifacts-build.yml +++ b/.github/workflows/kotlin-artifacts-build.yml @@ -20,7 +20,7 @@ jobs: LICENSE_NAME: 'MPL-2.0' secrets: OSSRH_USER: ${{ secrets.OSSRH_USER }} - OSSRH_URL: ${{secrets.OSSRH_SNAPSHOT_URL }} + OSSRH_URL: ${{secrets.RELEASE_URL }} OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} diff --git a/kotlin/PixelPass/publish-artifact.gradle b/kotlin/PixelPass/publish-artifact.gradle index 95a0c23..9544d94 100644 --- a/kotlin/PixelPass/publish-artifact.gradle +++ b/kotlin/PixelPass/publish-artifact.gradle @@ -90,7 +90,7 @@ publishing { } groupId = "io.mosip" artifactId = "pixelpass-aar" - version = "0.5.0-SNAPSHOT" + version = "0.5.0" if (project.gradle.startParameter.taskNames.any { it.contains('assembleRelease') }) { artifacts { aar { @@ -104,7 +104,7 @@ publishing { artifact(tasks.named("jarRelease").get()) groupId = "io.mosip" artifactId = "pixelpass-jar" - version = "0.5.0-SNAPSHOT" + version = "0.5.0" pom { withXml { asNode().appendNode('name', "Pixelpass") From 1d66e0f04c0d787b927ade6889eda493aeab0608 Mon Sep 17 00:00:00 2001 From: Sreenadh S <32409698+sree96@users.noreply.github.com> Date: Thu, 10 Oct 2024 08:10:09 +0530 Subject: [PATCH 4/4] [INJIVER-720] - add gradle tasks ans steps to generate and include javadoc and sourcesets (#81) Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> --- kotlin/PixelPass/build.gradle.kts | 4 +++- kotlin/PixelPass/publish-artifact.gradle | 13 +++++++++++++ kotlin/build.gradle.kts | 1 + kotlin/gradle/libs.versions.toml | 4 +++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/kotlin/PixelPass/build.gradle.kts b/kotlin/PixelPass/build.gradle.kts index 290ef5e..5381a51 100644 --- a/kotlin/PixelPass/build.gradle.kts +++ b/kotlin/PixelPass/build.gradle.kts @@ -1,8 +1,9 @@ plugins { alias(libs.plugins.androidLibrary) alias(libs.plugins.jetbrainsKotlinAndroid) + alias(libs.plugins.dokka) `maven-publish` - `signing` + signing } android { namespace = "io.mosip.pixelpass" @@ -49,6 +50,7 @@ tasks { tasks.register("jarRelease") { duplicatesStrategy = DuplicatesStrategy.EXCLUDE + dependsOn("dokkaJavadoc") dependsOn("assembleRelease") from("build/intermediates/javac/release/classes") { include("**/*.class") diff --git a/kotlin/PixelPass/publish-artifact.gradle b/kotlin/PixelPass/publish-artifact.gradle index 9544d94..4998cae 100644 --- a/kotlin/PixelPass/publish-artifact.gradle +++ b/kotlin/PixelPass/publish-artifact.gradle @@ -1,3 +1,14 @@ +def javadocJar = tasks.register('javadocJar', Jar) { + dependsOn "dokkaJavadoc" + archiveClassifier.set('javadoc') + from dokkaHtml.outputDirectory +} + +def sourcesJar = tasks.register('sourcesJar', Jar) { + archiveClassifier.set('sources') + from(android.sourceSets.getByName("main").java.srcDirs) +} + publishing { repositories { maven { @@ -105,6 +116,8 @@ publishing { groupId = "io.mosip" artifactId = "pixelpass-jar" version = "0.5.0" + artifact(javadocJar) + artifact(sourcesJar) pom { withXml { asNode().appendNode('name', "Pixelpass") diff --git a/kotlin/build.gradle.kts b/kotlin/build.gradle.kts index cae5274..7c902b6 100644 --- a/kotlin/build.gradle.kts +++ b/kotlin/build.gradle.kts @@ -4,5 +4,6 @@ plugins { alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.jetbrainsKotlinAndroid) apply false alias(libs.plugins.compose.compiler) apply false + alias(libs.plugins.dokka ) apply false `maven-publish` } \ No newline at end of file diff --git a/kotlin/gradle/libs.versions.toml b/kotlin/gradle/libs.versions.toml index 49ae24f..dee4e4a 100644 --- a/kotlin/gradle/libs.versions.toml +++ b/kotlin/gradle/libs.versions.toml @@ -15,6 +15,7 @@ cbor = "0.9" zxing = "3.5.3" json = "20140107" ztzip = "1.17" +dokka = "1.9.20" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -44,4 +45,5 @@ ztzip = { group = "org.zeroturnaround", name = "zt-zip", version.ref = "ztzip" } androidApplication = { id = "com.android.application", version.ref = "agp" } androidLibrary = { id = "com.android.library", version.ref = "agp" } jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } \ No newline at end of file +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } \ No newline at end of file