Skip to content

Commit

Permalink
[release] 1.0.9 (#16)
Browse files Browse the repository at this point in the history
[release] 1.0.9
- bumps,
- some internals added,
- detekt fix,
- enabling type resolution for detekt,
- enabling parallel in gradle. It won't be needed, but why not, lets test,
- removing dependencies and google repo from build.gradle.kts in buildSrc,
- changing suppress in Libs.kt and removing it form Config.kt.
  • Loading branch information
GrzegorzBobryk authored Feb 9, 2024
1 parent f60a1fa commit 10ceb4f
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If applicable, add screenshots to help explain your problem.
**Smartphone (please complete the following information):**
- Device: [e.g. Pixel 3a]
- OS: [e.g. api 33]
- Version [e.g. 1.0.8]
- Version [e.g. 1.0.9]

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Ktlint
run: ./gradlew ktlintCheck
- name: Detekt
run: ./gradlew detekt
run: ./gradlew detektMain detektTest
- name: Build with Gradle
run: ./gradlew buildDebug
instrumentation-tests:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and the dependency itself

```gradle
dependencies {
implementation 'com.github.GrzegorzBobryk:ViewBindingDelegate:1.0.8'
implementation 'com.github.GrzegorzBobryk:ViewBindingDelegate:1.0.9'
}
```

Expand Down
6 changes: 0 additions & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ plugins {
}

repositories {
google()
mavenCentral()
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
implementation("com.android.tools.build:gradle:8.1.2")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("unused")

package pl.beavercoding.viewbindingdelegate.buildsrc

object Config {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@file:Suppress("unused")
@file:Suppress("PackageDirectoryMismatch") // this way it will work in project build.gradle.kts

import org.gradle.api.JavaVersion
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.project
import pl.beavercoding.viewbindingdelegate.buildsrc.implementation

object Libs {
private const val androidGradlePluginVersion = "8.1.2"
private const val androidGradlePluginVersion = "8.2.2"
const val androidGradlePlugin = "com.android.tools.build:gradle:$androidGradlePluginVersion"
const val junit = "junit:junit:4.13.2"
val java = JavaVersion.VERSION_1_8
Expand All @@ -16,11 +16,10 @@ object Libs {
const val appcompat = "androidx.appcompat:appcompat:1.6.1"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4"
const val viewBinding = "androidx.databinding:viewbinding:$androidGradlePluginVersion"
const val recyclerView = "androidx.recyclerview:recyclerview:1.3.1"

const val recyclerView = "androidx.recyclerview:recyclerview:1.3.2"

object Navigation {
private const val version = "2.7.3"
private const val version = "2.7.6"

const val safeArgsPlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:$version"
const val fragment = "androidx.navigation:navigation-fragment-ktx:$version"
Expand All @@ -34,30 +33,30 @@ object Libs {
}

object Google {
const val material = "com.google.android.material:material:1.9.0"
const val material = "com.google.android.material:material:1.11.0"
}

object Kotlin {
private const val version = "1.9.10"
private const val version = "1.9.22"

const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:$version"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version"
}

object CanaryLeak {
private const val version = "2.12"
private const val version = "2.13"

const val android = "com.squareup.leakcanary:leakcanary-android:$version"
const val androidTests = "com.squareup.leakcanary:leakcanary-android-instrumentation:$version"
}

object Ktlint {
const val ktlintGradlePlugin = "org.jlleitschuh.gradle:ktlint-gradle:11.6.0"
const val ktlintGradlePlugin = "org.jlleitschuh.gradle:ktlint-gradle:12.0.3"
const val ktlintPlugin = "org.jlleitschuh.gradle.ktlint"
}

object Detekt {
private const val version = "1.23.1"
private const val version = "1.23.4"
const val detektGradlePlugin = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$version"
const val detektFormatting = "io.gitlab.arturbosch.detekt:detekt-formatting:$version"
const val detektPlugin = "io.gitlab.arturbosch.detekt"
Expand Down
7 changes: 7 additions & 0 deletions config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ formatting:
MaximumLineLength:
active: true
maxLineLength: 130
ArgumentListWrapping:
active: true
maxLineLength: 130
style:
MaxLineLength:
active: true
maxLineLength: 130
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 06 14:36:24 CET 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ package pl.beavercoding.viewbindingdelegate
import android.view.View
import android.view.ViewGroup
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.*
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withParent
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
Expand All @@ -21,13 +25,13 @@ import org.junit.runner.RunWith

@LargeTest
@RunWith(AndroidJUnit4::class)
class MainActivityTest {
internal class MainActivityTest {

@get:Rule
var mActivityScenarioRule = ActivityScenarioRule(MainActivity::class.java)

@Test
fun mainActivityTest() {
fun basicFlowTestWithCanaryLeakCheck() {
val resources = InstrumentationRegistry.getInstrumentation().targetContext.resources

allOf(
Expand All @@ -37,7 +41,8 @@ class MainActivityTest {

val materialButton = onView(
allOf(
withId(R.id.button), withText("next"),
withId(R.id.button),
withText("next"),
childAtPosition(
childAtPosition(
withId(R.id.nav_host_fragment),
Expand All @@ -52,7 +57,8 @@ class MainActivityTest {

val textView2 = onView(
allOf(
withId(R.id.hello_world), withText(resources.getString(R.string.example_2)),
withId(R.id.hello_world),
withText(resources.getString(R.string.example_2)),
withParent(withParent(withId(R.id.nav_host_fragment))),
isDisplayed()
)
Expand All @@ -61,7 +67,8 @@ class MainActivityTest {

val materialButton2 = onView(
allOf(
withId(R.id.button), withText("next"),
withId(R.id.button),
withText("next"),
childAtPosition(
childAtPosition(
withId(R.id.nav_host_fragment),
Expand All @@ -76,7 +83,8 @@ class MainActivityTest {

val textView3 = onView(
allOf(
withId(R.id.hello_world), withText(resources.getString(R.string.example_3)),
withId(R.id.hello_world),
withText(resources.getString(R.string.example_3)),
withParent(withParent(withId(R.id.nav_host_fragment))),
isDisplayed()
)
Expand All @@ -85,10 +93,7 @@ class MainActivityTest {
LeakAssertions.assertNoLeaks()
}

private fun childAtPosition(
parentMatcher: Matcher<View>, position: Int
): Matcher<View> {

private fun childAtPosition(parentMatcher: Matcher<View>, position: Int): Matcher<View> {
return object : TypeSafeMatcher<View>() {
override fun describeTo(description: Description) {
description.appendText("Child at position $position in parent ")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package pl.beavercoding.viewbindingdelegate

data class Example(
internal data class Example(
val id: Int,
val title: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ internal class ExampleAdapter(
private val onExampleClicked: OnExampleClicked
) : ListAdapter<Example, ExampleAdapter.ExampleViewHolder>(DiffCallback()) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
ExampleViewHolder.create(parent, onExampleClicked)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ExampleViewHolder.create(parent, onExampleClicked)

override fun onBindViewHolder(holder: ExampleViewHolder, position: Int) = holder.bind(getItem(position))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import pl.beavercoding.viewBinder.safeSetAdapter
import pl.beavercoding.viewBinder.viewBinding
import pl.beavercoding.viewbindingdelegate.databinding.FragmentExample1Binding

class ExampleFragment1 : Fragment(R.layout.fragment_example_1) {
internal class ExampleFragment1 : Fragment(R.layout.fragment_example_1) {

private val binding by viewBinding(FragmentExample1Binding::bind)
private val adapter by lazy { ExampleAdapter(::handleExampleClick) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.navigation.fragment.findNavController
import pl.beavercoding.viewBinder.viewBinding
import pl.beavercoding.viewbindingdelegate.databinding.FragmentExample2Binding

class ExampleFragment2 : Fragment(R.layout.fragment_example_2) {
internal class ExampleFragment2 : Fragment(R.layout.fragment_example_2) {

private val binding by viewBinding {
FragmentExample2Binding.bind(it).also { binding ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.fragment.app.Fragment
import pl.beavercoding.viewBinder.viewBinding
import pl.beavercoding.viewbindingdelegate.databinding.FragmentExample3Binding

class ExampleFragment3 : Fragment(R.layout.fragment_example_3) {
internal class ExampleFragment3 : Fragment(R.layout.fragment_example_3) {

private val binding by viewBinding(FragmentExample3Binding::bind)

Expand Down
2 changes: 1 addition & 1 deletion view-binder/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ afterEvaluate {

groupId = "com.github.grzegorzbobryk"
artifactId = "view-binder"
version = "1.0.8"
version = "1.0.9"
}
}
}
Expand Down

0 comments on commit 10ceb4f

Please sign in to comment.