diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..d7b0fa5c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: android +jdk: +- oraclejdk8 +android: + components: + - tools + - build-tools-25.0.2 + - android-25 + - extra-android-support + - extra-android-m2repository +before_cache: +- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ +cache: + directories: + - "$HOME/.gradle/caches/" + - "$HOME/.gradle/wrapper/" + - "$HOME/.android/build-cache" +script: +- rvm install 2.2 +- rvm use 2.2 +- bundle install +- FASTLANE_SKIP_UPDATE_CHECK=1 bundle exec fastlane test + +# https://vimeo.slack.com/services/B3TG0UCR3 +# travis encrypt ":#" --add notifications.slack.rooms +notifications: + slack: + rooms: + secure: psEjUOvylqjlGlH2p6SQUkAZdFR//+JB/Z98Uqg7N5qb/ZwYepFwMtzXuZpDcv1wFI8Znh0m5n3zAmBpYgG27gmS8BZZg/U9GmSN8HmaR3IGa9Qp7VKbrBet6GhMjVRzCi+kXYgq8rSw4/yhx/LpfgCeZRqcECbf3HJJlnSPBivIjSMM/+BjUEQb5smHDRYPHHXxl2lHMJcK9h2T/9ie/xoUbKZLokITHXXyvNtUNbA27NE3aWh0cUXj2DxhYWrlmQWgQq4wjUqn27WW/MthfBn6+nGAiQYQ3SdUIh5LJIQY6XE+5LfWJvZHa7Rt6DmiiGDJjYOa4LUYTds8FDCCfjLOIqmUvwHaGMzDZrhsdN2/eJ6CZWWwn1aPE/V+YN1bk8UTgHIu9RCBOv9SepG9CZmtecNXU8MTYUqvPvjM3F2OrDM04COLJiqSch78+LVC/BsZyaQfzP6dLZCffjMP49rDsqrqgZZsaNqSlApNkiX0y9OiujpDedVJ1gp49jnkoxbU9GWYWOyHQpJ/++84D61tNhnrCoNArl3KraWKtQdyKXnMUfAkTQ/9mohsJMGhc2RqWSGcAHmK+Z/3SIIV2VBFqX45NO2StVFSql4aDQPQDoo5T1nPVCHdnMUcoitZDjFgflGvxqCu7qIq364p7YBOa5pH+BzaGywkkRRpYcM= diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 00000000..cf15d4f0 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,5 @@ +# Print reports for each test result +Dir.glob('stag-library*build/test-results/*.xml') do |result| + junit.parse result + junit.report +end \ No newline at end of file diff --git a/Gemfile b/Gemfile index 65a6e01f..36185670 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ source 'https://rubygems.org' gem 'fastlane', '2.1.1' +gem 'danger-junit', '0.7.2' +gem 'travis', '1.8.5' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval(File.read(plugins_path), binding) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index 8c6688e4..56e00645 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,20 +11,46 @@ GEM addressable (2.5.0) public_suffix (~> 2.0, >= 2.0.2) babosa (1.0.2) + backports (3.6.8) claide (1.0.1) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) colored (1.2) colorize (0.8.1) commander (4.4.1) highline (~> 1.7.2) + connection_pool (2.2.1) + cork (0.2.0) + colored (~> 1.2) + danger (4.0.5) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored (~> 1.2) + cork (~> 0.1) + faraday (~> 0.9) + faraday-http-cache (~> 1.0) + git (~> 1) + kramdown (~> 1.5) + octokit (~> 4.2) + terminal-table (~> 1) + danger-junit (0.7.2) + danger (> 2.0) + ox (~> 2.0) domain_name (0.5.20161129) unf (>= 0.0.5, < 1.0.0) dotenv (2.1.1) + ethon (0.10.1) + ffi (>= 1.3.0) excon (0.54.0) faraday (0.10.0) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) + faraday-http-cache (1.3.1) + faraday (~> 0.8) faraday_middleware (0.10.1) faraday (>= 0.7.4, < 1.0) fastimage (2.0.1) @@ -64,7 +90,16 @@ GEM colorize nokogiri terminal-table + ffi (1.9.17) + gh (0.14.0) + addressable + backports + faraday (~> 0.8) + multi_json (~> 1.0) + net-http-persistent (>= 2.7) + net-http-pipeline gh_inspector (1.0.2) + git (1.3.0) google-api-client (0.9.20) addressable (~> 2.3) googleauth (~> 0.5) @@ -90,6 +125,9 @@ GEM i18n (0.7.0) json (1.8.3) jwt (1.5.6) + kramdown (1.13.2) + launchy (2.4.3) + addressable (~> 2.3) little-plugger (1.1.4) logging (2.1.0) little-plugger (~> 1.1) @@ -105,16 +143,30 @@ GEM multi_xml (0.6.0) multipart-post (2.0.0) nanaimo (0.2.3) + nap (1.1.0) + net-http-persistent (3.0.0) + connection_pool (~> 2.2) + net-http-pipeline (1.0.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + octokit (4.6.2) + sawyer (~> 0.8.0, >= 0.5.3) + open4 (1.3.4) os (0.9.6) + ox (2.4.8) plist (3.2.0) public_suffix (2.0.4) + pusher-client (0.6.2) + json + websocket (~> 1.0) representable (2.3.0) uber (~> 0.0.7) retriable (2.1.0) rouge (1.11.1) rubyzip (1.2.0) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) security (0.1.3) signet (0.7.3) addressable (~> 2.3) @@ -126,6 +178,17 @@ GEM terminal-table (1.7.3) unicode-display_width (~> 1.1.1) thread_safe (0.3.5) + travis (1.8.5) + backports + faraday (~> 0.9) + faraday_middleware (~> 0.9, >= 0.9.1) + gh (~> 0.13) + highline (~> 1.6) + launchy (~> 2.1) + pusher-client (~> 0.4) + typhoeus (~> 0.6, >= 0.6.8) + typhoeus (0.8.0) + ethon (>= 0.8.0) tzinfo (1.2.2) thread_safe (~> 0.1) uber (0.0.15) @@ -133,6 +196,7 @@ GEM unf_ext unf_ext (0.0.7.2) unicode-display_width (1.1.2) + websocket (1.2.3) word_wrap (1.0.0) xcodeproj (1.4.2) CFPropertyList (~> 2.3.3) @@ -149,8 +213,10 @@ PLATFORMS ruby DEPENDENCIES + danger-junit (= 0.7.2) fastlane (= 2.1.1) fastlane-plugin-pretty_junit + travis (= 1.8.5) BUNDLED WITH - 1.13.6 + 1.13.7 diff --git a/README.md b/README.md index 6a8e060b..082aa350 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Stag improves Gson performance by automatically generating reflection-less TypeA | Branch | Build Status | |--------|--------------| -| master | [![Build Status](https://circleci.com/gh/vimeo/stag-java/tree/master.svg?style=shield&circle-token=4d5dd11678a93587658d1677d0ef2b8c64b56574)](https://circleci.com/gh/vimeo/stag-java/tree/master) | -| dev | [![Build Status](https://circleci.com/gh/vimeo/stag-java/tree/dev.svg?style=shield&circle-token=4d5dd11678a93587658d1677d0ef2b8c64b56574)](https://circleci.com/gh/vimeo/stag-java/tree/dev) | +| master | [![Build Status](https://travis-ci.org/vimeo/stag-java.svg?branch=master)](https://travis-ci.org/vimeo/stag-java) | +| dev | [![Build Status](https://travis-ci.org/vimeo/stag-java.svg?branch=dev)](https://travis-ci.org/vimeo/stag-java) | ## Why Build Stag? @@ -25,8 +25,8 @@ The Stag library solves this problem. It leverages annotations to automatically from jCenter ```groovy dependencies { - compile 'com.vimeo.stag:stag-library:1.2.1' - apt 'com.vimeo.stag:stag-library-compiler:1.2.1' + compile 'com.vimeo.stag:stag-library:2.0.0' + apt 'com.vimeo.stag:stag-library-compiler:2.0.0' } ``` @@ -70,7 +70,7 @@ buildscript { apply plugin: 'com.neenbedankt.android-apt' ``` -#### 3. Passing package name as an argument for the generated files (Optional) +#### 3. Pass package name as an argument for the generated files (Optional) By default, the files will be in generated in `com.vimeo.sample.stag.generated` package. But, you can specify your own package for the generated files by passing it as an argument to the apt compiler. ```groovy apt { @@ -80,61 +80,75 @@ apt { } ``` -## Stag Rules +## Features -1. Make sure the member variables of your model class are not private (i.e. public, protected, or package-local visibility) -2. Make sure your model class is not private and has a zero argument non-private constructor -3. Annotate each member variable you want populated - - `@GsonAdapterKey("json_key")`: populates the field using the JSON value with the specified key - - `@GsonAdapterKey`: populates the field using the JSON value with the key named the same as the member variable - - Use your favorite `@NonNull` annotation to tell Stag to throw an exception if the field is null while deserializing or while serializing the object. -4. Register the `Stag.Factory` with Gson when you create your Gson instance: `Gson gson = new GsonBuilder().registerTypeAdapterFactory(new Stag.Factory()).create();` -5. You're done! +#### 1. Class Level Annotation + +Stag supports class level annotation `@UseStag` which processes all the fields for a particular class, which makes it easy to use and integrate. + +`@UseStag` has three different variants: + + - `@UseStag(FieldOption.ALL)` : Will serialize/de-serialize all member variables which are not static or transient + - `@UseStag(FieldOption.NONE)` : Will skip serialization and deserialization for all member variables. Only member variables inherited from annotated classes will be included. + - `@UseStag(FieldOption.SERIALIZED_NAME)` : Will Serialize or Deserialize Fields only which are annotated with `SerializedName` or `GsonAdapterKey` (deprecated). -## Supported Types +#### 2. `@SerializedName("key")` Support -- YES: All native types supported by Gson (boolean, double, int, long, float) -- YES: String types -- YES: ArrayList or any other List interfaces are supported -- YES: HashMaps or any other Map interfaces are supported -- YES: Complex data structures supported -- YES: Enumerations (enums) +Similar to GSON, you can use the`@SerializedName` annotation to provide a different JSON name to a member field. It also supports alternate name feature of the `@SerializedName` annotation. + `@SerializedName("name")` or `@SerializedName(value = "name", alternate = {"name1", "name2"})`. -Note : -- `@SerializedName("json_key")` annotations you might be using will be ignored. +#### 3. Cross Module Support + +Stag has the ability to reference TypeAdapters across modules. + +#### 4. Parity with GSON + +Last but not the least, Stag is almost in parity with GSON. + +## Stag Rules + +1. Make sure the member variables of your model class are not private (should be public, protected, or package-local visibility) +2. Make sure your model class is not private and has a zero argument non-private constructor +3. Annotate the classes with `@UseStag` annotation. This will process all the member variables of the class, which makes it easy to use. +4. Use the `@SerializedName("key")` annotation to give the variables a different JSON name. (same as GSON) +5. Use your favorite `@NonNull` annotation to tell Stag to throw an exception if the field is null while deserializing or while serializing the object. +6. Register the `Stag.Factory` with Gson when you create your Gson instance: `Gson gson = new GsonBuilder().registerTypeAdapterFactory(new Stag.Factory()).create();` +7. You're done! + +NOTE: `@GsonAdapterKey` has been deprecated and will be removed in a future release. It is advisable to migrate to `@SerializedName` and `@UseStag` annotations. See the [example below](#example) or the [sample app](sample) to get more info on how to use Stag. ## Example ```java +@UseStag public class Deer { - @GsonAdapterKey("name") + @SerializedName("name") String mName; // mName = json value with key "name" - @GsonAdapterKey("species") + @SerializedName("species") String mSpecies; // mSpecies = json value with key "species" - @GsonAdapterKey("age") + @SerializedName("age") int mAge; // mAge = json value with key "age" - @GsonAdapterKey("points") + @SerializedName("points") int mPoints; // mPoints = json value with key "points" - @GsonAdapterKey("weight") - float mWeight; // mWeight = json value with key "weight" + @SerializedName("weight") + float mWeight; // mWeight = json value with key "weight" } +@UseStag public class Herd { - @NonNull // add NonNull annotation to throw an exception if the field is null - @GsonAdapterKey - ArrayList data_list; // data_list = json value with key "data_list" + @NonNull // add NonNull annotation to throw an exception if the field is null + @SerializedName("data_list") + ArrayList data; // data_list = json value with key "data_list" - @GsonAdapterKey - List data_list_copy; // data_list_copy = json value with key "data_list_copy" + List data_list_copy; // data_list_copy = json value with key "data_list_copy" - @GsonAdapterKey Map data_map; // data_map = json value with key "data_map" } @@ -159,8 +173,20 @@ MyParsingClass { ## Future Enhancements - Add an option to absorb parsing errors rather than crashing and halting parsing (default gson behavior) -- Class level annotation so that you don't have to annotate each field -- Support using `@SerializedName` annotation + +## Development +```sh +git clone git@github.com:vimeo/stag-java.git +cd stag-java +bundle install +# dev like a boss +bundle exec fastlane test +# commit and push like a boss +``` + +#### Manage build dependencies +Aside from specifying Java dependencies in the `.gradle` files, you can use the `.travis.yml` file to specify external build depencies such as the Android SDK to compile against (see the `android.components` section). + ## License `stag-java` is available under the MIT license. See the [LICENSE](LICENSE) file for more information. diff --git a/build.gradle b/build.gradle index 4c1f3490..30f306ae 100644 --- a/build.gradle +++ b/build.gradle @@ -27,5 +27,5 @@ allprojects { subprojects { group = 'com.vimeo.stag' - version = '1.2.1' + version = '2.0.0' } diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 209e6f30..00000000 --- a/circle.yml +++ /dev/null @@ -1,10 +0,0 @@ -dependencies: - override: - - bundle install - cache_directories: - - "vendor/bundle" - - "~/.gradle" - -test: - override: - - bundle exec fastlane test diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2f78bfd3..a8735f40 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -31,13 +31,37 @@ platform :android do desc "test" lane :test do - # gotta do some setup before running gradle - sh 'touch ../local.properties' + # gotta do some setup before running gradle + sh 'touch ../local.properties' + # run the tests, but dont puke everywhere until the report is printed. + junit_report_path = "stag-library*/build/test-results/*.xml" + begin gradle( - task: "stag-library:build stag-library-compiler:build sample:build" + task: "stag-library:test stag-library-compiler:test sample:build" ) - pretty_junit(file_pattern: "stag-library-compiler/build/test-results/TEST-*") + rescue => error + begin + pretty_junit(file_pattern: junit_report_path) + rescue => error + end + + if is_ci + danger(use_bundle_exec: false) + end + + raise error + end + + begin + pretty_junit(file_pattern: junit_report_path) + rescue => error + end + + if is_ci + danger(use_bundle_exec: false) + end + end diff --git a/sample-model/.gitignore b/sample-model/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/sample-model/.gitignore @@ -0,0 +1 @@ +/build diff --git a/sample-model/build.gradle b/sample-model/build.gradle new file mode 100644 index 00000000..e2c08eb2 --- /dev/null +++ b/sample-model/build.gradle @@ -0,0 +1,51 @@ +apply plugin: 'com.android.library' + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' + } +} + +apply plugin: 'com.neenbedankt.android-apt' + +android { + // Please update the ".travis.yml" file "android.components" section + compileSdkVersion 25 + buildToolsVersion "25.0.2" + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:25.1.0' + compile project(':stag-library') + apt project(':stag-library-compiler') + compile 'com.google.code.gson:gson:2.8.0' +} + +apt { + arguments { + stagGeneratedPackageName "com.vimeo.sample.sample_model.stag.generated" + } +} + +gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" << "-Werror" + } +} \ No newline at end of file diff --git a/sample-model/proguard-rules.pro b/sample-model/proguard-rules.pro new file mode 100644 index 00000000..46cb5988 --- /dev/null +++ b/sample-model/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/mohammad.yasir/Library/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 *; +#} diff --git a/sample-model/src/main/AndroidManifest.xml b/sample-model/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b8a500b8 --- /dev/null +++ b/sample-model/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel.java b/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel.java new file mode 100644 index 00000000..bbcaca79 --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel.java @@ -0,0 +1,14 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public class AlternateNameModel { + + @SerializedName(value = "Nougat", alternate = {"Kitkat", "Lollipop"}) + String mAndroidVersions; + + @SerializedName(value = "7.0", alternate = {"4.0", "5.0"}) + String mAndroidNameVersions; +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel1.java b/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel1.java new file mode 100644 index 00000000..e53c9ff6 --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/AlternateNameModel1.java @@ -0,0 +1,13 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public enum AlternateNameModel1 { + @SerializedName(value = "7.0", alternate = {"4.0", "5.0"}) + ANDROID_VERSION, + + @SerializedName(value = "Nougat", alternate = {"Kitkat", "Lollipop"}) + ANDROID_VERSION_NAME +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/ExternalAbstractClass.java b/sample-model/src/main/java/com/vimeo/sample_model/ExternalAbstractClass.java new file mode 100644 index 00000000..f24a1e92 --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/ExternalAbstractClass.java @@ -0,0 +1,14 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public abstract class ExternalAbstractClass { + + @SerializedName("type") + public String mType; + + @SerializedName("externalModel2") + public ExternalModel2 mExternalModel2; +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel1.java b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel1.java new file mode 100644 index 00000000..846f96bc --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel1.java @@ -0,0 +1,14 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public class ExternalModel1 { + + @SerializedName("field1") + public String mField1; + + @SerializedName("genericField") + public ExternalModelGeneric mGenericField; +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel2.java b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel2.java new file mode 100644 index 00000000..d3f25873 --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModel2.java @@ -0,0 +1,11 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public class ExternalModel2 { + + @SerializedName("externalModelString") + public String mExternalModelString; +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric.java b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric.java new file mode 100644 index 00000000..a6afee74 --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric.java @@ -0,0 +1,14 @@ +package com.vimeo.sample_model; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public class ExternalModelGeneric { + + @SerializedName("field2") + public String mField2; + + @SerializedName("genericField") + public T mGenericField; +} \ No newline at end of file diff --git a/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric1.java b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric1.java new file mode 100644 index 00000000..2e3ef8df --- /dev/null +++ b/sample-model/src/main/java/com/vimeo/sample_model/ExternalModelGeneric1.java @@ -0,0 +1,19 @@ +package com.vimeo.sample_model; + +import android.webkit.ValueCallback; + +import com.google.gson.annotations.SerializedName; +import com.vimeo.stag.UseStag; + +@UseStag +public class ExternalModelGeneric1 { + + @SerializedName("field2") + public String mField2; + + @SerializedName("genericField") + public T mGenericField; + + @SerializedName("unknownType") + public ValueCallback mUnknownType; +} \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle index 31070023..5c9f1c75 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -13,13 +13,14 @@ buildscript { apply plugin: 'com.neenbedankt.android-apt' android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + // Please update the ".travis.yml" file "android.components" section + compileSdkVersion 25 + buildToolsVersion "25.0.2" defaultConfig { applicationId "com.vimeo.sample" minSdkVersion 14 - targetSdkVersion 23 + targetSdkVersion 25 versionCode 1 versionName "1.0" } @@ -29,13 +30,17 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + lintOptions { + abortOnError false + } } dependencies { testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.4.0' + compile 'com.android.support:appcompat-v7:25.1.0' compile project(':stag-library') + compile project(':sample-model') apt project(':stag-library-compiler') compile 'com.google.code.gson:gson:2.8.0' } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 391bef35..c50e6a99 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ - @@ -9,7 +10,8 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + tools:ignore="AllowBackup,GoogleAppIndexingWarning"> diff --git a/sample/src/main/java/com/vimeo/sample/MainActivity.java b/sample/src/main/java/com/vimeo/sample/MainActivity.java index ccf5118e..89329772 100644 --- a/sample/src/main/java/com/vimeo/sample/MainActivity.java +++ b/sample/src/main/java/com/vimeo/sample/MainActivity.java @@ -40,8 +40,8 @@ public class MainActivity extends AppCompatActivity { - final List