blob: 1668f8bd565c26a5a882f9ae3f966952d4b83d7c [file] [log] [blame]
/*
* Copyright 2020 The Android Open Source Project
*
* 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
*
* http://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.
*/
import androidx.build.BuildOnServerKt
import androidx.build.SupportConfigKt
plugins {
id("AndroidXPlugin")
id("AndroidXComposePlugin")
id("kotlin-multiplatform")
}
dependencies {
kotlinPlugin(project(":compose:compiler:compiler"))
}
kotlin {
jvm()
sourceSets {
jvmMain {
resources.srcDirs += new File(SupportConfigKt.getExternalProjectPath(project), "noto-fonts/other/")
resources.srcDirs += "src/jvmMain/res"
}
jvmMain.dependencies {
implementation(libs.skikoCurrentOs)
implementation(project(":compose:desktop:desktop"))
}
}
}
task run1(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.example1.Main_jvmKt"
systemProperty("skiko.fps.enabled", "true")
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run2(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.example2.Main_jvmKt"
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run3(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.popupexample.Main_jvmKt"
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run4(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.swingexample.Main_jvmKt"
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task runVsync(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.vsynctest.Main_jvmKt"
jvmArgs("-verbose:gc")
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task runWindowApi(type: JavaExec) {
dependsOn(":compose:desktop:desktop:jar")
main = "androidx.compose.desktop.examples.windowapi.Main_jvmKt"
def compilation = kotlin.jvm().compilations["main"]
systemProperty("skiko.rendering.laf.global", "true")
systemProperty("skiko.rendering.useScreenMenuBar", "true")
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run {
dependsOn("run1")
}
BuildOnServerKt.addToBuildOnServer(project, "${project.path}:jvmJar")