Skip to content

Commit

Permalink
Merge commit 'b272aaa' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Merseyside committed Jul 4, 2023
2 parents 9cbc20e + b272aaa commit 0ba9b23
Show file tree
Hide file tree
Showing 39 changed files with 406 additions and 287 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ on:
jobs:
publish:
name: Release build and publish
runs-on: macos-11
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.17
- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Install Cocoapods
run: gem install cocoapods-generate
# - name: Install Cocoapods
# run: gem install cocoapods-generate

- name: Build and publish to mavenCentral
run: ./gradlew publish
run: ./gradlew publish -PRELEASE_SIGNING_ENABLED=true
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}
3 changes: 1 addition & 2 deletions archy-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ plugins {
plugin(kotlin.kapt)
plugin(android.navigation.args)
}
`javadoc-stub-convention`
`maven-publish-config`
`maven-publish-plugin`
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,9 @@ abstract class VMDialog<Binding : ViewDataBinding, Model : BaseViewModel>
}

override fun performInjection(bundle: Bundle?, vararg params: Any) {
loadKoinModules(getKoinModules(bundle, *params))
viewModel = provideViewModel(bundle, *params)
}

open fun getKoinModules(bundle: Bundle?, vararg params: Any): List<Module> {
return emptyList<Module>().also {
Logger.logInfo("VMFragment", "Empty fragment's koin modules")
}
}

protected open fun provideViewModel(bundle: Bundle?, vararg params: Any): Model {
return viewModelForClass(
clazz = getViewModelClass(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class VMEventsFragment<Binding : ViewDataBinding, Model, Listener> :
}

override fun performInjection(bundle: Bundle?, vararg params: Any) {
super.performInjection(bundle, *params, eventsDispatcherOnMain<EventsDispatcher<Listener>>())
super.performInjection(bundle, eventsDispatcherOnMain<EventsDispatcher<Listener>>(), *params)
}

override fun onAlert(alert: Alert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import android.view.View
import androidx.databinding.ViewDataBinding
import com.merseyside.archy.presentation.fragment.BaseBindingFragment
import com.merseyside.merseyLib.archy.core.presentation.viewModel.BaseViewModel
import com.merseyside.merseyLib.kotlin.logger.Logger
import com.merseyside.utils.reflection.ReflectionUtils
import org.koin.core.context.loadKoinModules
import org.koin.core.module.Module
import kotlin.reflect.KClass

abstract class VMFragment<Binding : ViewDataBinding, Model : BaseViewModel>
Expand All @@ -32,14 +29,9 @@ abstract class VMFragment<Binding : ViewDataBinding, Model : BaseViewModel>
}

override fun performInjection(bundle: Bundle?, vararg params: Any) {
loadKoinModules(getKoinModules(bundle, *params))
viewModel = provideViewModel(getViewModelClass(), bundle, *params)
}

open fun getKoinModules(bundle: Bundle?, vararg params: Any): List<Module> {
return emptyList<Module>().also { Logger.logInfo("$this", "Empty fragment's koin modules") }
}

protected abstract fun provideViewModel(
clazz: KClass<Model>,
bundle: Bundle?,
Expand Down
3 changes: 1 addition & 2 deletions archy-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ plugins {
plugin(moko.multiplatform)
plugin(sqldelight)
}
`javadoc-stub-convention`
`maven-publish-config`
`maven-publish-plugin`
}

android {
Expand Down
25 changes: 0 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
plugins {
`nexus-config`
}

allprojects {
plugins.withId("org.gradle.maven-publish") {
group = "io.github.merseyside"
version = multiplatformLibs.versions.mersey.kmm.get()
}
}

buildscript { // disable pod install tasks until find a solution
repositories {
gradlePluginPortal()
}

if (!isBuildIos()) {
with(project.gradle.startParameter.excludedTaskNames) {
add("podImport")
add("podInstall")
add("podGenIOS")
// add("podSetupBuildReachabilityIphoneos")
// add("podSetupBuildReachabilityIphonesimulator")
// add("podBuildReachabilityIphoneos")
// add("podBuildReachabilityIphonesimulator")
// add("cinteropReachabilityIosX64")
// add("cinteropReachabilityIosSimulatorArm64")
// add("cinteropReachabilityIosArm64")
}
}
}

tasks.register("clean", Delete::class).configure {
group = "build"
delete(rootProject.buildDir)
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation(kotlin.gradle)
implementation(kotlin.serialization)
implementation(moko.resourcesGenerator)
implementation(nexusPublish)
implementation(android.navigation.safeArgs)
implementation(maven.publish.plugin)
}
}
2 changes: 1 addition & 1 deletion buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencyResolutionManagement {
gradlePluginPortal()
}

val catalogVersions = "1.7.3"
val catalogVersions = "1.7.5"
val group = "io.github.merseyside"
versionCatalogs {

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object Application {
const val applicationId = "com.merseyside.sample"

const val compileSdk = 33
const val targetSdk = 33
const val compileSdk = 34
const val targetSdk = 34
const val minSdk = 21
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("com.vanniktech.maven.publish")
}

mavenPublishing {
val projectGitUrl = "https://github.com/Merseyside/mersey-kmp-library"

pom {
name.set("Mersey kotlin multiplatform library")
description.set("Library contains useful tools for kotlin multiplatform development")
url.set("https://github.com/Merseyside/mersey-kmp-library")

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("Merseyside")
name.set("Ivan Sablin")
email.set("[email protected]")
}
}

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}

issueManagement {
system.set("GitHub")
url.set("$projectGitUrl/issues")
}

scm {
connection.set("scm:git:$projectGitUrl")
developerConnection.set("scm:git:$projectGitUrl")
url.set(projectGitUrl)
}
}

publishToMavenCentral(SonatypeHost.S01)
}

15 changes: 0 additions & 15 deletions buildSrc/src/main/kotlin/publication/nexus-config.gradle.kts

This file was deleted.

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 @@
#Thu Feb 04 15:25:14 NOVT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-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 @@ -15,7 +15,8 @@ class MainActivity : BaseBindingActivity<ActivityMainBinding>() {

override fun getFragmentContainer() = null
override fun getLayoutId() = R.layout.activity_main
override fun getToolbar() = null
override fun getMainToolbar() = null

override fun performInjection(bundle: Bundle?, vararg params: Any) {}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ package com.merseyside.sample.view.fragment.view

import android.content.Context
import android.os.Bundle
import androidx.lifecycle.SavedStateHandle
import com.merseyside.merseyLib.archy.android.presentation.fragment.VMEventsFragment
import com.merseyside.merseyLib.kotlin.logger.log
import com.merseyside.merseyLib.utils.core.koin.androidx.viewmodel.ext.android.getViewModel
import com.merseyside.merseyLib.utils.core.koin.savedState.scope.declareStateProvider
import com.merseyside.merseyLib.utils.core.koin.scope.fragment.fragmentScope
import com.merseyside.sample.BR
import com.merseyside.sample.R
import com.merseyside.sample.databinding.FragmentKoinStateBinding
import com.merseyside.sample.view.fragment.di.koinStateModule
import com.merseyside.sample.viewModel.KoinStateViewModel
import org.koin.android.scope.AndroidScopeComponent
import org.koin.androidx.scope.fragmentScope
import org.koin.core.module.Module
import org.koin.core.parameter.parametersOf
import org.koin.core.scope.Scope
import kotlin.reflect.KClass
Expand All @@ -23,7 +20,7 @@ class KoinStateFragment : VMEventsFragment<FragmentKoinStateBinding, KoinStateVi
KoinStateViewModel.KoinStateEventsListener>(), AndroidScopeComponent,
KoinStateViewModel.KoinStateEventsListener {

override val scope: Scope by fragmentScope()
override val scope: Scope by fragmentScope { listOf(koinStateModule) }

override fun onAttach(context: Context) {
super.onAttach(context)
Expand All @@ -34,10 +31,6 @@ class KoinStateFragment : VMEventsFragment<FragmentKoinStateBinding, KoinStateVi
override fun getTitle(context: Context) = null
override fun getBindingVariable() = BR.viewModel

override fun getKoinModules(bundle: Bundle?, vararg params: Any): List<Module> {
return listOf(koinStateModule)
}

override fun provideViewModel(
clazz: KClass<KoinStateViewModel>,
bundle: Bundle?,
Expand Down
4 changes: 2 additions & 2 deletions sample/ios-app/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- mpp_library (1.5.2)
- mpp_library (1.5.4)
- Reachability (3.2)

DEPENDENCIES:
Expand All @@ -15,7 +15,7 @@ EXTERNAL SOURCES:
:path: "../mpp-library"

SPEC CHECKSUMS:
mpp_library: 5a0cdfe968d914d6bd4816266d35966ef938f4bf
mpp_library: f565f95b31a5b7b1baaa6be71d2356897deff6c7
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96

PODFILE CHECKSUM: 984fdf42b2cd57b5e14197719552245436d87e71
Expand Down
4 changes: 2 additions & 2 deletions sample/ios-app/Pods/Local Podspecs/mpp_library.podspec.json

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

Loading

0 comments on commit 0ba9b23

Please sign in to comment.