-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
42 changed files
with
1,997 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,26 @@ | ||
# Compose Multiplatform Application | ||
|
||
## Before running! | ||
- check your system with [KDoctor](https://github.com/Kotlin/kdoctor) | ||
- install JDK 17 or higher on your machine | ||
- add `local.properties` file to the project root and set a path to Android SDK there | ||
|
||
### Android | ||
To run the application on android device/emulator: | ||
- open project in Android Studio and run imported android run configuration | ||
|
||
To build the application bundle: | ||
- run `./gradlew :composeApp:assembleDebug` | ||
- find `.apk` file in `composeApp/build/outputs/apk/debug/composeApp-debug.apk` | ||
Run android simulator UI tests: `./gradlew :composeApp:pixel5Check` | ||
|
||
### Desktop | ||
Run the desktop application: `./gradlew :composeApp:run` | ||
Run desktop UI tests: `./gradlew :composeApp:jvmTest` | ||
|
||
### iOS | ||
To run the application on iPhone device/simulator: | ||
- Open `iosApp/iosApp.xcproject` in Xcode and run standard configuration | ||
- Or use [Kotlin Multiplatform Mobile plugin](https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile) for Android Studio | ||
Run iOS simulator UI tests: `./gradlew :composeApp:iosSimulatorArm64Test` | ||
|
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,139 @@ | ||
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin | ||
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
alias(libs.plugins.aboutlibraries) apply false | ||
alias(libs.plugins.android) apply false | ||
alias(libs.plugins.android.application) apply false | ||
alias(libs.plugins.android.library) apply false | ||
alias(libs.plugins.cocoapods) apply false | ||
alias(libs.plugins.compose) apply false | ||
alias(libs.plugins.compose.compiler) apply false | ||
alias(libs.plugins.konfig) apply false | ||
alias(libs.plugins.multiplatform) apply false | ||
alias(libs.plugins.serialization) apply false | ||
alias(libs.plugins.versions) | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven("https://jitpack.io") | ||
maven("https://jogamp.org/deployment/maven") | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") | ||
maven("https://oss.sonatype.org/content/repositories/snapshots") | ||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven("https://jitpack.io") | ||
maven("https://jogamp.org/deployment/maven") | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") | ||
maven("https://oss.sonatype.org/content/repositories/snapshots") | ||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") | ||
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_17) | ||
} | ||
} | ||
plugins.withType<YarnPlugin> { | ||
yarn.yarnLockAutoReplace = true | ||
} | ||
} | ||
|
||
|
||
tasks.withType<DependencyUpdatesTask> { | ||
outputFormatter { | ||
val updatable = this.outdated.dependencies | ||
val markdown = if (updatable.isEmpty()) { | ||
buildString { | ||
append("### Dependencies up-to-date") | ||
appendLine() | ||
appendLine() | ||
appendLine("Everything up-to-date") | ||
appendLine() | ||
appendLine("### Gradle Version") | ||
appendLine() | ||
appendLine("**Current version:** ${this@outputFormatter.gradle.running.version}") | ||
appendLine("**Latest version:** ${this@outputFormatter.gradle.current.version}") | ||
} | ||
} else { | ||
buildString { | ||
append("## Updatable dependencies (${updatable.size})") | ||
appendLine() | ||
appendLine() | ||
append('|') | ||
append("Group") | ||
append('|') | ||
append("Module") | ||
append('|') | ||
append("Used Version") | ||
append('|') | ||
append("Available Version") | ||
append('|') | ||
appendLine() | ||
append('|') | ||
repeat(2) { | ||
append("---") | ||
append('|') | ||
} | ||
repeat(2) { | ||
append(":-:") | ||
append('|') | ||
} | ||
updatable.forEach { dependency -> | ||
appendLine() | ||
append('|') | ||
append(dependency.group ?: ' ') | ||
append('|') | ||
append(dependency.name ?: ' ') | ||
append('|') | ||
append(dependency.version ?: ' ') | ||
append('|') | ||
append(dependency.available.release ?: dependency.available.milestone ?: ' ') | ||
append('|') | ||
} | ||
appendLine() | ||
appendLine() | ||
appendLine("### Gradle Version") | ||
appendLine() | ||
appendLine("**Current version:** ${this@outputFormatter.gradle.running.version}") | ||
appendLine("**Latest version:** ${this@outputFormatter.gradle.current.version}") | ||
} | ||
} | ||
val outputFile = layout.buildDirectory.file("dependencyUpdates/report.md").get().asFile | ||
try { | ||
if (outputFile.exists()) { | ||
outputFile.delete() | ||
} | ||
} catch (ignored: Throwable) { } | ||
try { | ||
outputFile.parentFile.mkdirs() | ||
} catch (ignored: Throwable) { } | ||
try { | ||
outputFile.writeText(markdown) | ||
} catch (ignored: Throwable) { } | ||
} | ||
rejectVersionIf { | ||
isNonStable(candidate.version) && !isNonStable(currentVersion) | ||
} | ||
} | ||
|
||
fun isNonStable(version: String): Boolean { | ||
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } | ||
val regex = "^[0-9,.v-]+(-r)?$".toRegex() | ||
val isStable = stableKeyword || regex.matches(version) | ||
return isStable.not() | ||
} |
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,140 @@ | ||
import com.codingfeline.buildkonfig.compiler.FieldSpec | ||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | ||
|
||
plugins { | ||
alias(libs.plugins.aboutlibraries) | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.compose) | ||
alias(libs.plugins.compose.compiler) | ||
alias(libs.plugins.konfig) | ||
alias(libs.plugins.serialization) | ||
} | ||
|
||
val artifact = "dev.datlag.burningseries" | ||
val appVersion = "6.0.0" | ||
val appVersionCode = 600 | ||
|
||
group = artifact | ||
version = appVersion | ||
|
||
composeCompiler { | ||
enableStrongSkippingMode.set(true) | ||
enableNonSkippingGroupOptimization.set(true) | ||
} | ||
|
||
buildkonfig { | ||
packageName = artifact | ||
|
||
defaultConfigs { | ||
buildConfigField(FieldSpec.Type.STRING, "packageName", artifact) | ||
} | ||
} | ||
|
||
kotlin { | ||
androidTarget() | ||
jvm() | ||
|
||
/*listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
}*/ | ||
|
||
applyDefaultHierarchyTemplate() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material3) | ||
implementation(compose.materialIconsExtended) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
|
||
implementation(libs.kodein) | ||
implementation(libs.kodein.compose) | ||
|
||
implementation(libs.haze) | ||
implementation(libs.haze.materials) | ||
|
||
implementation(libs.decompose) | ||
implementation(libs.decompose.compose) | ||
|
||
implementation(libs.tooling.decompose) | ||
} | ||
|
||
val androidMain by getting { | ||
apply(plugin = "kotlin-parcelize") | ||
|
||
dependencies { | ||
implementation(libs.android) | ||
implementation(libs.activity) | ||
implementation(libs.activity.compose) | ||
implementation(libs.multidex) | ||
|
||
implementation(libs.ktor.jvm) | ||
implementation(libs.coroutines.android) | ||
} | ||
} | ||
|
||
jvmMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
|
||
implementation(libs.coroutines.swing) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
coreLibraryDesugaring(libs.desugar) | ||
} | ||
|
||
android { | ||
sourceSets["main"].setRoot("src/androidMain/") | ||
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources") | ||
sourceSets["main"].assets.srcDirs("src/androidMain/assets", "src/commonMain/assets") | ||
compileSdk = 34 | ||
namespace = artifact | ||
|
||
defaultConfig { | ||
applicationId = artifact | ||
minSdk = 23 | ||
targetSdk = 43 | ||
versionCode = appVersionCode | ||
versionName = appVersion | ||
|
||
multiDexEnabled = true | ||
vectorDrawables.useSupportLibrary = true | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
merges += "values**" | ||
} | ||
} | ||
compileOptions { | ||
isCoreLibraryDesugaringEnabled = true | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
buildFeatures { | ||
buildConfig = true | ||
} | ||
} | ||
|
||
compose { | ||
desktop { | ||
application { | ||
mainClass = "$artifact.MainKt" | ||
} | ||
} | ||
web { } | ||
} |
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,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application | ||
android:icon="@android:drawable/ic_menu_compass" | ||
android:label="Burning-Series" | ||
android:theme="@android:style/Theme.Material.NoActionBar"> | ||
<activity | ||
android:name=".AppActivity" | ||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" | ||
android:launchMode="singleInstance" | ||
android:windowSoftInputMode="adjustPan" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
14 changes: 14 additions & 0 deletions
14
composeApp/src/androidMain/kotlin/dev/datlag/burningseries/App.android.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,14 @@ | ||
package dev.datlag.burningseries | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.activity.enableEdgeToEdge | ||
|
||
class AppActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
enableEdgeToEdge() | ||
setContent { App() } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
composeApp/src/androidMain/kotlin/dev/datlag/burningseries/theme/Theme.android.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,19 @@ | ||
package dev.datlag.burningseries.theme | ||
|
||
import android.app.Activity | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.platform.LocalView | ||
import androidx.core.view.WindowInsetsControllerCompat | ||
|
||
@Composable | ||
internal actual fun SystemAppearance(isDark: Boolean) { | ||
val view = LocalView.current | ||
LaunchedEffect(isDark) { | ||
val window = (view.context as Activity).window | ||
WindowInsetsControllerCompat(window, window.decorView).apply { | ||
isAppearanceLightStatusBars = isDark | ||
isAppearanceLightNavigationBars = isDark | ||
} | ||
} | ||
} |
Binary file added
BIN
+111 KB
composeApp/src/commonMain/composeResources/font/Manrope-bold-italic.ttf
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+110 KB
composeApp/src/commonMain/composeResources/font/Manrope-extra-bold-italic.ttf
Binary file not shown.
Binary file added
BIN
+139 KB
composeApp/src/commonMain/composeResources/font/Manrope-extra-bold.ttf
Binary file not shown.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/font/Manrope-extra-light-italic.ttf
Binary file not shown.
Binary file added
BIN
+132 KB
composeApp/src/commonMain/composeResources/font/Manrope-extra-light.ttf
Binary file not shown.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/font/Manrope-light-italic.ttf
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/font/Manrope-medium-italic.ttf
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/font/Manrope-regular-italic.ttf
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/font/Manrope-semi-bold-italic.ttf
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
composeApp/src/commonMain/composeResources/values/strings.xml
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,4 @@ | ||
<resources> | ||
<string name="app_name">Burning-Series</string> | ||
<string name="home">Home</string> | ||
</resources> |
Oops, something went wrong.