blob: 7ac99bad449c52f510554d7c83630aeb6bf2f197 [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.
*/
/**
* This file was created using the `create_project.py` script located in the
* `<AndroidX root>/development/project-creator` directory.
*
* Please use that script when creating a new project, rather than copying an existing project and
* modifying its settings.
*/
import androidx.build.AndroidXConfig
import androidx.build.BuildOnServerKt
plugins {
id("AndroidXPlugin")
id("AndroidXComposePlugin")
}
androidXMultiplatform {
// Compose Desktop is qualified on "desktop" but actually builds as "jvm".
jvm()
sourceSets {
commonMain {
dependencies {
}
}
commonTest {
dependencies {
}
}
jvmMain {
dependsOn(commonMain)
resources.srcDirs += new File(AndroidXConfig.getExternalProjectPath(project),
"noto-fonts/other/")
resources.srcDirs += "src/jvmMain/res"
dependencies {
implementation(libs.skikoCurrentOs)
implementation(project(":compose:desktop:desktop"))
}
}
jvmTest {
dependsOn(commonTest)
dependencies {
}
}
}
}
task run1(type: JavaExec) {
mainClass.set("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) {
mainClass.set("androidx.compose.desktop.examples.example2.Main_jvmKt")
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run3(type: JavaExec) {
mainClass.set("androidx.compose.desktop.examples.popupexample.Main_jvmKt")
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task run4(type: JavaExec) {
mainClass.set("androidx.compose.desktop.examples.swingexample.Main_jvmKt")
def compilation = kotlin.jvm().compilations["main"]
classpath =
compilation.output.allOutputs +
compilation.runtimeDependencyFiles
}
task runVsync(type: JavaExec) {
mainClass.set("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) {
mainClass.set("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")
}
// Validate desktop build by explicitly building the jvmJar task as part of bOS.
BuildOnServerKt.addToBuildOnServer(project, "${project.path}:jvmJar")