Skip to content

Commit

Permalink
Merge pull request #32 from irgaly/v1.1.0_fix_jitpack
Browse files Browse the repository at this point in the history
fix: Jitpack, CircleCI releases
  • Loading branch information
k-kagurazaka authored Aug 6, 2021
2 parents f232865 + b2d309a commit 85bd071
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 59 deletions.
12 changes: 2 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
version: 2.1
jobs:
build:
docker:
- image: circleci/android:api-26-alpha
- image: circleci/android:api-30

working_directory: ~/repo

Expand All @@ -29,14 +29,6 @@ jobs:
name: Run Tests
command: ./gradlew testDebug

- run:
name: Check
command: |
if [ ! $CIRCLE_BRANCH = 'master' ]; then
./gradlew --stacktrace lintDebug
./gradlew --stacktrace ktlintDebugCheck
fi
- store_artifacts:
path: app/build/outputs
destination: outputs
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import dependencies.Depends
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
maven { url "https://jitpack.io" }
}
dependencies {
Expand All @@ -17,7 +16,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
mavenCentral()
}
6 changes: 3 additions & 3 deletions buildSrc/src/main/java/dependencies/Depends.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ object Depends {
}

object Test {
const val junit = "junit:junit:4.12"
const val testRunner = "androidx.test:runner:1.1.0"
const val junit = "junit:junit:4.13.2"
const val testRunner = "androidx.test:runner:1.4.0"
const val mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0"
const val robolectric = "org.robolectric:robolectric:3.5.1"
const val robolectric = "org.robolectric:robolectric:4.6.1"

object Espresso {
const val core = "androidx.test.espresso:espresso-core:3.1.0-alpha4"
Expand Down
13 changes: 1 addition & 12 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ android {
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "$versionMajor.$versionMinor.$versionPatch"
}
signingConfigs {
release {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
dexOptions {
preDexLibraries false
}
buildTypes {
debug {
applicationIdSuffix '.debug'
Expand All @@ -42,7 +31,7 @@ android {
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
}
}
testOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.kyash.vtl.example.testing

import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers
import io.reactivex.rxjava3.plugins.RxJavaPlugins
import io.reactivex.rxjava3.schedulers.Schedulers
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
Expand All @@ -26,4 +26,4 @@ class RxImmediateSchedulerRule : TestRule {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import co.kyash.vtl.example.testing.RxImmediateSchedulerRule
import co.kyash.vtl.validators.VtlValidator
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.mock
import io.reactivex.Single
import io.reactivex.rxjava3.core.Single
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
Expand Down Expand Up @@ -67,8 +67,10 @@ class MaterialDesignColorsValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError {
it.message == errorMessage
}
}
}

}
}
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
org.gradle.jvmargs=-Xmx1536m
android.databinding.enableV2=true
android.useAndroidX=true
android.enableJetifier=true
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk11
17 changes: 16 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import dependencies.Versions

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

def versionMajor = 1
def versionMinor = 1
Expand Down Expand Up @@ -30,6 +31,21 @@ android {
}
}

testOptions {
unitTests.includeAndroidResources = true
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
artifactId = "validatable-textinput-layout"
artifact(sourcesJar)
}
}
}
}

dependencies {
Expand All @@ -46,7 +62,6 @@ dependencies {
testImplementation Depends.Test.robolectric
}

// build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.kyash.vtl.testing

import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers
import io.reactivex.rxjava3.plugins.RxJavaPlugins
import io.reactivex.rxjava3.schedulers.Schedulers
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
Expand All @@ -26,4 +26,4 @@ class RxImmediateSchedulerRule : TestRule {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ class AlphabetOnlyValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ class AsciiOnlyValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class EmailValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ class HiraganaOnlyValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ class KatakanaOnlyValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ class MinLengthValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class NoSpecialCharacterValidatorTest(
if (errorMessage == null) {
validator.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
validator.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
validator.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ class NumberOnlyValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class RequiredValidatorTest(
if (errorMessage == null) {
subject.validateAsCompletable(context, text).test().assertNoErrors().assertComplete()
} else {
subject.validateAsCompletable(context, text).test().assertErrorMessage(errorMessage)
subject.validateAsCompletable(context, text).test().assertError { it ->
it.message == errorMessage
}
}
}

}
}

0 comments on commit 85bd071

Please sign in to comment.