Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaros committed Oct 10, 2023
0 parents commit e338ef6
Show file tree
Hide file tree
Showing 81 changed files with 9,763 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gradle
.idea
build
refresh.sh
refreshW.sh

149 changes: 149 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* Copyright (c) 2023-present Robert Jaros
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

plugins {
val kotlinVersion: String by System.getProperties()
kotlin("multiplatform") version kotlinVersion
val composeVersion: String by System.getProperties()
id("org.jetbrains.compose") version composeVersion
}

val isInIdea = System.getProperty("idea.vendor.name") != null

allprojects {
repositories {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
mavenLocal()
}
version = project.properties["versionNumber"]!!
if (hasProperty("SNAPSHOT")) {
version = "$version-SNAPSHOT"
}
}

val buildTarget: String by project

val kotlinVersion: String by System.getProperties()
val serializationVersion: String by project
val coroutinesVersion: String by project

val cssLoaderVersion: String by project
val styleLoaderVersion: String by project
val importsLoaderVersion: String by project

rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
resolution("css-loader", cssLoaderVersion)
resolution("style-loader", styleLoaderVersion)
resolution("imports-loader", importsLoaderVersion)
}
}

@OptIn(ExperimentalWasmDsl::class)
kotlin {
explicitApi()
if (buildTarget == "js" || !isInIdea) {
js(IR) {
// useEsModules()
browser {
commonWebpackConfig {
outputFileName = "main.bundle.js"
}
runTask {
sourceMaps = false
devServer = KotlinWebpackConfig.DevServer(
static = mutableListOf("../../../processedResources/js/main")
)
}
testTask {
useKarma {
useChromeHeadless()
}
}
}
binaries.executable()
}
}
if (buildTarget == "wasm" || !isInIdea) {
wasmJs {
useEsModules()
browser {
commonWebpackConfig {
outputFileName = "main.bundle.js"
}
runTask {
sourceMaps = false
}
testTask {
useKarma {
useChromeHeadlessWasmGc()
}
}
}
binaries.executable()
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation(npm("css-loader", cssLoaderVersion))
implementation(npm("style-loader", styleLoaderVersion))
implementation(npm("imports-loader", importsLoaderVersion))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
if (buildTarget == "js" || !isInIdea) {
val jsMain by getting {
dependencies {
}
}
}
if (buildTarget == "wasm" || !isInIdea) {
val wasmJsMain by getting {
dependencies {
}
}
}
}
}

compose {
val composePluginVersion: String by System.getProperties()
kotlinCompilerPlugin.set(composePluginVersion)
val kotlinVersion: String by System.getProperties()
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=$kotlinVersion")
}
48 changes: 48 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright (c) 2023-present Robert Jaros
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

buildTarget=js
#buildTarget=wasm

group=dev.kilua
versionNumber=0.0.1

systemProp.kotlinVersion=1.9.20-Beta2
systemProp.composePluginVersion=1.5.2.1-Beta
systemProp.composeVersion=1.5.1-dev-wasm01
javaVersion=17
coroutinesVersion=1.7.2-wasm1
serializationVersion=1.6.0-wasm0

cssLoaderVersion=6.8.1
styleLoaderVersion=3.3.3
importsLoaderVersion=4.0.1

systemProp.org.gradle.internal.publish.checksums.insecure=true
org.gradle.jvmargs=-Xmx6g
kotlin.mpp.stability.nowarn=true

org.gradle.parallel=true
#org.gradle.caching=true
#org.gradle.unsafe.configuration-cache=true
#org.gradle.unsafe.configuration-cache-problems=warn
org.gradle.kotlin.dsl.precompiled.accessors.strict=true
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e338ef6

Please sign in to comment.