Skip to content

Commit

Permalink
3.1.0-beta02 (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 authored Nov 6, 2024
2 parents 80ea0a5 + 9496555 commit 5809cfa
Show file tree
Hide file tree
Showing 78 changed files with 1,209 additions and 402 deletions.
2 changes: 1 addition & 1 deletion .github/changelog_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"label_extractor" : [
{
"pattern" : "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"pattern" : "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|feat!|breaking|api){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"target" : "$1"
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: cp ./README.md ./docs/README.md

- name: Generate docs
run: ./gradlew :dokkaHtmlMultiModule --no-configuration-cache
run: ./gradlew :dokkaGenerateHtml

- name: Move docs to the parent docs dir
run: cp -r ./build/dokka/htmlMultiModule/ ./docs/javadocs/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ hs_err_pid*
**/plugin_encrypted_key.pem
**/plugin_rsa_private_key.pem
**/.cache
/.intellijPlatform/
3 changes: 1 addition & 2 deletions .idea/inspectionProfiles/Project_Default.xml

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

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

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

24 changes: 24 additions & 0 deletions .idea/runConfigurations/Plugin___run_ide.xml

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

24 changes: 24 additions & 0 deletions .idea/runConfigurations/Plugin___sign__for_release_.xml

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

25 changes: 25 additions & 0 deletions .idea/runConfigurations/Plugin___verify.xml

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

39 changes: 31 additions & 8 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
plugins {
id("pro.respawn.android-library")
id(libs.plugins.kotlinMultiplatform.id)
id(libs.plugins.androidLibrary.id)
alias(libs.plugins.maven.publish)
dokkaDocumentation
}

kotlin {
configureMultiplatform(
ext = this,
jvm = true,
android = true,
iOs = true,
macOs = true,
watchOs = false,
tvOs = false,
windows = false,
linux = true,
js = true,
wasmJs = true,
wasmWasi = false,
)

sourceSets.androidMain.dependencies {
api(libs.kotlin.coroutines.android)
api(libs.androidx.fragment)
api(libs.androidx.activity)
}
}

android {
namespace = "${Config.artifactId}.android"
configureAndroidLibrary(this)
namespace = "${Config.namespace}.android"
}

dependencies {
api(projects.core)
// api(libs.lifecycle.runtime)
// api(libs.lifecycle.viewmodel)
api(libs.kotlin.coroutines.android)
implementation(libs.androidx.fragment)
implementation(libs.androidx.activity)
commonMainApi(projects.core)
commonMainApi(libs.lifecycle.runtime)
commonMainApi(libs.lifecycle.viewmodel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import pro.respawn.flowmvi.api.MVIState
import pro.respawn.flowmvi.api.StateConsumer
import pro.respawn.flowmvi.api.Store
import pro.respawn.flowmvi.dsl.subscribe
import kotlin.jvm.JvmName

/**
* Subscribe to the [store] lifecycle-aware.
Expand Down
32 changes: 16 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import nl.littlerobots.vcu.plugin.versionCatalogUpdate
Expand All @@ -13,9 +15,8 @@ plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.gradleDoctor)
alias(libs.plugins.version.catalog.update)
alias(libs.plugins.dokka)
alias(libs.plugins.atomicfu)
alias(libs.plugins.dependencyAnalysis)
// alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.serialization) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.maven.publish) apply false
Expand Down Expand Up @@ -46,6 +47,13 @@ subprojects {
afterEvaluate {
extensions.findByType<MavenPublishBaseExtension>()?.run {
val isReleaseBuild = properties["release"]?.toString().toBoolean()
configure(
KotlinMultiplatform(
javadocJar = JavadocJar.Empty(),
sourcesJar = true,
androidVariantsToPublish = listOf("release"),
)
)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, false)
if (isReleaseBuild) signAllPublications()
coordinates(Config.artifactId, name, Config.version(isReleaseBuild))
Expand Down Expand Up @@ -81,13 +89,6 @@ subprojects {
filter { isFailOnNoMatchingTests = true }
}
}
// TODO: Migrate to applying dokka plugin per-project in conventions
if (name in setOf("sample", "debugger", "server")) return@subprojects
apply(plugin = rootProject.libs.plugins.dokka.id)

dependencies {
dokkaPlugin(rootProject.libs.dokka.android)
}
}

doctor {
Expand All @@ -98,12 +99,12 @@ doctor {
ensureJavaHomeMatches.set(false)
}
}

dependencyAnalysis {
structure {
ignoreKtx(true)
}
}
//
// dependencyAnalysis {
// structure {
// ignoreKtx(true)
// }
// }

dependencies {
detektPlugins(rootProject.libs.detekt.formatting)
Expand All @@ -127,7 +128,6 @@ atomicfu {
dependenciesVersion = libs.versions.kotlinx.atomicfu.get()
transformJvm = true
jvmVariant = "VH"
transformJs = true
}

tasks {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
dependencies {
implementation(libs.android.gradle)
implementation(libs.kotlin.gradle)
implementation(libs.dokka.gradle)
}
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object Config {
const val majorRelease = 3
const val minorRelease = 1
const val patch = 0
const val postfix = "-beta01" // include dash (-)
const val postfix = "-beta02" // include dash (-)
const val majorVersionName = "$majorRelease.$minorRelease.$patch"
const val versionName = "$majorVersionName$postfix"
const val url = "https://github.com/respawn-app/FlowMVI"
Expand All @@ -28,6 +28,7 @@ object Config {
const val licenseName = "The Apache Software License, Version 2.0"
const val licenseUrl = "https://www.apache.org/licenses/LICENSE-2.0.txt"
const val scmUrl = "https://github.com/respawn-app/FlowMVI.git"
const val docsUrl = "https://opensource.respawn.pro/FlowMVI/#/"
const val description = """A Kotlin Multiplatform MVI library based on coroutines with a powerful plugin system"""
const val supportEmail = "[email protected]"
const val vendorName = "Respawn Open Source Team"
Expand Down Expand Up @@ -76,7 +77,7 @@ object Config {
val jvmTarget = JvmTarget.JVM_11
val idePluginJvmTarget = JvmTarget.JVM_17
val javaVersion = JavaVersion.VERSION_11
const val compileSdk = 34
const val compileSdk = 35
const val targetSdk = compileSdk
const val minSdk = 21
const val appMinSdk = 26
Expand Down
10 changes: 6 additions & 4 deletions buildSrc/src/main/kotlin/ConfigureMultiplatform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.getting
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinHierarchyBuilder
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

@OptIn(ExperimentalWasmDsl::class, ExperimentalKotlinGradlePluginApi::class)
@OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalWasmDsl::class)
fun Project.configureMultiplatform(
ext: KotlinMultiplatformExtension,
jvm: Boolean = true,
Expand All @@ -21,7 +21,7 @@ fun Project.configureMultiplatform(
watchOs: Boolean = true,
windows: Boolean = true,
wasmJs: Boolean = true,
wasmWasi: Boolean = false, // TODO: Coroutines do not support wasmWasi yet
wasmWasi: Boolean = true,
configure: KotlinHierarchyBuilder.Root.() -> Unit = {},
) = ext.apply {
val libs by versionCatalog
Expand Down Expand Up @@ -49,7 +49,9 @@ fun Project.configureMultiplatform(
binaries.library()
}

if (wasmWasi) wasmWasi()
if (wasmWasi) wasmWasi {
nodejs()
}

if (android) androidTarget {
publishLibraryVariants("release")
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ fun Config.version(isRelease: Boolean) = buildString {
append(versionName)
if (!isRelease) append("-SNAPSHOT")
}

fun Project.namespaceByPath() = "${Config.namespace}.${path.replace(":", ".").removePrefix(".")}"
38 changes: 38 additions & 0 deletions buildSrc/src/main/kotlin/dokkaDocumentation.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier

plugins {
id("org.jetbrains.dokka")
// id("org.jetbrains.dokka-javadoc")
}

val libs by versionCatalog

dokka {
dokkaGeneratorIsolation = ClassLoaderIsolation()
moduleName = project.name
moduleVersion = project.version.toString()
pluginsConfiguration.html {
footerMessage = "© ${Config.vendorName}"
customAssets.from(rootDir.resolve("docs/images/icon-512-maskable.png"))
homepageLink = Config.url
}
dokkaPublications.configureEach {
suppressInheritedMembers = false
suppressObviousFunctions = true
}
dokkaSourceSets.configureEach {
reportUndocumented = false
enableJdkDocumentationLink = true
enableAndroidDocumentationLink = true
enableKotlinStdLibDocumentationLink = true
skipEmptyPackages = true
skipDeprecated = true
jdkVersion = Config.javaVersion.majorVersion.toInt()
documentedVisibilities(VisibilityModifier.Public)
}
// remoteUrl = Config.docsUrl
}

dependencies {
dokkaPlugin(libs.requireLib("dokka-android"))
}
2 changes: 2 additions & 0 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.maven.publish)
dokkaDocumentation
}

android {
Expand All @@ -30,6 +31,7 @@ kotlin {
linux = false,
js = true,
wasmJs = true,
wasmWasi = false,
windows = false,
)
sourceSets {
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

// TODO: https://github.com/kotest/kotest/issues/3598
// alias(libs.plugins.kotest)
dokkaDocumentation
}

android {
Expand Down
Loading

0 comments on commit 5809cfa

Please sign in to comment.