Skip to content

Commit

Permalink
Merge pull request #281 from LouisCAD/main
Browse files Browse the repository at this point in the history
Prepare for release 3.0.0-beta04
  • Loading branch information
LouisCAD authored Jul 31, 2021
2 parents 08935f7 + 4d8b4c3 commit 265fba3
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .idea/copyright/Louis_CAD_Apache_2.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/copyright/profiles_settings.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,5 +1,13 @@
# Change log for Splitties

## Version 3.0.0-beta04 (2021-07-30)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.

### Fix

Fix iOS/multiplatform publication (see [issue #280](https://github.com/LouisCAD/Splitties/issues/280)).

## Version 3.0.0-beta03 (2021-07-17)

Compiled with Kotlin 1.5.21 and kotlinx.coroutines 1.5.1-native-mt.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Includes the following modules:
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta04")
```

There's also a version with Views DSL. It additionally includes the following modules:
Expand All @@ -249,7 +249,7 @@ There's also a version with Views DSL. It additionally includes the following mo
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-base-with-views-dsl:3.0.0-beta04")
```

#### Android AppCompat
Expand All @@ -263,7 +263,7 @@ These 2 packs include the [Android base](#android-base) pack, and the following
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-appcompat:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-appcompat:3.0.0-beta04")
```

There's also a version with Views DSL. It additionally includes the Views DSL version of the
Expand All @@ -273,7 +273,7 @@ There's also a version with Views DSL. It additionally includes the Views DSL ve
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-appcompat-with-views-dsl:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-appcompat-with-views-dsl:3.0.0-beta04")
```

#### Android Material Components
Expand All @@ -289,7 +289,7 @@ These 2 packs include the [Android AppCompat](#android-appcompat) pack, and the
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-material-components:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-material-components:3.0.0-beta04")
```

There's also a version with Views DSL. It additionally includes the Views DSL version of the
Expand All @@ -300,7 +300,7 @@ There's also a version with Views DSL. It additionally includes the Views DSL ve
Gradle dependency:

```kotlin
implementation("com.louiscad.splitties:splitties-fun-pack-android-material-components-with-views-dsl:3.0.0-beta03")
implementation("com.louiscad.splitties:splitties-fun-pack-android-material-components-with-views-dsl:3.0.0-beta04")
```

#### All the artifacts (47)
Expand All @@ -311,7 +311,7 @@ into your root project `build.gradle` file:
```groovy
allProjects {
ext {
splitties_version = "3.0.0-beta03"
splitties_version = "3.0.0-beta04"
}
}
```
Expand Down
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2019-2021 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("SpellCheckingInspection")
Expand All @@ -19,6 +19,10 @@ plugins {
id("com.osacky.doctor")
}

doctor {
disallowCleanTaskDependencies.set(false)
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.

allprojects {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2019-2021 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("PackageDirectoryMismatch")
Expand All @@ -8,5 +8,8 @@ import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.project
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler

fun DependencyHandler.splitties(splitName: String) = project(":modules:$splitName")
fun KotlinDependencyHandler.splitties(splitName: String) = project(":modules:$splitName")
fun DependencyHandler.splitties(splitName: String) = project(":modules:splitties-$splitName")
fun KotlinDependencyHandler.splitties(splitName: String) = project(":modules:splitties-$splitName")

fun DependencyHandler.splittiesFunPack(funPackName: String) = project(":fun-packs:splitties-fun-pack-$funPackName")
fun KotlinDependencyHandler.splittiesFunPack(funPackName: String) = project(":fun-packs:splitties-fun-pack-$funPackName")
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@

@file:Suppress("PackageDirectoryMismatch")

import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.androidJvm
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.common
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.js
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.jvm
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.native
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
import java.util.Locale

fun KotlinTarget.configureMavenPublication(
publishReleaseVariantOnly: Boolean = false
Expand All @@ -23,18 +17,7 @@ fun KotlinTarget.configureMavenPublication(
}
val isInMultiplatformModule = project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")
if (isInMultiplatformModule.not()) return // The mavenPublication block would not be run anyway.
val suffix = when (platformType) {
common -> "-metadata"
jvm -> "-jvm"
js -> "-js"
androidJvm -> "-android"
native -> "-${name.toLowerCase(Locale.ROOT)}"
}
mavenPublication {
val prefix = if (project.isFunPack) "splitties-fun-pack" else "splitties"
project.afterEvaluate {
artifactId = "$prefix-${project.name}$suffix"
}
if (publishReleaseVariantOnly && platformType == androidJvm) {
// We disable metadata generation for Android publications, so the release variants can
// be used for any buildType of the consumer projects without having to specify
Expand All @@ -56,5 +39,3 @@ fun KotlinTarget.configureMavenPublication(
}
}
}

val Project.isFunPack: Boolean get() = parent?.name == "fun-packs"
6 changes: 0 additions & 6 deletions buildSrc/src/main/kotlin/publishing/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ publishing {
artifact(project.tasks.emptyJavadocJar())
setupPom()
}
mavenPublications.findByName("kotlinMultiplatform")?.let {
val prefix = if (project.isFunPack) "splitties-fun-pack" else "splitties"
project.afterEvaluate {
it.artifactId = "$prefix-${project.name}"
}
}
repositories {
mavenCentralStaging(
project = project,
Expand Down
2 changes: 1 addition & 1 deletion docs/DocsCopier.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ val docsDir = projectDir.resolve("docs")
// Regex inspired by http://blog.michaelperrin.fr/2019/02/04/advanced-regular-expressions/
// If needed, look at the article again to support nested brackets (not needed so far).
//language=RegExp
val linksRegex = """\[(?<text>.+)\]\((?<url>[^) ]+)(?: \"(?<title>.+)\")?\)""".toRegex()
val linksRegex = """\[(?<text>.+)\]\((?<url>[^) ]+)(?: "(?<title>.+)")?\)""".toRegex()
val gitMainBranchUrl = "https://github.com/LouisCAD/Splitties/tree/main"

suspend fun readTextWithAdaptationForMkDocs(sourceFile: File): String = Dispatchers.Default {
Expand Down
4 changes: 2 additions & 2 deletions fun-packs/android-appcompat-with-views-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ kotlin {
configure(targets) { configureMavenPublication() }
sourceSets {
androidMain.dependencies {
api(project(":fun-packs:android-appcompat"))
api(project(":fun-packs:android-base-with-views-dsl"))
api(splittiesFunPack("android-appcompat"))
api(splittiesFunPack("android-base-with-views-dsl"))
api(splitties("views-dsl-appcompat"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion fun-packs/android-appcompat/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kotlin {
configure(targets) { configureMavenPublication() }
sourceSets {
androidMain.dependencies {
api(project(":fun-packs:android-base"))
api(splittiesFunPack("android-base"))
listOf(
"alertdialog-appcompat",
"alertdialog-appcompat-coroutines",
Expand Down
2 changes: 1 addition & 1 deletion fun-packs/android-base-with-views-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kotlin {
configure(targets) { configureMavenPublication() }
sourceSets {
androidMain.dependencies {
api(project(":fun-packs:android-base"))
api(splittiesFunPack("android-base"))
listOf(
"views-dsl",
"views-dsl-constraintlayout",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ kotlin {
configure(targets) { configureMavenPublication() }
sourceSets {
androidMain.dependencies {
api(project(":fun-packs:android-material-components"))
api(project(":fun-packs:android-appcompat-with-views-dsl"))
api(splittiesFunPack("android-material-components"))
api(splittiesFunPack("android-appcompat-with-views-dsl"))
listOf(
"views-dsl-coordinatorlayout",
"views-dsl-material"
Expand Down
2 changes: 1 addition & 1 deletion fun-packs/android-material-components/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kotlin {
configure(targets) { configureMavenPublication() }
sourceSets {
androidMain.dependencies {
api(project(":fun-packs:android-appcompat"))
api(splittiesFunPack("android-appcompat"))
listOf(
"alertdialog-material",
"material-lists",
Expand Down
2 changes: 1 addition & 1 deletion libraries_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0-beta03
3.0.0-beta04
2 changes: 1 addition & 1 deletion samples/android-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ kotlin {
api(Kotlin.stdlib.common)
}
androidMain.dependencies {
implementation(project(":fun-packs:android-material-components-with-views-dsl"))
implementation(splittiesFunPack("android-material-components-with-views-dsl"))
arrayOf(
"arch-lifecycle",
"arch-room",
Expand Down
24 changes: 17 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ include {
"samples" {
"android-app"()
}
"fun-packs" {
"fun-packs"(childrenPrefix = "splitties-fun-pack-") {
"android-base"()
"android-base-with-views-dsl"()
"android-appcompat"()
Expand All @@ -47,7 +47,7 @@ include {

if (checkPublication) "tools" { "publication-checker"() }

"modules" {
"modules"(childrenPrefix = "splitties-") {
"activities"()
"alertdialog"()
"alertdialog-appcompat"()
Expand Down Expand Up @@ -104,18 +104,28 @@ include {
//region include DSL
class ModuleParentScope(
private val name: String,
private val parent: ModuleParentScope? = null
private val parent: ModuleParentScope? = null,
private val prefix: String
) {

operator fun String.invoke(block: (ModuleParentScope.() -> Unit)? = null) {
operator fun String.invoke(
childrenPrefix: String = "",
block: (ModuleParentScope.() -> Unit)? = null
) {
check(startsWith(':').not())
val moduleName = ":$this"
val projectName = "$parentalPath$moduleName"
include(projectName)
if (prefix.isNotEmpty()) {
project(projectName).let {
it.name = "$prefix${it.name}"
}
}
block?.let { buildNode ->
ModuleParentScope(
name = moduleName,
parent = this@ModuleParentScope
parent = this@ModuleParentScope,
prefix = childrenPrefix
).buildNode()
}
}
Expand All @@ -126,7 +136,7 @@ class ModuleParentScope(

}

inline fun include(block: ModuleParentScope.() -> Unit) {
ModuleParentScope("").block()
inline fun include(prefix: String = "", block: ModuleParentScope.() -> Unit) {
ModuleParentScope(name = "", prefix = prefix).block()
}
//endregion
4 changes: 2 additions & 2 deletions tools/publication-checker/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ kotlin {
val sourceSet: KotlinSourceSet = target.mainSourceSet
if (splitTargets.any { it.targetsSamePlatformAs(target) }) {
sourceSet.dependencies {
implementation("$group:splitties-${project.name}") {
implementation("$group:${project.name}") {
version { strictly(version) }
}
}
Expand All @@ -93,7 +93,7 @@ kotlin {
val sourceSet: KotlinSourceSet = target.mainSourceSet
if (splitTargets.any { it.targetsSamePlatformAs(target) }) {
sourceSet.dependencies {
implementation("$group:splitties-fun-pack-${project.name}") {
implementation("$group:${project.name}") {
version { strictly(version) }
}
}
Expand Down
15 changes: 12 additions & 3 deletions versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ plugin.android=4.2.2
## # available=7.0.0-beta03
## # available=7.0.0-beta04
## # available=7.0.0-beta05
## # available=7.0.0-rc01
## # available=7.0.0
## # available=7.1.0-alpha01
## # available=7.1.0-alpha02
## # available=7.1.0-alpha03
## # available=7.1.0-alpha04
## # available=7.1.0-alpha05

plugin.com.osacky.doctor=0.7.0
plugin.com.osacky.doctor=0.7.1

version.androidx.annotation=1.2.0
## # available=1.3.0-alpha01

version.androidx.appcompat=1.3.0
version.androidx.appcompat=1.3.1
## # available=1.4.0-alpha01
## # available=1.4.0-alpha02
## # available=1.4.0-alpha03
Expand Down Expand Up @@ -68,17 +72,19 @@ version.androidx.constraintlayout=1.1.3
## # available=2.1.0-alpha2
## # available=2.1.0-beta01
## # available=2.1.0-beta02
## # available=2.1.0-rc01

version.androidx.coordinatorlayout=1.1.0

version.androidx.core=1.6.0
## # available=1.7.0-alpha01

version.androidx.fragment=1.3.5
version.androidx.fragment=1.3.6
## # available=1.4.0-alpha01
## # available=1.4.0-alpha02
## # available=1.4.0-alpha03
## # available=1.4.0-alpha04
## # available=1.4.0-alpha05

version.androidx.lifecycle=2.3.1
## # available=2.4.0-alpha01
Expand All @@ -90,10 +96,12 @@ version.androidx.room=2.3.0
## # available=2.4.0-alpha01
## # available=2.4.0-alpha02
## # available=2.4.0-alpha03
## # available=2.4.0-alpha04

version.androidx.startup=1.0.0
## # available=1.1.0-alpha01
## # available=1.1.0-beta01
## # available=1.1.0-rc01

version.androidx.test=1.4.0

Expand All @@ -111,6 +119,7 @@ version.google.android.material=1.4.0
## # available=1.5.0-alpha01

version.kotlin=1.5.21
## # available=1.5.30-M1

version.kotlinx.coroutines=1.5.1-native-mt
## # available=1.5.1
Expand Down

0 comments on commit 265fba3

Please sign in to comment.