-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Flisar
authored and
Michael Flisar
committed
Nov 12, 2024
1 parent
7656589
commit 2765a3a
Showing
47 changed files
with
673 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
import com.michaelflisar.composechangelog.gradle.plugin.Changelog | ||
import com.michaelflisar.composechangelog.DefaultVersionFormatter | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
alias(libs.plugins.kotlin.compose) | ||
alias(libs.plugins.compose) | ||
id("compose-changelog") | ||
} | ||
|
||
val version = "1.0.6" | ||
val code = Changelog.buildVersionCode(version, DefaultVersionFormatter(DefaultVersionFormatter.Format.MajorMinorPatchCandidate)) | ||
|
||
kotlin { | ||
|
||
jvm { | ||
withJava() | ||
} | ||
|
||
sourceSets { | ||
val jvmMain by getting { | ||
dependencies { | ||
|
||
implementation(compose.desktop.currentOs) | ||
|
||
implementation(project(":ComposeChangelog:Core")) | ||
implementation(project(":ComposeChangelog:Modules:StateSaverPreferences")) | ||
implementation(project(":ComposeChangelog:Modules:StateSaverKotPreferences")) | ||
|
||
// KotPreferences | ||
//implementation(libs.kotpreferences.core) | ||
//implementation(libs.kotpreferences.datastore) | ||
//implementation(libs.kotpreferences.compose) | ||
} | ||
} | ||
} | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "com.michaelflisar.composechangelog.demo.MainKt" | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Exe) | ||
packageName = "Changelog JVM Demo" | ||
packageVersion = version | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
changelogVersion ��= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<changelog> | ||
|
||
<release versionName="1.0.6" date="2018-03-04"> | ||
<new type="summary">This version has a summary item only - no show more button will be shown even if show more buttons are enabled</new> | ||
</release> | ||
|
||
<release versionName="1.0.5" date="2018-03-04"> | ||
<info>Some info 1 - apostrophe test: it's weird, but apostrophes do not work in precompiled xml files placed in xml resources!</info> | ||
<new type="summary">Some improvement 1</new> | ||
<bugfix>Some bugfix 1</bugfix> | ||
<info>Some info 2</info> | ||
<new type="summary">Some improvement 2</new> | ||
<bugfix>Some bugfix 2</bugfix> | ||
<info>Some info 3</info> | ||
<new>Some improvement 3</new> | ||
<bugfix>Some bugfix 3</bugfix> | ||
<customTag>My custom tag text...</customTag> | ||
</release> | ||
<release versionName="1.0.4" date="2018-03-04"> | ||
<new type="summary">This version has a summary item only - no show more button will be shown even if show more buttons are enabled</new> | ||
</release> | ||
<release versionName="1.0.3" date="2018-03-04"> | ||
<info>Some info</info> | ||
<new type="summary">Some improvement</new> | ||
<bugfix>Some bugfix</bugfix> | ||
</release> | ||
<release versionName="1.0.2" date="2018-03-03" filter="dogs"> | ||
<info>Some dogs info - filter only set in release tag</info> | ||
<new type="summary">Some dogs improvement - filter only set in release tag</new> | ||
<bugfix>Some dogs bugfix - filter only set in release tag</bugfix> | ||
</release> | ||
<release versionName="1.0.1" date="2018-03-02" filter="cats"> | ||
<info type="summary">single summary of version 1.05</info> | ||
<info>Some cats info - filter only set in release tag</info> | ||
<new>Some cats improvement - filter only set in release tag</new> | ||
<bugfix>Some cats bugfix - filter only set in release tag</bugfix> | ||
</release> | ||
<release versionName="1.0.0" date="2018-03-01"> | ||
<info filter="cats" type="summary">single cats summary of version 1.00</info> | ||
<info filter="dogs" type="summary">single dogs summary of version 1.00</info> | ||
<info filter="cats">New cats added - this info has filter text 'cats'</info> | ||
<info filter="dogs">New dogs added - this info has filter text 'dogs'</info> | ||
<new filter="cats">Some cats improvement - this info has filter text 'cats'</new> | ||
<new filter="dogs">Some dogs improvement - this info has filter text 'dogs'</new> | ||
<bugfix filter="cats">Some cats bugfix - this info has filter text 'cats'</bugfix> | ||
<bugfix filter="dogs">Some dogs bugfix - this info has filter text 'dogs'</bugfix> | ||
</release> | ||
<release versionName="0.0.1" date="2018-02-01"> | ||
<info>this release does not have any summary item and will be shown expanded even if summary is enabled - this behaviour can be adjusted by the second parameter in the builder with which you enable summaries</info> | ||
</release> | ||
|
||
</changelog> |
8 changes: 8 additions & 0 deletions
8
demo/desktop/src/jvmMain/kotlin/com/michaelflisar/composechangelog/demo/Constants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.michaelflisar.composechangelog.demo | ||
|
||
import com.michaelflisar.composechangelog.DefaultVersionFormatter | ||
|
||
object Constants { | ||
val CHANGELOG_FORMATTER = | ||
DefaultVersionFormatter(DefaultVersionFormatter.Format.MajorMinorPatchCandidate) | ||
} |
81 changes: 81 additions & 0 deletions
81
demo/desktop/src/jvmMain/kotlin/com/michaelflisar/composechangelog/demo/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.michaelflisar.composechangelog.demo | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.window.Window | ||
import androidx.compose.ui.window.WindowPosition | ||
import androidx.compose.ui.window.application | ||
import androidx.compose.ui.window.rememberWindowState | ||
import com.michaelflisar.composechangelog.Changelog | ||
import com.michaelflisar.composechangelog.ChangelogDefaults | ||
import com.michaelflisar.composechangelog.setup | ||
import com.michaelflisar.composechangelog.statesaver.preferences.ChangelogStateSaverPreferences | ||
import com.michaelflisar.composechangelog.statesaver.preferences.create | ||
|
||
fun main() { | ||
|
||
application { | ||
|
||
// TODO: get it from the exe in a real jvm application | ||
val versionName = "1.0.6" | ||
|
||
val setup = ChangelogDefaults.setup( | ||
versionFormatter = Constants.CHANGELOG_FORMATTER | ||
) | ||
|
||
Window( | ||
title = "Changelog Demo", | ||
onCloseRequest = ::exitApplication, | ||
state = rememberWindowState( | ||
position = WindowPosition(Alignment.Center), | ||
width = 800.dp, | ||
height = 600.dp | ||
) | ||
) { | ||
val showChangelog = remember { mutableStateOf(false) } | ||
|
||
Column( | ||
modifier = Modifier.padding(16.dp), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Column { | ||
Text("App Version", fontWeight = FontWeight.Bold) | ||
Text( | ||
"Code: ${Constants.CHANGELOG_FORMATTER.parseVersion(versionName)}", | ||
style = MaterialTheme.typography.body1 | ||
) | ||
Text( | ||
"Name: $versionName", | ||
style = MaterialTheme.typography.body1 | ||
) | ||
} | ||
Button(onClick = { | ||
showChangelog.value = true | ||
}) { | ||
Text("Show Changelog") | ||
} | ||
} | ||
|
||
// manual changelog dialog | ||
if (showChangelog.value) { | ||
Changelog.ShowChangelogDialog(setup) { | ||
showChangelog.value = false | ||
} | ||
} | ||
|
||
// automatic changelog dialog | ||
val changelogStateSaver = ChangelogStateSaverPreferences.create() | ||
Changelog.CheckedShowChangelog(changelogStateSaver, versionName, setup) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.