Skip to content

Commit

Permalink
Cleanup Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Aug 9, 2023
1 parent 47ad183 commit 33a675f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 41 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions app/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import dev.schlaubi.tonbrett.gradle.sdkInt
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName

plugins {
kotlin("android")
Expand All @@ -20,6 +19,10 @@ dependencies {
implementation(libs.kotlinx.coroutines.play.services)
}

base {
archivesName = "tonbrett-app"
}

android {
namespace = "dev.schlaubi.tonbrett.app.android"
compileSdk = sdkInt
Expand All @@ -35,12 +38,6 @@ android {
release {
isMinifyEnabled = true
proguardFile("proguard-rules.pro")

applicationVariants.all {
outputs.all {
archivesName = "tonbrett-app"
}
}
}
}
buildFeatures {
Expand Down
9 changes: 0 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
kotlin("jvm") apply false
kotlin("multiplatform") apply false
kotlin("android") apply false
alias(libs.plugins.compose) apply false
}

allprojects {
repositories {
google()
Expand Down
11 changes: 5 additions & 6 deletions app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies {
implementation(libs.ktor.server.cors)
}


compose.desktop {
application {
mainClass = "dev.schlaubi.tonbrett.app.desktop.MainKt"
Expand All @@ -38,30 +37,30 @@ compose.desktop {
packageVersion = project.version.toString()

windows {
iconFile.set(rootProject.file("icons/logo.ico"))
iconFile = rootProject.file("icons/logo.ico")
menuGroup = "Tonbrett"
upgradeUuid = "c8bce0ed-113c-4d78-879b-78ed5c7d9f7f"
}

macOS {
iconFile.set(rootProject.file("icons/logo.icns"))
iconFile = rootProject.file("icons/logo.icns")
bundleID = "dev.schlaubi.tonbrett.app.mac"
entitlementsFile.set(file("entitlements.entitlements"))
appStore = false
signing {
identity = "Michael Rittmeister"
}
notarization {
appleID.set("[email protected]")
password.set(System.getenv("NOTARIZATION_PASSWORD"))
appleID = "[email protected]"
password = System.getenv("NOTARIZATION_PASSWORD")
}
}
}

buildTypes {
release {
proguard {
version = "7.3.2"
version = "7.3.3"
configurationFiles.from(files("rules.pro"))
}
}
Expand Down
14 changes: 7 additions & 7 deletions app/web/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.compose.ExperimentalComposeLibrary

plugins {
kotlin("multiplatform")
Expand All @@ -10,9 +10,11 @@ kotlin {
browser()
binaries.executable()
compilations.all {
compilerOptions.options.freeCompilerArgs.addAll(
"-Xir-per-module", "-Xir-property-lazy-initialization"
)
compilerOptions.configure {
freeCompilerArgs.addAll(
"-Xir-per-module", "-Xir-property-lazy-initialization"
)
}
}
}

Expand All @@ -28,7 +30,7 @@ kotlin {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
implementation(compose.materialIconsExtended)
}
Expand All @@ -52,5 +54,3 @@ tasks {
compose.experimental {
web.application {}
}

rootProject.the<NodeJsRootExtension>().versions.webpack.version = "5.76.2"
18 changes: 9 additions & 9 deletions bot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dev.schlaubi.mikbot.gradle.mikbot
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import kotlin.io.path.div

plugins {
alias(libs.plugins.ksp)
Expand All @@ -19,6 +19,12 @@ dependencies {
plugin(libs.mikbot.music)
}

kotlin {
compilerOptions {
freeCompilerArgs.add("-Xcontext-receivers")
}
}

fun DependencyHandlerScope.ktorDependency(dependency: ProviderConvertible<*>) = ktorDependency(dependency.asProvider())
fun DependencyHandlerScope.ktorDependency(dependency: Provider<*>) = implementation(dependency) {
exclude(module = "ktor-server-core")
Expand All @@ -43,16 +49,10 @@ tasks {
)
}

withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.add("-Xcontext-receivers")
}
}

val buildWebApp = register<Copy>("buildWebApp") {
val webApp = project(":app:web")
from(webApp.tasks.getByName("jsBrowserDistribution"))
into(buildDir.resolve("resources").resolve("main").resolve("web"))
from(webApp.tasks.named("jsBrowserDistribution"))
into(buildDir.toPath() / "resources" / "main" / "web")
}

classes {
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose) apply false
}

allprojects {
Expand Down
5 changes: 4 additions & 1 deletion client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import dev.schlaubi.tonbrett.gradle.androidSdk
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -77,4 +76,8 @@ kotlin {
android {
namespace = "dev.schlaubi.tonbrett.client"
compileSdkVersion = androidSdk
compileOptions {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pluginManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0"
}

rootProject.name = "tonbrett"
Expand Down

0 comments on commit 33a675f

Please sign in to comment.