Skip to content

Commit

Permalink
Remove timestamp and clean up version manager
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Sep 19, 2023
1 parent 606f5a7 commit 05c9233
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android.useAndroidX=true
org.gradle.jvmargs=-Xmx2g

GROUP=co.touchlab.faktory
VERSION_NAME=0.5.1-SNAPSHOT
VERSION_NAME=0.5.1-alpha1
KOTLIN_VERSION=1.8.22

POM_URL=https://github.com/touchlab/KMMBridge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import co.touchlab.faktory.dependencymanager.DependencyManager
import co.touchlab.faktory.dependencymanager.SpecRepo
import co.touchlab.faktory.dependencymanager.SpmDependencyManager
import co.touchlab.faktory.versionmanager.ManualVersionManager
import co.touchlab.faktory.versionmanager.TimestampVersionManager
import co.touchlab.faktory.versionmanager.VersionManager
import co.touchlab.faktory.localdevmanager.LocalDevManager
import org.gradle.api.Project
Expand Down Expand Up @@ -76,11 +75,6 @@ interface KmmBridgeExtension {
artifactManager.setAndFinalize(MavenPublishArtifactManager(this, publication, repository))
}

@Suppress("unused")
fun timestampVersions() {
versionManager.setAndFinalize(TimestampVersionManager)
}

@Suppress("unused")
fun manualVersions() {
versionManager.setAndFinalize(ManualVersionManager)
Expand Down

This file was deleted.

16 changes: 14 additions & 2 deletions website/docs/PORTING_0.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,28 @@ An explicit setting of `versionPrefix` in the plugin config should be removed. B

### VersionWriter and VersionManager

The original KMMBridge had `VersionManager` and `VersionWriter`. These interfaces were responsible for finding and incrementing versions, and for "writing" them. Since KMMBridge is no longer managing versions, these are redundant. As mentioned above, KMMBridge was managing a lot of git commands internally, and all of that is driven by versions. Moving that to CI makes KMMBridge much simpler, and is much easier to reason about and customize.
The original KMMBridge had `VersionManager` and `VersionWriter`. These interfaces were responsible for finding and incrementing versions, and for "writing" them. Since KMMBridge is no longer managing versions, these are redundant. As mentioned above, KMMBridge was managing a lot of git commands internally, and all of that was driven by version management. Moving that to CI makes KMMBridge much simpler, and is much easier to reason about and customize.

As a result, the following functions no longer exist in the KMMBridge config block:

* `gitTagVersions()`
* `githubReleaseVersions()`
* `githubEnterpriseReleaseVersions()`
* `noGitOperations()`
* `timestampVersions()`

`VersionManager` still exists, but it's role has been reduced, and it may be removed entirely at some point.
`VersionManager` still exists, but it's role has been reduced. KMMBridge will take the `version` property from Gradle and use that for it's version in publishing. If you would like some other method of calculating a version string, implement `VersionManager` and set it with the following:

```kotlin
object MyVersionManager : VersionManager {
override fun getVersion(project: Project): String = "0.1.${System.currentTimeMillis()}"
}

kmmbridge {
// Etc
versionManager.set(MyVersionManager)
}
```

## Migrating

Expand Down

0 comments on commit 05c9233

Please sign in to comment.