Skip to content

Commit

Permalink
Merge commit 'e026c576ae49117aa284de459fb2e2272c4e52af'
Browse files Browse the repository at this point in the history
  • Loading branch information
wlybe committed Apr 22, 2024
2 parents 27bc1f9 + e026c57 commit a66591d
Show file tree
Hide file tree
Showing 211 changed files with 17,867 additions and 2,790 deletions.
4,940 changes: 2,229 additions & 2,711 deletions docs/package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"license": "MIT",
"devDependencies": {
"@types/node": "^20.10.6",
"@vuepress/client": "^2.0.0-rc.0",
"@vuepress/plugin-medium-zoom": "^2.0.0-rc.0",
"@vuepress/plugin-nprogress": "^2.0.0-rc.0",
"@vuepress/plugin-pwa": "^2.0.0-rc.0",
"@vuepress/plugin-search": "^2.0.0-rc.0",
"vue": "^3.4.5",
"vuepress": "^2.0.0-rc.0",
"vuepress-plugin-md-enhance": "^2.0.0-rc.10",
"@vuepress/plugin-pwa-popup": "^2.0.0-rc.0"
"vue": "^3.4.15",
"vuepress": "^2.0.0-rc.8",
"@vuepress/client": "^2.0.0-rc.8",
"@vuepress/plugin-medium-zoom": "^2.0.0-rc.23",
"@vuepress/plugin-search": "^2.0.0-rc.21",
"@vuepress/theme-default": "^2.0.0-rc.8",
"vuepress-plugin-md-enhance": "^2.0.0-rc.23",
"@vuepress/plugin-pwa": "^2.0.0-rc.23",
"@vuepress/bundler-vite": "^2.0.0-rc.8"
}
}
26 changes: 8 additions & 18 deletions docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { pwaPlugin } from "@vuepress/plugin-pwa";
import { searchPlugin } from "@vuepress/plugin-search";
import { defaultTheme, defineUserConfig } from "vuepress";
import { defineUserConfig } from "vuepress";
import { defaultTheme } from "@vuepress/theme-default";
import { mediumZoomPlugin } from "@vuepress/plugin-medium-zoom";
import { mdEnhancePlugin } from "vuepress-plugin-md-enhance";
import { pwaPopupPlugin } from "@vuepress/plugin-pwa-popup";
import { viteBundler } from "@vuepress/bundler-vite";

export default defineUserConfig({
bundler: viteBundler({
viteOptions: {},
vuePluginOptions: {},
}),
shouldPrefetch: false,
base: "/learning-kotlin/",
port: 3001,
locales: {
Expand Down Expand Up @@ -75,27 +81,11 @@ export default defineUserConfig({
}),
pwaPlugin({}),
mediumZoomPlugin({}),
pwaPopupPlugin({
locales: {
"/en/": {
message: "New content is available.",
buttonText: "Refresh",
},
"/fr/": {
message: "Du nouveau contenu est disponible.",
buttonText: "Actualiser",
},
},
}),
mdEnhancePlugin({
imgLazyload: true,
imgSize: true,
figure: true,
imgMark: true,
}),
// nprogressPlugin(),
// seoPlugin({
// hostname: "https://worldline.github.io/learning-kotlin",
// }),
],
});
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"
}
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
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.
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
}
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 {}
}
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>
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()
}
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>
Loading

0 comments on commit a66591d

Please sign in to comment.