diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..adfa9bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +*.iml +.kotlin +.gradle +**/build/ +xcuserdata +!src/**/build/ +local.properties +.idea +.DS_Store +captures +.externalNativeBuild +.cxx +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcodeproj/project.xcworkspace/ +!*.xcworkspace/contents.xcworkspacedata +**/xcshareddata/WorkspaceSettings.xcsettings +node_modules/ diff --git a/README.md b/README.md index 034a1a1..7dd819a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# android -크루위키 안드로이드 앱입니다! +This is a Kotlin Multiplatform project targeting Android, iOS. + +Asset migration notes for `crew-wiki-next` are in [./docs/asset-migration.md](./docs/asset-migration.md). + +* [/iosApp](./iosApp/iosApp) contains an iOS application. Even if you’re sharing your UI with Compose Multiplatform, + you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project. + +* [/shared](./shared/src) is for code that will be shared across your Compose Multiplatform applications. + It contains several subfolders: + - [commonMain](./shared/src/commonMain/kotlin) is for code that’s common for all targets. + - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. + For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, + the [iosMain](./shared/src/iosMain/kotlin) folder would be the right place for such calls. + Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./shared/src/jvmMain/kotlin) + folder is the appropriate location. + +### Running the apps + +Use the run configurations provided by the run widget in your IDE's toolbar. You can also use these commands and options: + +- Android app: `./gradlew :androidApp:assembleDebug` +- iOS app: open the [/iosApp](./iosApp) directory in Xcode and run it from there. + +### Running tests + +Use the run button in your IDE's editor gutter, or run tests using Gradle tasks: + +- Android tests: `./gradlew :shared:testAndroidHostTest` +- iOS tests: `./gradlew :shared:iosSimulatorArm64Test` + +--- + +Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)… diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts new file mode 100644 index 0000000..5ec0242 --- /dev/null +++ b/androidApp/build.gradle.kts @@ -0,0 +1,48 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + alias(libs.plugins.androidApplication) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) +} + +kotlin { + compilerOptions { + jvmTarget = JvmTarget.JVM_11 + } +} +dependencies { + implementation(projects.shared) + + implementation(libs.androidx.activity.compose) + + implementation(libs.compose.uiToolingPreview) + debugImplementation(libs.compose.uiTooling) +} + +android { + namespace = "com.example.crew_wiki" + compileSdk = libs.versions.android.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.crew_wiki" + minSdk = libs.versions.android.minSdk.get().toInt() + targetSdk = libs.versions.android.targetSdk.get().toInt() + versionCode = 1 + versionName = "1.0" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} \ No newline at end of file diff --git a/androidApp/src/main/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml new file mode 100644 index 0000000..26403a7 --- /dev/null +++ b/androidApp/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/androidApp/src/main/kotlin/com/example/crew_wiki/MainActivity.kt b/androidApp/src/main/kotlin/com/example/crew_wiki/MainActivity.kt new file mode 100644 index 0000000..c0734fd --- /dev/null +++ b/androidApp/src/main/kotlin/com/example/crew_wiki/MainActivity.kt @@ -0,0 +1,25 @@ +package com.example.crew_wiki + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + enableEdgeToEdge() + super.onCreate(savedInstanceState) + + setContent { + App() + } + } +} + +@Preview +@Composable +fun AppAndroidPreview() { + App() +} \ No newline at end of file diff --git a/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/androidApp/src/main/res/drawable/ic_launcher_background.xml b/androidApp/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..e93e11a --- /dev/null +++ b/androidApp/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml new file mode 100644 index 0000000..0e1b20f --- /dev/null +++ b/androidApp/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Crewwiki + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..7cac393 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + alias(libs.plugins.androidApplication) apply false + alias(libs.plugins.androidMultiplatformLibrary) apply false + alias(libs.plugins.composeMultiplatform) apply false + alias(libs.plugins.composeCompiler) apply false + alias(libs.plugins.kotlinMultiplatform) apply false +} \ No newline at end of file diff --git a/docs/asset-migration.md b/docs/asset-migration.md new file mode 100644 index 0000000..4f78472 --- /dev/null +++ b/docs/asset-migration.md @@ -0,0 +1,49 @@ +# Crew Wiki Asset Migration + +`crew-wiki-next/client`의 폰트와 이미지 자산을 Compose Multiplatform 리소스로 옮긴 기록입니다. + +## 현재 기준 경로 + +- 공용 UI 리소스: `shared/src/commonMain/composeResources` +- Android 앱 전용 리소스: `androidApp/src/main/res` + +이번 단계에서는 공용 UI에서 바로 쓸 수 있도록 `composeResources` 기준으로 정리했습니다. + +## 복사 대상 + +| 원본 | KMP 대상 | 상태 | 비고 | +| --- | --- | --- | --- | +| `public/fonts/BMHANNAProOTF.otf` | `shared/src/commonMain/composeResources/font/bm_hanna_pro.otf` | 사용 가능 | Compose Multiplatform 폰트로 생성 확인 | +| `Pretendard-1/public/variable/PretendardVariable.ttf` | `shared/src/commonMain/composeResources/font/pretendard_variable.ttf` | 사용 가능 | Variable font 원본 | +| `Pretendard-1/public/static/Pretendard-Regular.otf` | `shared/src/commonMain/composeResources/font/pretendard_regular.otf` | 사용 가능 | 기본 본문 폰트 | +| `Pretendard-1/public/static/Pretendard-Medium.otf` | `shared/src/commonMain/composeResources/font/pretendard_medium.otf` | 사용 가능 | Medium weight | +| `Pretendard-1/public/static/Pretendard-SemiBold.otf` | `shared/src/commonMain/composeResources/font/pretendard_semibold.otf` | 사용 가능 | SemiBold weight | +| `Pretendard-1/public/static/Pretendard-Bold.otf` | `shared/src/commonMain/composeResources/font/pretendard_bold.otf` | 사용 가능 | Bold weight | +| `src/app/apple-icon.png` | `shared/src/commonMain/composeResources/drawable/crew_wiki_apple_icon.png` | 사용 가능 | Drawable 리소스로 생성 확인 | +| `src/app/apple-icon.png` | `shared/src/commonMain/composeResources/files/crew_wiki/icons/icon.png` | 사용 가능 | `icon.svg` 대체용 원본 보관 | +| `src/app/favicon.ico` | `shared/src/commonMain/composeResources/files/crew_wiki/icons/favicon.ico` | 보관 | Compose drawable로 직접 사용하지 않음 | + +## 검증 결과 + +- `composeResources/font` 아래의 `ttf`, `otf`는 Compose Multiplatform 폰트 리소스로 인식됩니다. +- 생성된 accessor에서 아래 리소스를 확인했습니다. + - `Res.font.bm_hanna_pro` + - `Res.font.pretendard_variable` + - `Res.font.pretendard_regular` + - `Res.font.pretendard_medium` + - `Res.font.pretendard_semibold` + - `Res.font.pretendard_bold` + - `Res.drawable.crew_wiki_apple_icon` + +## 적용 상태 + +- `CrewWikiTheme`에서 기본 타이포그래피는 `Pretendard` 정적 weight 세트를 사용합니다. +- `BMHANNA`는 display typography에 연결했습니다. +- `pretendard_variable.ttf`는 리소스로 추가만 되어 있고, 현재 테마에서는 직접 사용하지 않습니다. +- 샘플 화면 이미지는 `crew_wiki_apple_icon.png`를 사용하도록 교체했습니다. + +## 다음 작업 후보 + +1. 화면별 텍스트 스타일을 정리해서 `BMHANNA`와 `Pretendard` 사용 기준 고정 +2. `icon.png`를 실제 앱 아이콘 세트 또는 필요한 화면 리소스로 연결 +3. CDN 의존 아이콘을 수집해서 `composeResources/drawable`로 고정 diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6f8e6ea --- /dev/null +++ b/gradle.properties @@ -0,0 +1,12 @@ +#Kotlin +kotlin.code.style=official +kotlin.daemon.jvmargs=-Xmx3072M + +#Gradle +org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 +org.gradle.configuration-cache=true +org.gradle.caching=true + +#Android +android.nonTransitiveRClass=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000..050d142 --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,12 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b62178ff26b34365c61e54dea2180e32/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/f2dede3f3c566068b401dc14a9646d39/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b62178ff26b34365c61e54dea2180e32/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/f2dede3f3c566068b401dc14a9646d39/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9aafe8bc391c4bbca3e440130e15608b/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/109553caae279a667336ea8850b50c92/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b62178ff26b34365c61e54dea2180e32/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/f2dede3f3c566068b401dc14a9646d39/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/9eb5d45802b65696ed3ce0f14bb1e4ff/redirect +toolchainVendor=AMAZON +toolchainVersion=21 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..83a887c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,41 @@ +[versions] +agp = "9.0.1" +android-compileSdk = "36" +android-minSdk = "24" +android-targetSdk = "36" +androidx-activity = "1.13.0" +androidx-appcompat = "1.7.1" +androidx-core = "1.19.0" +androidx-espresso = "3.7.0" +androidx-lifecycle = "2.11.0-beta01" +androidx-testExt = "1.3.0" +composeMultiplatform = "1.11.1" +junit = "4.13.2" +kotlin = "2.4.0" +material3 = "1.11.0-alpha07" + +[libraries] +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } +kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } +junit = { module = "junit:junit", version.ref = "junit" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } +androidx-testExt-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-testExt" } +androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" } +compose-uiTooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "composeMultiplatform" } +androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } +androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } +compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" } +compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" } +compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "material3" } +compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" } +compose-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "composeMultiplatform" } +compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" } + +[plugins] +androidApplication = { id = "com.android.application", version.ref = "agp" } +androidMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } +composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } +composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8bdaf60 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..75927bd --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,8 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..adff685 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..c4bdd3a --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/iosApp/Configuration/Config.xcconfig b/iosApp/Configuration/Config.xcconfig new file mode 100644 index 0000000..d6338fb --- /dev/null +++ b/iosApp/Configuration/Config.xcconfig @@ -0,0 +1,7 @@ +TEAM_ID= + +PRODUCT_NAME=Crewwiki +PRODUCT_BUNDLE_IDENTIFIER=com.example.crew_wiki.Crewwiki$(TEAM_ID) + +CURRENT_PROJECT_VERSION=1 +MARKETING_VERSION=1.0 \ No newline at end of file diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..892b334 --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -0,0 +1,373 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + 9839CB96AB792B664CCC88E5 /* Crewwiki.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Crewwiki.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 43370E3689F72074187CA32A /* Exceptions for "iosApp" folder in "iosApp" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 9E33F53885E66F33C4080028 /* iosApp */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + AD5FBC7893082892A7EA7CD9 /* iosApp */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 43370E3689F72074187CA32A /* Exceptions for "iosApp" folder in "iosApp" target */, + ); + path = iosApp; + sourceTree = ""; + }; + 3B6E8CCC4F46CF528F7B5DAE /* Configuration */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Configuration; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0CCD36424C25AFDB5AA24F1E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 590FE12254485CB3E64B9506 = { + isa = PBXGroup; + children = ( + 3B6E8CCC4F46CF528F7B5DAE /* Configuration */, + AD5FBC7893082892A7EA7CD9 /* iosApp */, + B1F70C016D6678BA69B24EE7 /* Products */, + ); + sourceTree = ""; + }; + B1F70C016D6678BA69B24EE7 /* Products */ = { + isa = PBXGroup; + children = ( + 9839CB96AB792B664CCC88E5 /* Crewwiki.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9E33F53885E66F33C4080028 /* iosApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 293DDA52134211B2137E02A7 /* Build configuration list for PBXNativeTarget "iosApp" */; + buildPhases = ( + CA06DA6C92A68D057E0707B4 /* Compile Kotlin Framework */, + E034161D8193128F7566DF95 /* Sources */, + 0CCD36424C25AFDB5AA24F1E /* Frameworks */, + 1BCE75B0076A58CBE945A795 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + AD5FBC7893082892A7EA7CD9 /* iosApp */, + ); + name = iosApp; + packageProductDependencies = ( + ); + productName = iosApp; + productReference = 9839CB96AB792B664CCC88E5 /* Crewwiki.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0D0271D3EF11335A005A63D6 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1620; + LastUpgradeCheck = 1620; + TargetAttributes = { + 9E33F53885E66F33C4080028 = { + CreatedOnToolsVersion = 16.2; + }; + }; + }; + buildConfigurationList = 4EEC33FB88040298C8566F1C /* Build configuration list for PBXProject "iosApp" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 590FE12254485CB3E64B9506; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = B1F70C016D6678BA69B24EE7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9E33F53885E66F33C4080028 /* iosApp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1BCE75B0076A58CBE945A795 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + CA06DA6C92A68D057E0707B4 /* Compile Kotlin Framework */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Compile Kotlin Framework"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E034161D8193128F7566DF95 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + EE563A40BF72F3CA003C2778 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 3B6E8CCC4F46CF528F7B5DAE /* Configuration */; + baseConfigurationReferenceRelativePath = Config.xcconfig; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8390F61C70C2AFF9793C17E7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 3B6E8CCC4F46CF528F7B5DAE /* Configuration */; + baseConfigurationReferenceRelativePath = Config.xcconfig; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 75D070EB396A3E2D24968442 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = arm64; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = "${TEAM_ID}"; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 86ABC2ED355C0516A2C9629C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = arm64; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; + DEVELOPMENT_TEAM = "${TEAM_ID}"; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = iosApp/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4EEC33FB88040298C8566F1C /* Build configuration list for PBXProject "iosApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EE563A40BF72F3CA003C2778 /* Debug */, + 8390F61C70C2AFF9793C17E7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 293DDA52134211B2137E02A7 /* Build configuration list for PBXNativeTarget "iosApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 75D070EB396A3E2D24968442 /* Debug */, + 86ABC2ED355C0516A2C9629C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0D0271D3EF11335A005A63D6 /* Project object */; +} \ No newline at end of file diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fe1aa71 --- /dev/null +++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json b/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..ee7e3ca --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..4c663a0 --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,36 @@ +{ + "images" : [ + { + "filename" : "app-icon-1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png new file mode 100644 index 0000000..53fc536 Binary files /dev/null and b/iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png differ diff --git a/iosApp/iosApp/Assets.xcassets/Contents.json b/iosApp/iosApp/Assets.xcassets/Contents.json new file mode 100644 index 0000000..4aa7c53 --- /dev/null +++ b/iosApp/iosApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/ContentView.swift b/iosApp/iosApp/ContentView.swift new file mode 100644 index 0000000..46a12f4 --- /dev/null +++ b/iosApp/iosApp/ContentView.swift @@ -0,0 +1,18 @@ +import UIKit +import SwiftUI +import Shared + +struct ComposeView: UIViewControllerRepresentable { + func makeUIViewController(context: Self.Context) -> UIViewController { + MainViewControllerKt.MainViewController() + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Self.Context) {} +} + +struct ContentView: View { + var body: some View { + ComposeView() + .ignoresSafeArea() + } +} \ No newline at end of file diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist new file mode 100644 index 0000000..ed67386 --- /dev/null +++ b/iosApp/iosApp/Info.plist @@ -0,0 +1,8 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + + \ No newline at end of file diff --git a/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json b/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..4aa7c53 --- /dev/null +++ b/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} \ No newline at end of file diff --git a/iosApp/iosApp/iOSApp.swift b/iosApp/iosApp/iOSApp.swift new file mode 100644 index 0000000..d83dca6 --- /dev/null +++ b/iosApp/iosApp/iOSApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct iOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..bd03fff --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,32 @@ +rootProject.name = "Crewwiki" +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +pluginManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + } +} + +include(":androidApp") +include(":shared") \ No newline at end of file diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts new file mode 100644 index 0000000..e22574e --- /dev/null +++ b/shared/build.gradle.kts @@ -0,0 +1,59 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.androidMultiplatformLibrary) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) +} + +kotlin { + listOf( + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "Shared" + isStatic = true + } + } + + androidLibrary { + namespace = "com.example.crew_wiki.shared" + compileSdk = libs.versions.android.compileSdk.get().toInt() + minSdk = libs.versions.android.minSdk.get().toInt() + + compilerOptions { + jvmTarget = JvmTarget.JVM_11 + } + androidResources { + enable = true + } + withHostTest { + isIncludeAndroidResources = true + } + } + + sourceSets { + androidMain.dependencies { + implementation(libs.compose.uiToolingPreview) + } + commonMain.dependencies { + implementation(libs.compose.runtime) + implementation(libs.compose.foundation) + implementation(libs.compose.material3) + implementation(libs.compose.ui) + implementation(libs.compose.components.resources) + implementation(libs.compose.uiToolingPreview) + implementation(libs.androidx.lifecycle.viewmodelCompose) + implementation(libs.androidx.lifecycle.runtimeCompose) + } + commonTest.dependencies { + implementation(libs.kotlin.test) + } + } +} + +dependencies { + androidRuntimeClasspath(libs.compose.uiTooling) +} \ No newline at end of file diff --git a/shared/src/androidHostTest/kotlin/com/example/crew_wiki/SharedLogicAndroidHostTest.kt b/shared/src/androidHostTest/kotlin/com/example/crew_wiki/SharedLogicAndroidHostTest.kt new file mode 100644 index 0000000..21c01bc --- /dev/null +++ b/shared/src/androidHostTest/kotlin/com/example/crew_wiki/SharedLogicAndroidHostTest.kt @@ -0,0 +1,12 @@ +package com.example.crew_wiki + +import kotlin.test.Test +import kotlin.test.assertEquals + +class SharedLogicAndroidHostTest { + + @Test + fun example() { + assertEquals(3, 1 + 2) + } +} \ No newline at end of file diff --git a/shared/src/androidMain/kotlin/com/example/crew_wiki/Platform.android.kt b/shared/src/androidMain/kotlin/com/example/crew_wiki/Platform.android.kt new file mode 100644 index 0000000..9705ba5 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/example/crew_wiki/Platform.android.kt @@ -0,0 +1,9 @@ +package com.example.crew_wiki + +import android.os.Build + +class AndroidPlatform : Platform { + override val name: String = "Android ${Build.VERSION.SDK_INT}" +} + +actual fun getPlatform(): Platform = AndroidPlatform() \ No newline at end of file diff --git a/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml b/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml new file mode 100644 index 0000000..1ffc948 --- /dev/null +++ b/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shared/src/commonMain/composeResources/drawable/crew_wiki_apple_icon.png b/shared/src/commonMain/composeResources/drawable/crew_wiki_apple_icon.png new file mode 100644 index 0000000..7501220 Binary files /dev/null and b/shared/src/commonMain/composeResources/drawable/crew_wiki_apple_icon.png differ diff --git a/shared/src/commonMain/composeResources/files/crew_wiki/icons/favicon.ico b/shared/src/commonMain/composeResources/files/crew_wiki/icons/favicon.ico new file mode 100644 index 0000000..02232ff Binary files /dev/null and b/shared/src/commonMain/composeResources/files/crew_wiki/icons/favicon.ico differ diff --git a/shared/src/commonMain/composeResources/files/crew_wiki/icons/icon.png b/shared/src/commonMain/composeResources/files/crew_wiki/icons/icon.png new file mode 100644 index 0000000..7501220 Binary files /dev/null and b/shared/src/commonMain/composeResources/files/crew_wiki/icons/icon.png differ diff --git a/shared/src/commonMain/composeResources/font/bm_hanna_pro.otf b/shared/src/commonMain/composeResources/font/bm_hanna_pro.otf new file mode 100644 index 0000000..372cf07 Binary files /dev/null and b/shared/src/commonMain/composeResources/font/bm_hanna_pro.otf differ diff --git a/shared/src/commonMain/composeResources/font/pretendard_bold.otf b/shared/src/commonMain/composeResources/font/pretendard_bold.otf new file mode 100644 index 0000000..8e5e30a Binary files /dev/null and b/shared/src/commonMain/composeResources/font/pretendard_bold.otf differ diff --git a/shared/src/commonMain/composeResources/font/pretendard_medium.otf b/shared/src/commonMain/composeResources/font/pretendard_medium.otf new file mode 100644 index 0000000..0575069 Binary files /dev/null and b/shared/src/commonMain/composeResources/font/pretendard_medium.otf differ diff --git a/shared/src/commonMain/composeResources/font/pretendard_regular.otf b/shared/src/commonMain/composeResources/font/pretendard_regular.otf new file mode 100644 index 0000000..08bf4cf Binary files /dev/null and b/shared/src/commonMain/composeResources/font/pretendard_regular.otf differ diff --git a/shared/src/commonMain/composeResources/font/pretendard_semibold.otf b/shared/src/commonMain/composeResources/font/pretendard_semibold.otf new file mode 100644 index 0000000..e7e36ab Binary files /dev/null and b/shared/src/commonMain/composeResources/font/pretendard_semibold.otf differ diff --git a/shared/src/commonMain/composeResources/font/pretendard_variable.ttf b/shared/src/commonMain/composeResources/font/pretendard_variable.ttf new file mode 100644 index 0000000..32b0811 Binary files /dev/null and b/shared/src/commonMain/composeResources/font/pretendard_variable.ttf differ diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/App.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/App.kt new file mode 100644 index 0000000..e5e60ca --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/App.kt @@ -0,0 +1,49 @@ +package com.example.crew_wiki + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.safeContentPadding +import androidx.compose.material3.Button +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import org.jetbrains.compose.resources.painterResource + +import crewwiki.shared.generated.resources.Res +import crewwiki.shared.generated.resources.crew_wiki_apple_icon + +@Composable +@Preview +fun App() { + CrewWikiTheme { + var showContent by remember { mutableStateOf(false) } + Column( + modifier = Modifier + .background(MaterialTheme.colorScheme.primaryContainer) + .safeContentPadding() + .fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Button(onClick = { showContent = !showContent }) { + Text("Click me!") + } + AnimatedVisibility(showContent) { + val greeting = remember { Greeting().greet() } + Column( + modifier = Modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image(painterResource(Res.drawable.crew_wiki_apple_icon), null) + Text("Compose: $greeting") + } + } + } + } +} diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiColors.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiColors.kt new file mode 100644 index 0000000..12908fa --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiColors.kt @@ -0,0 +1,162 @@ +package com.example.crew_wiki + +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color + +@Immutable +data class CrewWikiColorScale( + val c50: Color, + val c100: Color, + val c200: Color, + val c300: Color, + val c400: Color, + val c500: Color, + val c600: Color, + val c700: Color, + val c800: Color, + val c900: Color, + val base: Color, + val container: Color, + val onContainer: Color, +) + +@Immutable +data class CrewWikiErrorScale( + val c50: Color, + val c100: Color, + val c200: Color, + val c300: Color, + val c400: Color, + val c500: Color, + val c600: Color, + val c700: Color, + val c800: Color, + val c900: Color, + val base: Color, + val container: Color, +) + +@Immutable +data class CrewWikiGrayscaleScale( + val c50: Color, + val c100: Color, + val c200: Color, + val c300: Color, + val c400: Color, + val c500: Color, + val c600: Color, + val c700: Color, + val c800: Color, + val c900: Color, + val container: Color, + val border: Color, + val lightText: Color, + val text: Color, +) + +@Immutable +data class CrewWikiPalette( + val black: Color, + val white: Color, + val primary: CrewWikiColorScale, + val secondary: CrewWikiColorScale, + val error: CrewWikiErrorScale, + val grayscale: CrewWikiGrayscaleScale, +) + +internal val CrewWikiLightPalette = CrewWikiPalette( + black = Color(0xFF000000), + white = Color(0xFFFFFFFF), + primary = CrewWikiColorScale( + c50 = Color(0xFFDEF2F4), + c100 = Color(0xFFACDEE1), + c200 = Color(0xFF72C9CE), + c300 = Color(0xFF25B4B9), + c400 = Color(0xFF00A4A8), + c500 = Color(0xFF009495), + c600 = Color(0xFF008787), + c700 = Color(0xFF007776), + c800 = Color(0xFF006766), + c900 = Color(0xFF004B47), + base = Color(0xFF25B4B9), + container = Color(0xFFDEF2F4), + onContainer = Color(0xFF006766), + ), + secondary = CrewWikiColorScale( + c50 = Color(0xFFF6E3F4), + c100 = Color(0xFFE7B8E4), + c200 = Color(0xFFD788D3), + c300 = Color(0xFFC655C1), + c400 = Color(0xFFB925B4), + c500 = Color(0xFFAB00A8), + c600 = Color(0xFF9D00A3), + c700 = Color(0xFF8A009D), + c800 = Color(0xFF790097), + c900 = Color(0xFF58008B), + base = Color(0xFFB925B4), + container = Color(0xFFF6E3F4), + onContainer = Color(0xFF58008B), + ), + error = CrewWikiErrorScale( + c50 = Color(0xFFFFECEF), + c100 = Color(0xFFFFCFD4), + c200 = Color(0xFFF09E9E), + c300 = Color(0xFFE67979), + c400 = Color(0xFFF15B57), + c500 = Color(0xFFF64C3E), + c600 = Color(0xFFE8433E), + c700 = Color(0xFFD53A37), + c800 = Color(0xFFC83430), + c900 = Color(0xFFB92A25), + base = Color(0xFFD53A37), + container = Color(0xFFFFECEF), + ), + grayscale = CrewWikiGrayscaleScale( + c50 = Color(0xFFF3F4F6), + c100 = Color(0xFFE3E3E7), + c200 = Color(0xFFD9DADC), + c300 = Color(0xFFC7C8CA), + c400 = Color(0xFF9FA0A2), + c500 = Color(0xFF77787A), + c600 = Color(0xFF4F5052), + c700 = Color(0xFF36383D), + c800 = Color(0xFF27282A), + c900 = Color(0xFF18191A), + container = Color(0xFFF3F4F6), + border = Color(0xFFE3E3E7), + lightText = Color(0xFF9FA0A2), + text = Color(0xFF27282A), + ), +) + +internal val LocalCrewWikiPalette = staticCompositionLocalOf { CrewWikiLightPalette } + +internal val CrewWikiLightColorScheme = lightColorScheme( + primary = CrewWikiLightPalette.primary.base, + onPrimary = CrewWikiLightPalette.white, + primaryContainer = CrewWikiLightPalette.primary.container, + onPrimaryContainer = CrewWikiLightPalette.primary.onContainer, + secondary = CrewWikiLightPalette.secondary.base, + onSecondary = CrewWikiLightPalette.white, + secondaryContainer = CrewWikiLightPalette.secondary.container, + onSecondaryContainer = CrewWikiLightPalette.secondary.onContainer, + tertiary = CrewWikiLightPalette.grayscale.c700, + onTertiary = CrewWikiLightPalette.white, + tertiaryContainer = CrewWikiLightPalette.grayscale.c50, + onTertiaryContainer = CrewWikiLightPalette.grayscale.text, + background = CrewWikiLightPalette.grayscale.container, + onBackground = CrewWikiLightPalette.grayscale.text, + surface = CrewWikiLightPalette.white, + onSurface = CrewWikiLightPalette.grayscale.text, + surfaceVariant = CrewWikiLightPalette.grayscale.c50, + onSurfaceVariant = CrewWikiLightPalette.grayscale.c600, + outline = CrewWikiLightPalette.grayscale.border, + outlineVariant = CrewWikiLightPalette.grayscale.c100, + error = CrewWikiLightPalette.error.base, + onError = CrewWikiLightPalette.white, + errorContainer = CrewWikiLightPalette.error.container, + onErrorContainer = CrewWikiLightPalette.error.c900, + surfaceTint = CrewWikiLightPalette.primary.base, +) diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiDesignTokens.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiDesignTokens.kt new file mode 100644 index 0000000..406e08d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiDesignTokens.kt @@ -0,0 +1,61 @@ +package com.example.crew_wiki + +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp + +@Immutable +data class CrewWikiSpacing( + val xxs: Dp = 2.dp, + val xs: Dp = 4.dp, + val sm: Dp = 8.dp, + val md: Dp = 12.dp, + val lg: Dp = 16.dp, + val xl: Dp = 24.dp, + val xxl: Dp = 32.dp, +) + +@Immutable +data class CrewWikiRadius( + val sm: Dp = 8.dp, + val md: Dp = 12.dp, + val lg: Dp = 16.dp, + val pillXs: Dp = 18.dp, + val pillSm: Dp = 22.dp, + val pillMd: Dp = 28.dp, + val full: Dp = 999.dp, +) + +@Immutable +data class CrewWikiComponentSize( + val buttonXxsHeight: Dp = 24.dp, + val buttonXsHeight: Dp = 36.dp, + val buttonSmHeight: Dp = 44.dp, + val buttonMdHeight: Dp = 56.dp, + val fieldHeight: Dp = 44.dp, + val largeFieldHeight: Dp = 56.dp, +) + +internal val LocalCrewWikiSpacing = staticCompositionLocalOf { CrewWikiSpacing() } +internal val LocalCrewWikiRadius = staticCompositionLocalOf { CrewWikiRadius() } +internal val LocalCrewWikiComponentSize = staticCompositionLocalOf { CrewWikiComponentSize() } + +object CrewWikiDesignTokens { + val colors: CrewWikiPalette + @Composable get() = LocalCrewWikiPalette.current + + val spacing: CrewWikiSpacing + @Composable get() = LocalCrewWikiSpacing.current + + val radius: CrewWikiRadius + @Composable get() = LocalCrewWikiRadius.current + + val components: CrewWikiComponentSize + @Composable get() = LocalCrewWikiComponentSize.current + + val typography + @Composable get() = MaterialTheme.typography +} diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiTheme.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiTheme.kt new file mode 100644 index 0000000..ebf11df --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/CrewWikiTheme.kt @@ -0,0 +1,160 @@ +package com.example.crew_wiki + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Shapes +import androidx.compose.material3.Typography +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp +import androidx.compose.foundation.shape.RoundedCornerShape +import org.jetbrains.compose.resources.Font + +import crewwiki.shared.generated.resources.Res +import crewwiki.shared.generated.resources.bm_hanna_pro +import crewwiki.shared.generated.resources.pretendard_bold +import crewwiki.shared.generated.resources.pretendard_medium +import crewwiki.shared.generated.resources.pretendard_regular +import crewwiki.shared.generated.resources.pretendard_semibold + +@Composable +fun CrewWikiTheme(content: @Composable () -> Unit) { + val palette = CrewWikiLightPalette + val spacing = CrewWikiSpacing() + val radius = CrewWikiRadius() + val componentSize = CrewWikiComponentSize() + val pretendard = FontFamily( + Font(Res.font.pretendard_regular, FontWeight.Normal), + Font(Res.font.pretendard_medium, FontWeight.Medium), + Font(Res.font.pretendard_semibold, FontWeight.SemiBold), + Font(Res.font.pretendard_bold, FontWeight.Bold), + ) + val bmHanna = FontFamily( + Font(Res.font.bm_hanna_pro, FontWeight.Normal), + ) + + CompositionLocalProvider( + LocalCrewWikiPalette provides palette, + LocalCrewWikiSpacing provides spacing, + LocalCrewWikiRadius provides radius, + LocalCrewWikiComponentSize provides componentSize, + ) { + MaterialTheme( + colorScheme = CrewWikiLightColorScheme, + typography = crewWikiTypography( + pretendard = pretendard, + bmHanna = bmHanna, + ), + shapes = crewWikiShapes(radius), + content = content, + ) + } +} + +private fun crewWikiTypography( + pretendard: FontFamily, + bmHanna: FontFamily, +): Typography { + return Typography( + displayLarge = TextStyle( + fontFamily = bmHanna, + fontWeight = FontWeight.Normal, + fontSize = 40.sp, + lineHeight = 48.sp, + ), + displayMedium = TextStyle( + fontFamily = bmHanna, + fontWeight = FontWeight.Normal, + fontSize = 32.sp, + lineHeight = 40.sp, + ), + displaySmall = TextStyle( + fontFamily = bmHanna, + fontWeight = FontWeight.Normal, + fontSize = 24.sp, + lineHeight = 32.sp, + ), + headlineLarge = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.SemiBold, + fontSize = 24.sp, + lineHeight = 32.sp, + ), + headlineMedium = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.SemiBold, + fontSize = 20.sp, + lineHeight = 28.sp, + ), + headlineSmall = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.SemiBold, + fontSize = 18.sp, + lineHeight = 24.sp, + ), + titleLarge = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 18.sp, + lineHeight = 24.sp, + ), + titleMedium = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 16.sp, + lineHeight = 24.sp, + ), + titleSmall = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 14.sp, + lineHeight = 20.sp, + ), + bodyLarge = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + ), + bodyMedium = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Normal, + fontSize = 14.sp, + lineHeight = 20.sp, + ), + bodySmall = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 16.sp, + ), + labelLarge = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 14.sp, + lineHeight = 20.sp, + ), + labelMedium = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 12.sp, + lineHeight = 16.sp, + ), + labelSmall = TextStyle( + fontFamily = pretendard, + fontWeight = FontWeight.Medium, + fontSize = 10.sp, + lineHeight = 14.sp, + ), + ) +} + +private fun crewWikiShapes(radius: CrewWikiRadius): Shapes { + return Shapes( + small = RoundedCornerShape(radius.sm), + medium = RoundedCornerShape(radius.md), + large = RoundedCornerShape(radius.lg), + ) +} diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/Greeting.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/Greeting.kt new file mode 100644 index 0000000..bdf2f57 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/Greeting.kt @@ -0,0 +1,9 @@ +package com.example.crew_wiki + +class Greeting { + private val platform = getPlatform() + + fun greet(): String { + return sayHello(platform.name) + } +} \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/GreetingUtil.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/GreetingUtil.kt new file mode 100644 index 0000000..2001151 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/GreetingUtil.kt @@ -0,0 +1,4 @@ +package com.example.crew_wiki + +fun sayHello(to: String): String = + "Hello, $to!" \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/com/example/crew_wiki/Platform.kt b/shared/src/commonMain/kotlin/com/example/crew_wiki/Platform.kt new file mode 100644 index 0000000..f326187 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/example/crew_wiki/Platform.kt @@ -0,0 +1,7 @@ +package com.example.crew_wiki + +interface Platform { + val name: String +} + +expect fun getPlatform(): Platform \ No newline at end of file diff --git a/shared/src/commonTest/kotlin/com/example/crew_wiki/SharedCommonTest.kt b/shared/src/commonTest/kotlin/com/example/crew_wiki/SharedCommonTest.kt new file mode 100644 index 0000000..30fbe9a --- /dev/null +++ b/shared/src/commonTest/kotlin/com/example/crew_wiki/SharedCommonTest.kt @@ -0,0 +1,12 @@ +package com.example.crew_wiki + +import kotlin.test.Test +import kotlin.test.assertEquals + +class SharedCommonTest { + + @Test + fun example() { + assertEquals(3, 1 + 2) + } +} \ No newline at end of file diff --git a/shared/src/iosMain/kotlin/com/example/crew_wiki/MainViewController.kt b/shared/src/iosMain/kotlin/com/example/crew_wiki/MainViewController.kt new file mode 100644 index 0000000..d4831c5 --- /dev/null +++ b/shared/src/iosMain/kotlin/com/example/crew_wiki/MainViewController.kt @@ -0,0 +1,5 @@ +package com.example.crew_wiki + +import androidx.compose.ui.window.ComposeUIViewController + +fun MainViewController() = ComposeUIViewController { App() } \ No newline at end of file diff --git a/shared/src/iosMain/kotlin/com/example/crew_wiki/Platform.ios.kt b/shared/src/iosMain/kotlin/com/example/crew_wiki/Platform.ios.kt new file mode 100644 index 0000000..ce77813 --- /dev/null +++ b/shared/src/iosMain/kotlin/com/example/crew_wiki/Platform.ios.kt @@ -0,0 +1,9 @@ +package com.example.crew_wiki + +import platform.UIKit.UIDevice + +class IOSPlatform: Platform { + override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion +} + +actual fun getPlatform(): Platform = IOSPlatform() \ No newline at end of file diff --git a/shared/src/iosTest/kotlin/com/example/crew_wiki/SharedLogicIOSTest.kt b/shared/src/iosTest/kotlin/com/example/crew_wiki/SharedLogicIOSTest.kt new file mode 100644 index 0000000..a14f79b --- /dev/null +++ b/shared/src/iosTest/kotlin/com/example/crew_wiki/SharedLogicIOSTest.kt @@ -0,0 +1,12 @@ +package com.example.crew_wiki + +import kotlin.test.Test +import kotlin.test.assertEquals + +class SharedLogicIOSTest { + + @Test + fun example() { + assertEquals(3, 1 + 2) + } +} \ No newline at end of file