Skip to content

Commit

Permalink
1.1.0: Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Aug 13, 2023
1 parent 952c056 commit 722975f
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Espresso-Helper 1.1.0 (2023-08-13)

- Update every dependency.

- Kotlin is now 1.8.22.

- CompileSdk is now 33.

# Espresso-Helper 1.0.0 (2020-06-03)

- Update: make AndroidX.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ In order to use Espresso Helper, you need to add jitpack to your project root gr

and add the compile dependency to your module level gradle.

androidTestImplementation 'com.github.Zhuinden:espresso-helper:1.0.0'
androidTestImplementation 'com.github.Zhuinden:espresso-helper:1.1.0'


## License
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.android.tools.build:gradle:7.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -19,6 +18,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
Expand Down
112 changes: 81 additions & 31 deletions espresso-helper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'

apply plugin: 'maven-publish'

group = "com.github.Zhuinden.espresso-helper"
version = "1.1.0"

android {
compileSdkVersion 27
compileSdkVersion 33
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 31
versionCode 1
versionName "0.1.0"
versionName "1.1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildTypes {
release {
minifyEnabled false
Expand All @@ -25,42 +35,46 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
api "com.google.android.material:material:1.1.0"
api 'androidx.constraintlayout:constraintlayout:1.1.3'
api "androidx.recyclerview:recyclerview:1.1.0"

api 'androidx.annotation:annotation:1.1.0'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "androidx.test:runner:1.2.0"
api "androidx.test:rules:1.2.0"
api 'androidx.test.ext:junit:1.1.1'
api 'androidx.test.espresso:espresso-core:3.2.0'
api "androidx.test.espresso:espresso-contrib:3.2.0"
api "androidx.test.espresso:espresso-intents:3.2.0"

testImplementation 'junit:junit:4.13'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.mockito:mockito-core:2.19.0'
testImplementation 'org.robolectric:robolectric:4.2.1'
api "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
api "com.google.android.material:material:1.9.0"
api 'androidx.constraintlayout:constraintlayout:2.1.4'
api "androidx.recyclerview:recyclerview:1.3.1"

api 'androidx.annotation:annotation:1.6.0'
api "androidx.test:runner:1.5.2"
api "androidx.test:rules:1.5.0"
api 'androidx.test.ext:junit:1.1.5'
api 'androidx.test.espresso:espresso-core:3.5.1'
api "androidx.test.espresso:espresso-contrib:3.5.1"
api "androidx.test.espresso:espresso-intents:3.5.1"

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.16.1'
testImplementation 'org.mockito:mockito-core:3.8.0'
testImplementation 'org.robolectric:robolectric:4.9.2'
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
androidTestImplementation 'junit:junit:4.13'
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation "com.google.android.material:material:1.9.0"
}

// build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
configurations.implementation.canBeResolved(true)
configurations.api.canBeResolved(true)

failOnError false
source = android.sourceSets.main.java.sourceFiles

source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
//destinationDir = file("../javadoc/")
classpath += configurations.api
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier = "sources"
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
Expand All @@ -70,3 +84,39 @@ artifacts {
archives sourcesJar
archives javadocJar
}

// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release
artifact(sourcesJar)

// You can then customize attributes of the publication as shown below.
groupId = 'com.github.Zhuinden'
artifactId = 'espresso-helper'
version = '1.1.0'

pom.withXml {
def dependenciesNode = (asNode().get("dependencies") as groovy.util.NodeList).get(0) as groovy.util.Node
def configurationNames = ["implementation", "api"]

configurationNames.forEach { configurationName ->
configurations[configurationName].allDependencies.forEach {
if (it.group != null && it.version != "unspecified") {
def dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class BackgroundColorMatcher(@ColorRes private val resId: Int = -1,
when (current) {
is ColorDrawable -> current.color == expectedColor
is GradientDrawable -> if (android.os.Build.VERSION.SDK_INT >= 24) {
current.color.defaultColor == expectedColor
current.color?.defaultColor == expectedColor
} else {
false // not much I can do here
}
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 @@
#Wed Jun 03 19:16:25 CEST 2020
#Sun Aug 13 21:19:59 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
31 changes: 20 additions & 11 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion 33
defaultConfig {
applicationId "com.zhuinden.espressohelper"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -18,18 +17,28 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.13'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.recyclerview:recyclerview:1.3.1"
implementation "com.google.android.material:material:1.9.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation project(':espresso-helper')

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ class ExampleInstrumentedTest {
helloWorld.checkHasText(R.string.hello_world)
username.performTypeText("This is a test!")
password.performTypeText("hunter2")
activity.rotateOrientation()
activity.rotateOrientation()

button.performClick()
checkCurrentActivityIs<SecondActivity>()
activity.rotateOrientation()
secondText.checkHasText("Well done!")
activity.rotateOrientation()
checkCurrentActivityIs<SecondActivity>()

rule.waitOnMainThread { callback ->
// wait fomr something
Expand Down
12 changes: 9 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".SecondActivity"/>
<activity android:name="com.zhuinden.espressohelpersample.MainActivity">
<activity
android:name=".SecondActivity"
android:exported="true" />
<activity
android:name="com.zhuinden.espressohelpersample.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.zhuinden.espressohelpersample.TextActivity" />
<activity
android:name="com.zhuinden.espressohelpersample.TextActivity"
android:exported="true" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ package com.zhuinden.espressohelpersample

import android.content.Intent
import android.os.Bundle
import android.view.ViewGroup
import android.view.Window
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import com.zhuinden.espressohelpersample.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

button.setOnClickListener {
val binding = ActivityMainBinding.bind((findViewById(Window.ID_ANDROID_CONTENT) as ViewGroup).getChildAt(0))

binding.button.setOnClickListener {
startActivity(Intent(this, SecondActivity::class.java))
}
}
Expand Down

0 comments on commit 722975f

Please sign in to comment.