-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'e026c576ae49117aa284de459fb2e2272c4e52af'
- Loading branch information
Showing
211 changed files
with
17,867 additions
and
2,790 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
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
34 changes: 34 additions & 0 deletions
34
material/conferences/2024-02-laug-meetup/kmp-wizard-fullstack/.fleet/receipt.json
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,34 @@ | ||
// Project generated by Kotlin Multiplatform Wizard | ||
{ | ||
"spec": { | ||
"template_id": "kmt", | ||
"targets": { | ||
"android": { | ||
"ui": [ | ||
"compose" | ||
] | ||
}, | ||
"ios": { | ||
"ui": [ | ||
"compose" | ||
] | ||
}, | ||
"desktop": { | ||
"ui": [ | ||
"compose" | ||
] | ||
}, | ||
"web": { | ||
"ui": [ | ||
"compose" | ||
] | ||
}, | ||
"server": { | ||
"engine": [ | ||
"ktor" | ||
] | ||
} | ||
} | ||
}, | ||
"timestamp": "2024-02-11T15:34:24.178773992Z" | ||
} |
17 changes: 17 additions & 0 deletions
17
material/conferences/2024-02-laug-meetup/kmp-wizard-fullstack/.gitignore
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,17 @@ | ||
*.iml | ||
.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 |
27 changes: 27 additions & 0 deletions
27
material/conferences/2024-02-laug-meetup/kmp-wizard-fullstack/README.md
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,27 @@ | ||
This is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop, Server. | ||
|
||
* `/composeApp` is for code that will be shared across your Compose Multiplatform applications. | ||
It contains several subfolders: | ||
- `commonMain` 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, | ||
`iosMain` would be the right folder for such calls. | ||
|
||
* `/iosApp` contains iOS applications. 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. | ||
|
||
* `/server` is for the Ktor server application. | ||
|
||
* `/shared` is for the code that will be shared between all targets in the project. | ||
The most important subfolder is `commonMain`. If preferred, you can add code to the platform-specific folders here too. | ||
|
||
|
||
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html), | ||
[Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform/#compose-multiplatform), | ||
[Kotlin/Wasm](https://kotl.in/wasm/)… | ||
|
||
**Note:** Compose/Web is Experimental and may be changed at any time. Use it only for evaluation purposes. | ||
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel [#compose-web](https://slack-chats.kotlinlang.org/c/compose-web). | ||
If you face any issues, please report them on [GitHub](https://github.com/JetBrains/compose-multiplatform/issues). | ||
|
||
You can open the web application by running the `:composeApp:wasmJsBrowserDevelopmentRun` Gradle task. |
9 changes: 9 additions & 0 deletions
9
material/conferences/2024-02-laug-meetup/kmp-wizard-fullstack/build.gradle.kts
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,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.androidLibrary) apply false | ||
alias(libs.plugins.jetbrainsCompose) apply false | ||
alias(libs.plugins.kotlinJvm) apply false | ||
alias(libs.plugins.kotlinMultiplatform) apply false | ||
} |
114 changes: 114 additions & 0 deletions
114
material/conferences/2024-02-laug-meetup/kmp-wizard-fullstack/composeApp/build.gradle.kts
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,114 @@ | ||
import org.jetbrains.compose.ExperimentalComposeLibrary | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.jetbrainsCompose) | ||
} | ||
|
||
kotlin { | ||
@OptIn(ExperimentalWasmDsl::class) | ||
wasmJs { | ||
moduleName = "composeApp" | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "composeApp.js" | ||
} | ||
} | ||
binaries.executable() | ||
} | ||
|
||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
jvm("desktop") | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
val desktopMain by getting | ||
|
||
androidMain.dependencies { | ||
implementation(libs.compose.ui.tooling.preview) | ||
implementation(libs.androidx.activity.compose) | ||
} | ||
commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.ui) | ||
@OptIn(ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
implementation(projects.shared) | ||
} | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "org.example.project" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
|
||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
sourceSets["main"].res.srcDirs("src/androidMain/res") | ||
sourceSets["main"].resources.srcDirs("src/commonMain/resources") | ||
|
||
defaultConfig { | ||
applicationId = "org.example.project" | ||
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_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
dependencies { | ||
debugImplementation(libs.compose.ui.tooling) | ||
} | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "MainKt" | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageName = "org.example.project" | ||
packageVersion = "1.0.0" | ||
} | ||
} | ||
} | ||
|
||
compose.experimental { | ||
web.application {} | ||
} |
23 changes: 23 additions & 0 deletions
23
...s/2024-02-laug-meetup/kmp-wizard-fullstack/composeApp/src/androidMain/AndroidManifest.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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@android:style/Theme.Material.Light.NoActionBar"> | ||
<activity | ||
android:exported="true" | ||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode" | ||
android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
24 changes: 24 additions & 0 deletions
24
...mp-wizard-fullstack/composeApp/src/androidMain/kotlin/org/example/project/MainActivity.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,24 @@ | ||
package org.example.project | ||
|
||
import App | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
||
class MainActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
setContent { | ||
App() | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun AppAndroidPreview() { | ||
App() | ||
} |
30 changes: 30 additions & 0 deletions
30
...p-wizard-fullstack/composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.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,30 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="108dp" | ||
android:height="108dp" | ||
android:viewportWidth="108" | ||
android:viewportHeight="108"> | ||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
<aapt:attr name="android:fillColor"> | ||
<gradient | ||
android:endX="85.84757" | ||
android:endY="92.4963" | ||
android:startX="42.9492" | ||
android:startY="49.59793" | ||
android:type="linear"> | ||
<item | ||
android:color="#44000000" | ||
android:offset="0.0" /> | ||
<item | ||
android:color="#00000000" | ||
android:offset="1.0" /> | ||
</gradient> | ||
</aapt:attr> | ||
</path> | ||
<path | ||
android:fillColor="#FFFFFF" | ||
android:fillType="nonZero" | ||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
android:strokeWidth="1" | ||
android:strokeColor="#00000000" /> | ||
</vector> |
Oops, something went wrong.