Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
distribution: 'zulu'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
- name: "Build project & run tests"
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: "Verify publishing"
uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
.idea
/local.properties
.DS_Store
/build
build
/captures
.externalNativeBuild
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

### Pending changes

No pending changes
#### Additions

([#162](https://github.com/badoo/MVICore/pull/162)):
Updated Kotlin to 1.6.21 (the plan is to update to 1.7.x fairly soon)

### 1.3.1

Expand Down
38 changes: 5 additions & 33 deletions binder/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'

group = 'com.github.badoo.mvicore'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$rootProject.ext.kotlinVersion"
}
}

repositories {
jcenter()
plugins {
id 'java'
id 'mvi-core-publish-java'
id 'kotlin'
id 'org.jetbrains.dokka'
}

dependencies {
Expand All @@ -38,18 +25,3 @@ compileKotlin {
jvmTarget = JavaVersion.VERSION_1_8
}
}

task packageSources(type: Jar, dependsOn: 'classes') {
classifier = 'sources'
from sourceSets.main.allSource
}

task packageJavadoc(type: Jar, dependsOn: javadoc) {
from javadoc.outputDirectory
classifier = 'javadoc'
}

artifacts {
archives packageSources
archives packageJavadoc
}
23 changes: 8 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlinVersion = '1.3.72'
ext.kotlinVersion = '1.6.21'

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.0"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// TODO: Dokka 1.6.21 fails when running publishToMavenLocal. Try aligning with Kotlin version after we upgrade to 1.7.x
// Downgrade was suggested here: https://github.com/Kotlin/dokka/issues/2452
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -30,13 +31,13 @@ ext {
rxAndroidVersion = '2.1.1'

// DI
daggerVersion = '2.29.1'
daggerVersion = '2.43.2'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dagger and glide had issues with kapt, so I had to update them


// Utils
debugDrawerVersion = '0.9.0'
timberVersion = '4.7.1'
scalpelVersion = '1.1.2'
glideVersion = '4.11.0'
glideVersion = '4.13.2'

// Network
okhttpVersion = '3.10.0'
Expand Down Expand Up @@ -111,14 +112,6 @@ ext {
}
}

allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
5 changes: 5 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jdk:
- openjdk11
install:
- echo "Building artifacts"
- ./gradlew clean publishToMavenLocal
42 changes: 8 additions & 34 deletions mvicore-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.github.dcendents.android-maven'
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'mvi-core-publish-android'
}

group='com.github.badoo.mvicore'

android {
compileSdkVersion 30
compileSdkVersion 31
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to dagger caused the compile target to no longer be acceptable

defaultConfig {
minSdkVersion 15
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -51,31 +53,3 @@ dependencies {

implementation project(":mvicore")
}

buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$rootProject.ext.kotlinVersion"
}
}

repositories {
jcenter()
}

sourceSets {
main {
java {}
}
}

task packageSources(type: Jar, dependsOn: 'classes') {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives packageSources
}
39 changes: 8 additions & 31 deletions mvicore-debugdrawer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.github.dcendents.android-maven'
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'mvi-core-publish-android'
}

group='com.github.badoo.mvicore'

android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -53,28 +55,3 @@ dependencies {

implementation project(':mvicore')
}

buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$rootProject.ext.kotlinVersion"
}
}

sourceSets {
main {
java {}
}
}

task packageSources(type: Jar, dependsOn: 'classes') {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives packageSources
}
17 changes: 11 additions & 6 deletions mvicore-demo/mvicore-demo-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}

android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
applicationId "com.badoo.mvicoredemo"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"

Expand All @@ -30,6 +31,10 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

buildFeatures {
viewBinding true
}
}

dependencies {
Expand Down
12 changes: 8 additions & 4 deletions mvicore-demo/mvicore-demo-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
android:theme="@style/AppTheme">

<activity
android:name=".ui.launcher.LauncherActivity">
android:name=".ui.launcher.LauncherActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -29,15 +30,18 @@

<activity
android:name=".ui.login.LoginActivity"
android:theme="@style/AppTheme" />
android:theme="@style/AppTheme"
android:exported="false" />

<activity
android:name=".ui.main.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:exported="false" />

<activity
android:name=".ui.lifecycle.LifecycleDemoActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar"
android:exported="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ import com.badoo.binder.named
import com.badoo.mvicore.android.lifecycle.CreateDestroyBinderLifecycle
import com.badoo.mvicore.android.lifecycle.ResumePauseBinderLifecycle
import com.badoo.mvicore.android.lifecycle.StartStopBinderLifecycle
import com.badoo.mvicoredemo.R
import com.badoo.mvicoredemo.databinding.ActivityLifecycleDemoBinding
import init
import io.reactivex.functions.Consumer
import io.reactivex.subjects.PublishSubject
import kotlinx.android.synthetic.main.activity_main.drawerLayout
import kotlinx.android.synthetic.main.activity_main.navigationView
import kotlinx.android.synthetic.main.activity_main.toolbar

class LifecycleDemoActivity : AppCompatActivity() {

private val events = PublishSubject.create<String>()
private val dummyConsumer = Consumer<String> {
Log.d("LifecycleDemo", it)
}
private lateinit var binding: ActivityLifecycleDemoBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_lifecycle_demo)
binding = ActivityLifecycleDemoBinding.inflate(layoutInflater)
setContentView(binding.root)

Binder(CreateDestroyBinderLifecycle(lifecycle))
.bind(events to dummyConsumer named "Lifecycle#CreateDestroy")
Expand All @@ -43,15 +42,15 @@ class LifecycleDemoActivity : AppCompatActivity() {
}

private fun setupDrawer() {
setSupportActionBar(toolbar)
setSupportActionBar(binding.toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
navigationView.init(drawerLayout, 1)
binding.navigationView.init(binding.drawerLayout, 1)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
android.R.id.home -> {
drawerLayout.openDrawer(GravityCompat.START)
binding.drawerLayout.openDrawer(GravityCompat.START)
true
}
else -> super.onOptionsItemSelected(item)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.badoo.mvicoredemo.ui.login

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.badoo.mvicoredemo.R
import com.badoo.mvicoredemo.auth.login
import kotlinx.android.synthetic.main.activity_login.signIn

class LoginActivity : AppCompatActivity() {

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

signIn.setOnClickListener { login() }
findViewById<View>(R.id.signIn).setOnClickListener { login() }
}
}
Loading