Skip to content

Commit

Permalink
Merge pull request #51 from wellingtoncosta/develop
Browse files Browse the repository at this point in the history
Release 3.2.0
  • Loading branch information
wellingtoncosta authored Oct 31, 2019
2 parents 81bf3d9 + 89c53ce commit ae6a5f2
Show file tree
Hide file tree
Showing 69 changed files with 5,588 additions and 1,841 deletions.
113 changes: 99 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,84 @@
version: 2
version: 2.0

general:
branches:
only:
- master
- development
- develop

defaults: &defaults
working_directory: ~/convalida

docker:
- image: circleci/android:api-29

environment:
JVM_OPTS: -Xmx1024m

jobs:
build:
working_directory: ~/convalida
<<: *defaults

docker:
- image: circleci/android:api-28-alpha
steps:
- checkout

- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew ./checksum.sh

- run:
name: Generate cache key
command: ./checksum.sh /tmp/checksum.txt

environment:
JVM_OPTS: -Xmx3200m
- restore_cache:
key: gradle-{{ checksum "/tmp/checksum.txt" }}

- run:
name: Download Dependencies
command: ./gradlew dependencies

- run:
name: Assemble project
command: ./gradlew clean assemble lint

- save_cache:
paths:
- ~/.gradle/caches
- ~/.gradle/wrapper
key: gradle-{{ checksum "/tmp/checksum.txt" }}

- persist_to_workspace:
root: .
paths:
- build
- convalida-annotations/build
- convalida-compiler/build
- convalida-databinding/build
- convalida-ktx/build
- convalida-runtime/build
- convalida-validators/build
- sample/build

test:
<<: *defaults

steps:
- checkout

- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew
name: Chmod permissions
command: sudo chmod +x ./gradlew ./checksum.sh

- run:
name: Install Codecov
command: sudo pip install codecov
name: Generate cache key
command: ./checksum.sh /tmp/checksum.txt

- restore_cache:
key: gradle-{{ checksum "/tmp/checksum.txt" }}

- run:
name: Download dependencies
command: ./gradlew androidDependencies
name: Install Codecov
command: sudo pip install codecov

- run:
name: Run unit tests
Expand All @@ -38,3 +87,39 @@ jobs:
- run:
name: Send test reports to Codecov
command: codecov

deploy_snapshot:
<<: *defaults

steps:
- checkout

- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew ./checksum.sh

- run:
name: Generate cache key
command: ./checksum.sh /tmp/checksum.txt

- restore_cache:
key: gradle-{{ checksum "/tmp/checksum.txt" }}

- run:
name: Deploy Snapshot to Maven
command: ./gradlew uploadArchives -P$SONATYPE_NEXUS_USERNAME -P$SONATYPE_NEXUS_PASSWORD

workflows:
version: 2
build_test_deploy_snapshot:
jobs:
- build
- test:
requires:
- build
- deploy_snapshot:
requires:
- test
filters:
branches:
only: develop
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ To use Convalida with annotations or Data Binding support, and compile-time code

```groovy
dependencies {
implementation 'io.github.wellingtoncosta:convalida-runtime:3.1.0'
annotationProcessor 'io.github.wellingtoncosta:convalida-compiler:3.1.0'
implementation 'io.github.wellingtoncosta:convalida-runtime:3.2.0'
annotationProcessor 'io.github.wellingtoncosta:convalida-compiler:3.2.0'
}
```

Expand All @@ -28,7 +28,7 @@ Or if you want to use only the Convalida Kotlin Dsl:

```groovy
dependencies {
implementation 'io.github.wellingtoncosta:convalida-ktx:3.1.0'
implementation 'io.github.wellingtoncosta:convalida-ktx:3.2.0'
}
```

Expand Down
34 changes: 17 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ buildscript {
ext.versions = [
android: [
plugin: [
gradle: '3.3.1',
jacoco: '0.1.3'
gradle: '3.5.1',
jacoco: '0.1.4'
],
sdk: [
compile: 28,
compile: 29,
min: 14
]
],
androidx: [
annotations: '1.0.2',
appcompat: '1.0.2',
annotations: '1.1.0',
appcompat: '1.1.0',
constraintlayout: '1.1.3',
core: '1.0.1',
databinding: '3.3.1',
core: '1.1.0',
databinding: '3.5.1',
test: [
espresso: '3.1.1',
espresso: '3.2.0',
ext: [
junit: '1.1.0'
junit: '1.1.1'
],
rules: '1.1.1',
runner: '1.1.1'
rules: '1.2.0',
runner: '1.2.0'
]
],
apache: [
Expand All @@ -34,15 +34,15 @@ buildscript {
],
google: [
android: '4.1.1.4',
autoservice: '1.0-rc4',
autocommons: '0.10',
material: '1.0.0'
],
java: 1.7,
javapoet: '1.11.1',
kotlin: '1.3.21',
kotlin: '1.3.50',
test: [
junit: '4.12',
mockito: '2.24.5'
mockito: '3.1.0'
]
]

Expand Down Expand Up @@ -78,7 +78,7 @@ buildscript {
],
google: [
android: "com.google.android:android:$versions.google.android",
autoservice: "com.google.auto.service:auto-service:$versions.google.autoservice",
autocommons: "com.google.auto:auto-common:$versions.google.autocommons",
material: "com.google.android.material:material:$versions.google.material"
],
javapoet: "com.squareup:javapoet:$versions.javapoet",
Expand Down Expand Up @@ -109,8 +109,8 @@ buildscript {
classpath(deps.android.plugin.jacoco) {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.6.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.27.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
}
}

Expand Down
23 changes: 23 additions & 0 deletions checksum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
RESULT_FILE=$1

if [ -f $RESULT_FILE ]; then
rm $RESULT_FILE
fi
touch $RESULT_FILE

checksum_file() {
echo $(openssl md5 $1 | awk '{print $2}')
}

FILES=()
while read -r -d ''; do
FILES+=("$REPLY")
done < <(find . -type f \( -name "build.gradle*" -o -name "dependencies.kt" -o -name "gradle-wrapper.properties" \) -print0)

# Loop through files and append MD5 to result file
for FILE in ${FILES[@]}; do
echo $(checksum_file $FILE) >> $RESULT_FILE
done
# Now sort the file so that it is
sort $RESULT_FILE -o $RESULT_FILE
11 changes: 0 additions & 11 deletions convalida-annotations/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
import com.android.build.gradle.internal.LoggerWrapper
import com.android.build.gradle.internal.SdkHandler

apply plugin: 'java-library'

sourceCompatibility = versions.java
targetCompatibility = versions.java

def logger = new LoggerWrapper(project.logger)
def sdkHandler = new SdkHandler(project, logger)
for (File file : sdkHandler.sdkLoader.repositories) {
repositories.maven {
url = file.toURI()
}
}

dependencies {
api deps.androidx.annotations
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

@Target(FIELD)
@Retention(SOURCE)
@interface End {
@interface Limit {

int key();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package convalida.annotations;

import androidx.annotation.StringRes;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* @author Wellington Costa on 31/07/2019.
*/
@Target(FIELD)
@Retention(SOURCE)
public @interface FutureDate {

@StringRes int errorMessageResId() default -1;

String errorMessage() default "";

String dateFormat();

String limitDate();

boolean autoDismiss() default true;

boolean required() default true;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package convalida.annotations;

import androidx.annotation.StringRes;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* @author Wellington Costa on 30/07/2019.
*/
@Target(FIELD)
@Retention(SOURCE)
public @interface Ipv4 {

@StringRes int errorMessageResId() default -1;

String errorMessage() default "";

boolean autoDismiss() default true;

boolean required() default true;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package convalida.annotations;

import androidx.annotation.StringRes;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* @author Wellington Costa on 30/07/2019.
*/
@Target(FIELD)
@Retention(SOURCE)
public @interface Ipv6 {

@StringRes int errorMessageResId() default -1;

String errorMessage() default "";

boolean autoDismiss() default true;

boolean required() default true;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
@Target(FIELD)
@Retention(SOURCE)
public @interface NumberLimit {
public @interface NumericLimit {

String min();

Expand Down
Loading

0 comments on commit ae6a5f2

Please sign in to comment.