blob: bd9aa37d24c65948cad5fdb600e22698712168b7 [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.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.SupportConfigKt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import static androidx.build.dependencies.DependenciesKt.*
plugins {
id("AndroidXPlugin")
id("AndroidXUiPlugin")
id("kotlin-multiplatform")
}
repositories {
// To allow using local Skija build.
// mavenLocal()
}
dependencies {
kotlinPlugin project(path: ":compose:compose-compiler")
}
kotlin {
jvm()
sourceSets {
commonMain.dependencies {
api(KOTLIN_STDLIB_COMMON)
api project(":compose:runtime:runtime")
api project(":compose:ui:ui")
api project(":compose:foundation:foundation")
api project(":compose:material:material")
}
jvmMain.dependencies {
api(KOTLIN_STDLIB)
api(KOTLIN_STDLIB_JDK8)
api(KOTLIN_COROUTINES_CORE)
api(SKIJA)
implementation(KOTLIN_COROUTINES_SWING)
implementation "org.jogamp.jogl:jogl-all:2.4.0-rc-20200306"
implementation "org.jogamp.jogl:jogl-all-natives-linux-amd64:2.4.0-rc-20200306"
implementation "org.jogamp.jogl:jogl-all-natives-macosx-universal:2.4.0-rc-20200306"
implementation "org.jogamp.gluegen:gluegen-rt:2.4.0-rc-20200306"
implementation "org.jogamp.gluegen:gluegen-rt-natives-linux-amd64:2.4.0-rc-20200306"
implementation "org.jogamp.gluegen:gluegen-rt-natives-macosx-universal:2.4.0-rc-20200306"
// TODO: move to jvmTest
implementation(JUNIT)
}
jvmTest {
resources.srcDirs += new File(SupportConfigKt.getExternalProjectPath(project), "noto-fonts/other/")
resources.srcDirs += "src/jvmTest/res"
dependencies {
implementation(TRUTH)
}
}
}
}
tasks.findByName("jvmTest").configure {
systemProperties['GOLDEN_PATH'] = project.rootDir.absolutePath + "/../../../golden"
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
useIR = true
}
}
project.tasks.register("jar", Jar).configure {
baseName = "desktop"
from { kotlin.jvm().compilations["main"].output.allOutputs }
}
rootProject.tasks.getByName("buildOnServer").configure {
dependsOn(":compose:desktop:desktop:jar")
}