From e83d37e2cb5824f59207b9531319e45d3f996ddf Mon Sep 17 00:00:00 2001 From: Miha_x64 Date: Sat, 4 Jul 2020 16:17:04 +0300 Subject: [PATCH] extracted android-json module --- .travis.yml | 4 +-- README.md | 3 ++- android-bindings/build.gradle | 2 +- android-bindings/proguard-rules.pro | 25 ------------------- android-json/.gitignore | 1 + android-json/build.gradle | 15 +++++++++++ android-json/gradle.properties | 6 +++++ .../android/json/JsonTokenStream.kt | 3 --- .../aquadc/persistence/android/json/json.kt | 1 - settings.gradle | 2 ++ 10 files changed, 29 insertions(+), 33 deletions(-) delete mode 100644 android-bindings/proguard-rules.pro create mode 100644 android-json/.gitignore create mode 100644 android-json/build.gradle create mode 100644 android-json/gradle.properties rename {android-bindings => android-json}/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt (99%) rename {android-bindings => android-json}/src/main/kotlin/net/aquadc/persistence/android/json/json.kt (98%) diff --git a/.travis.yml b/.travis.yml index 5b1dde11..dc934518 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ before_install: # - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl -s https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r '.assets[0].browser_download_url') script: - - ./gradlew clean :persistence:test :extended-persistence:test :properties:test :sql:test :http:test :fx-bindings:test :samples:fx-sample:test :android-bindings:test :samples:android-sample:test :samples:logic-sample:test -# - ./gradlew :persistence:bintrayUpload :extended-persistence:bintrayUpload :properties:bintrayUpload :android-bindings:bintrayUpload :sql:bintrayUpload :http:bintrayUpload + - ./gradlew clean :persistence:test :extended-persistence:test :properties:test :sql:test :http:test :fx-bindings:test :samples:fx-sample:test :android-json:test :android-bindings:test :samples:android-sample:test :samples:logic-sample:test +# - ./gradlew :persistence:bintrayUpload :extended-persistence:bintrayUpload :properties:bintrayUpload :android-json:bintrayUpload :android-bindings:bintrayUpload :sql:bintrayUpload :http:bintrayUpload #after_success: # - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r properties/build/reports/jacoco/test/jacocoTestReport.xml diff --git a/README.md b/README.md index eae64a00..94c979bb 100644 --- a/README.md +++ b/README.md @@ -567,7 +567,8 @@ dependencies { implementation 'net.aquadc.properties:properties:0.0.14' // observables for both JVM and Android implementation 'net.aquadc.properties:persistence:0.0.14' // persistence for JVM and Android implementation 'net.aquadc.properties:extended-persistence:0.0.14' // partial structs, tuples, either, unsigned, primitive[], token transforms - implementation 'net.aquadc.properties:android-bindings:0.0.14' // AAR for Android(x): View bindings, Parcel, JsonReader as TokenStream, SharedPreferences as Struct, Handler as Executor + implementation 'net.aquadc.properties:android-bindings:0.0.14' // AAR for Android(x): View bindings, Parcel, SharedPreferences as Struct, Handler as Executor + implementation 'net.aquadc.properties:android-json:0.0.14' // AAR for Android(x): JsonReader as TokenStream implementation 'net.aquadc.properties:sql:0.0.14' // observable SQL and SQL templates implementation 'net.aquadc.properties:http:0.0.14' // RPC over HTTP: client-side HTTP templates, server-side routing, type-safe link generator } diff --git a/android-bindings/build.gradle b/android-bindings/build.gradle index 891d1b43..27204790 100644 --- a/android-bindings/build.gradle +++ b/android-bindings/build.gradle @@ -18,7 +18,6 @@ android { buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -53,6 +52,7 @@ dependencies { testImplementation project(':extended-persistence') // partial(Struct) is here testImplementation 'org.robolectric:robolectric:4.3.1' testImplementation project(path: ':sql', configuration: 'testOutput') + testImplementation project(':android-json') } apply from: rootProject.file('etc/release-bintray.gradle') diff --git a/android-bindings/proguard-rules.pro b/android-bindings/proguard-rules.pro deleted file mode 100644 index dc9d130e..00000000 --- a/android-bindings/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /home/miha/Android/Sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android-json/.gitignore b/android-json/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/android-json/.gitignore @@ -0,0 +1 @@ +/build diff --git a/android-json/build.gradle b/android-json/build.gradle new file mode 100644 index 00000000..8a6f60c1 --- /dev/null +++ b/android-json/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib" + implementation "net.aquadc.collections:Collection-utils-jvm:1.0-$collection_utils_version" + implementation project(':persistence') + compileOnly "com.google.android:android:$android_artifact_version" + + testImplementation 'junit:junit:4.12' + testImplementation project(':etc:testing') +} + +apply from: rootProject.file('etc/release-bintray.gradle') diff --git a/android-json/gradle.properties b/android-json/gradle.properties new file mode 100644 index 00000000..25621e9a --- /dev/null +++ b/android-json/gradle.properties @@ -0,0 +1,6 @@ +POM_NAME=Lychee Android JSON bindings +POM_DESCRIPTION=JsonReader/JsonWriter bindings for Lychee persistence +POM_BINTRAY_NAME=net.aquadc.lychee:android-json +POM_ARTIFACT_ID=android-json +POM_PACKAGING=jar +POM_VERSION=0.0.14 diff --git a/android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt b/android-json/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt similarity index 99% rename from android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt rename to android-json/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt index 2bd56142..fac0f77d 100644 --- a/android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt +++ b/android-json/src/main/kotlin/net/aquadc/persistence/android/json/JsonTokenStream.kt @@ -4,7 +4,6 @@ package net.aquadc.persistence.android.json import android.util.Base64 import android.util.JsonReader import android.util.JsonToken -import android.util.JsonWriter import net.aquadc.collections.contains import net.aquadc.collections.enumMapOf import net.aquadc.collections.get @@ -12,8 +11,6 @@ import net.aquadc.persistence.hasFraction import net.aquadc.persistence.tokens.Token import net.aquadc.persistence.tokens.TokenPath import net.aquadc.persistence.tokens.TokenStream -import java.io.Reader -import java.io.Writer @PublishedApi internal class JsonTokenStream( diff --git a/android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/json.kt b/android-json/src/main/kotlin/net/aquadc/persistence/android/json/json.kt similarity index 98% rename from android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/json.kt rename to android-json/src/main/kotlin/net/aquadc/persistence/android/json/json.kt index 9891aeea..8be1dd3e 100644 --- a/android-bindings/src/main/kotlin/net/aquadc/persistence/android/json/json.kt +++ b/android-json/src/main/kotlin/net/aquadc/persistence/android/json/json.kt @@ -16,7 +16,6 @@ import net.aquadc.persistence.struct.Struct import net.aquadc.persistence.struct.forEach import net.aquadc.persistence.tokens.Token import net.aquadc.persistence.tokens.TokenStream -import net.aquadc.persistence.tokens.readAs import net.aquadc.persistence.tokens.tokensFrom import net.aquadc.persistence.type.DataType import java.io.Reader diff --git a/settings.gradle b/settings.gradle index 9720e51d..3b2c1ff3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,3 +15,5 @@ include ':android-bindings' include ':samples:logic-sample' include ':samples:fx-sample' include ':samples:android-sample' +include 'android-json' +