Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #151 from vimeo/develop
Browse files Browse the repository at this point in the history
Release 2.5.0
  • Loading branch information
anthonycr committed Dec 18, 2017
2 parents 7e6741c + 7366feb commit 735dd21
Show file tree
Hide file tree
Showing 205 changed files with 2,192 additions and 1,773 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ out
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/test_output

# jacoco files
jacoco.exec
29 changes: 16 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
language: android
jdk:
- oraclejdk8
- oraclejdk8
android:
components:
- tools
- build-tools-26.0.0
- android-26
- build-tools-27.0.2
- android-27
- extra-android-support
- extra-android-m2repository
# workaround for Google changing android-27 package and causing a checksum mismatch
before_install:
- yes | sdkmanager "platforms;android-27"
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- 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"
- "$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 shipit
- ./gradlew jacocoTestReport --stacktrace
- rvm install 2.2
- rvm use 2.2
- bundle install
- FASTLANE_SKIP_UPDATE_CHECK=1 bundle exec fastlane shipit
- ./gradlew jacocoTestReport --stacktrace
after_success:
- bash <(curl -s https://codecov.io/bash)

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
==========

Version 2.5.0 *(2017-12-18)*
----------------------------
- Improved performance of loading the `Stag.Factory`.
- Improved error logging when getters/setters can't be found.
- Splitting up examples into integration test modules.
- Wrote functional tests for most use cases.
- Fixed bug where wrapper type adapters would not be called when `Stag.Factory` was registered.

Version 2.4.0 *(2017-10-24)*
----------------------------
- Fixed bug where generated type adapters would write out an empty JSON object for a `null` value.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Stag improves Gson performance by automatically generating reflection-less TypeAdapters for your model objects.

[![Build Status](https://travis-ci.org/vimeo/stag-java.svg?branch=master)](https://travis-ci.org/vimeo/stag-java) [![codecov](https://codecov.io/gh/vimeo/stag-java/branch/dev/graph/badge.svg)](https://codecov.io/gh/vimeo/stag-java) [![Download](https://api.bintray.com/packages/vimeo/maven/stag-library/images/download.svg)](https://bintray.com/vimeo/maven/stag-library/_latestVersion) [![Javadocs](https://www.javadoc.io/badge/com.vimeo.stag/stag-library.svg)](https://www.javadoc.io/doc/com.vimeo.stag/stag-library)
[![Build Status](https://travis-ci.org/vimeo/stag-java.svg?branch=develop)](https://travis-ci.org/vimeo/stag-java) [![codecov](https://codecov.io/gh/vimeo/stag-java/branch/develop/graph/badge.svg)](https://codecov.io/gh/vimeo/stag-java) [![Download](https://api.bintray.com/packages/vimeo/maven/stag-library/images/download.svg)](https://bintray.com/vimeo/maven/stag-library/_latestVersion) [![Javadocs](https://www.javadoc.io/badge/com.vimeo.stag/stag-library.svg)](https://www.javadoc.io/doc/com.vimeo.stag/stag-library)


## Why Build Stag?
Expand Down Expand Up @@ -36,7 +36,7 @@ buildscript {
apply plugin: 'net.ltgt.apt'
dependencies {
def stagVersion = '2.4.0'
def stagVersion = '2.5.0'
compile "com.vimeo.stag:stag-library:$stagVersion"
apt "com.vimeo.stag:stag-library-compiler:$stagVersion"
}
Expand All @@ -57,7 +57,7 @@ gradle.projectsEvaluated {

```groovy
dependencies {
def stagVersion = '2.4.0'
def stagVersion = '2.5.0'
compile "com.vimeo.stag:stag-library:$stagVersion"
annotationProcessor "com.vimeo.stag:stag-library-compiler:$stagVersion"
}
Expand All @@ -82,8 +82,8 @@ android {

#### 2. Provide optional compiler arguments to Stag
- `stagGeneratedPackageName`: Pass package name as an argument for the generated files. 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.
in `com.vimeo.stag.generated` package. You can specify your own package for the generated files
by passing it as an argument to the annotation processor.
- `stagDebug`: Turn on debugging in Stag. This will cause Stag to spit out a lot of output into the gradle console.
This can aid you in figuring out what class is giving you trouble, if the exception gradle prints out
isn't sufficient. Default is false.
Expand Down
17 changes: 10 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

ext.kotlin_version = '1.1.51'
ext.jacoco_version = '0.7.9' // See https://www.eclemma.org/jacoco/
ext.kotlinVersion = '1.2.10'
ext.jacocoVersion = '0.7.9' // See https://www.eclemma.org/jacoco/
ext.gsonVersion = '2.8.2'

// android dependencies
ext.targetSdk = 26
ext.targetSdk = 27
ext.minSdk = 14
ext.buildTools = "26.0.0"
ext.buildTools = "27.0.2"

repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.11"
}
}

allprojects {
repositories {
jcenter()
google()
}
apply plugin: "com.jfrog.bintray"

Expand All @@ -40,5 +43,5 @@ allprojects {

subprojects {
group = 'com.vimeo.stag'
version = '2.4.0'
version = '2.5.0'
}
9 changes: 5 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ platform :android do
junit_report_path_array = [
"stag-library/build/test-results/test/*.xml",
"stag-library-compiler/build/test-results/test/*.xml",
"sample-java-model/build/test-results/test/*.xml",
"sample-kotlin-model/build/test-results/testDebugUnitTest/*.xml",
"integration-test-java/build/test-results/test/*.xml",
"integration-test-java-cross-module/build/test-results/test/*.xml",
"integration-test-kotlin/build/test-results/testDebugUnitTest/*.xml",
"sample/build/test-results/testDebugUnitTest/*.xml",
"sample-model/build/test-results/testDebugUnitTest/*.xml"
"integration-test-android/build/test-results/testDebugUnitTest/*.xml"
]
begin
gradle(
task: "sample:build stag-library:test stag-library-compiler:test sample:test sample-model:test sample-java-model:test sample-kotlin-model:test"
task: "stag-library:test stag-library-compiler:test sample:test integration-test-java:test integration-test-java-cross-module:test integration-test-kotlin:test integration-test-android:test"
)
rescue => error
begin
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Mar 02 18:01:34 EST 2017
#Wed Oct 25 13:24:54 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-4.1-all.zip
File renamed without changes.
36 changes: 12 additions & 24 deletions sample-model/build.gradle → integration-test-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'jacoco-android'

buildscript {
repositories {
jcenter()
}
}

android {
// Please update the ".travis.yml" file "android.components" section
compileSdkVersion targetSdk
buildToolsVersion buildTools

Expand All @@ -18,42 +10,38 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

javaCompileOptions {
annotationProcessorOptions {
arguments = [
stagGeneratedPackageName : 'com.vimeo.sample_model.stag.generated',
stagDebug : 'true',
stagAssumeHungarianNotation: 'true'
stagAssumeHungarianNotation: 'true',
stagGeneratedPackageName : 'com.vimeo.sample.stag.generated',
stagDebug : 'true'
]
}
}
}

buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled false
}
}
}

jacoco {
toolVersion = jacoco_version
}

dependencies {
testCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'

compile 'com.android.support:support-annotations:25.3.1'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:support-annotations:27.0.2'

compile project(':stag-library')
implementation project(':stag-library')
annotationProcessor project(':stag-library-compiler')

compile 'com.google.code.gson:gson:2.8.0'
implementation "com.google.code.gson:gson:$gsonVersion"
}

gradle.projectsEvaluated {
Expand All @@ -63,4 +51,4 @@ gradle.projectsEvaluated {
"-Werror"
]
}
}
}
21 changes: 21 additions & 0 deletions integration-test-android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# https://developer.android.com/guide/developing/tools/proguard.html

# 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
3 changes: 3 additions & 0 deletions integration-test-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest
package="com.vimeo.integration_test_android"
xmlns:android="https://schemas.android.com/apk/res/android" />
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.vimeo.sample.model;
package com.vimeo.integration_test_android;

import android.support.v4.util.ArrayMap;

Expand All @@ -38,15 +38,15 @@
@UseStag
public class ClassWithMapTypes {

public HashMap<String, Video> videoHashMap;
public HashMap<String, TestModel> testModelHashMap;

public LinkedHashMap<String, Integer> stringIntegerMap;

public Map<Integer, String> integerStringMap;

public Map<Video, String> complexTypeMap;
public Map<TestModel, String> complexTypeMap;

public Map<String, List<Video>> mapOfLists;
public Map<String, List<TestModel>> mapOfLists;

public ArrayMap<String, String> arrayMap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.vimeo.sample.model;
package com.vimeo.integration_test_android;

import android.webkit.ValueCallback;

Expand All @@ -31,9 +31,7 @@
import java.util.Map;

/**
* Complex generic class which contains the parameterized type
*
* @param <T>
* Complex generic class which contains a parameterized platform type.
*/
@UseStag
public class ComplexGenericClass<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.vimeo.sample.model;
package com.vimeo.integration_test_android;


import com.vimeo.stag.UseStag;

/**
* Complex generic class which specifies the parametrised type in the base class
*
* Complex generic class which specifies the parametrized type in the base class.
*/
@UseStag
public class ComplexGenericClassExtended extends ComplexGenericClass<Video> {
public class ComplexGenericClassExtended extends ComplexGenericClass<TestModel> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.vimeo.integration_test_android;

import com.google.gson.annotations.SerializedName;
import com.vimeo.stag.UseStag;

/**
* A simple model used in {@link ClassWithMapTypes}.
*/
@UseStag
public class TestModel {

@SerializedName("field_1")
private String mField1;

@SerializedName("field_2")
private int mField2;

public String getField1() {
return mField1;
}

public void setField1(String field1) {
mField1 = field1;
}

public int getField2() {
return mField2;
}

public void setField2(int field2) {
mField2 = field2;
}
}
Loading

0 comments on commit 735dd21

Please sign in to comment.