update gradle scripts to improve performance of configuration

This commit is contained in:
InsanusMokrassar 2024-08-27 18:57:59 +06:00
parent 1ee9c88ffd
commit 4601eab864
71 changed files with 95 additions and 260 deletions

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppAndroidProjectPresetPath"
apply from: "$mppAndroidProject"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppAndroidProjectPresetPath"
apply from: "$mppAndroidProject"
kotlin {
sourceSets {

View File

@ -6,7 +6,7 @@ plugins {
alias(libs.plugins.kt.jb.compose)
}
apply from: "$mppProjectWithSerializationAndComposePresetPath"
apply from: "$mppProjectWithSerializationAndCompose"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppAndroidProjectPresetPath"
apply from: "$mppAndroidProject"
kotlin {
sourceSets {

View File

@ -6,7 +6,7 @@ plugins {
alias(libs.plugins.kt.jb.compose)
}
apply from: "$mppProjectWithSerializationAndComposePresetPath"
apply from: "$mppProjectWithSerializationAndCompose"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -6,7 +6,7 @@ plugins {
alias(libs.plugins.kt.jb.compose)
}
apply from: "$mppComposeJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppComposeJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -6,7 +6,7 @@ plugins {
alias(libs.plugins.kt.jb.compose)
}
apply from: "$mppComposeJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppComposeJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -130,4 +130,4 @@ tasks.dokkaHtml {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"

View File

@ -1,43 +1,32 @@
allprojects {
ext {
projectByName = { name ->
File templatesFolder = new File("$rootProject.projectDir.absolutePath${File.separatorChar}gradle${File.separatorChar}templates")
Map properties = new HashMap<String, String>()
if (templatesFolder.exists() && templatesFolder.isDirectory()) {
templatesFolder.listFiles().each {
properties[it.name - ".gradle"] = it.absolutePath
}
}
properties["projectByName"] = { name ->
for (subproject in rootProject.subprojects) {
if (subproject.name == name) {
return subproject
}
}
return null
}
}
internalProject = { name ->
// if (releaseMode) {
// "$group:$name:$version"
// } else {
// projectByName("$name")
// }
properties["internalProject"] = { name ->
projectByName("$name")
}
}
allprojects {
ext {
releaseMode = (project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true"
// String compilerPluginVersionFromProperties = (String) project.properties["compose.kotlinCompilerPluginVersion"]
// String compilerPluginVersionFromLibrariesVersions = libs.versions.compose.kotlin.get()
// composePluginKotlinVersion = compilerPluginVersionFromProperties
// if (compilerPluginVersionFromProperties == null) {
// composePluginKotlinVersion = compilerPluginVersionFromLibrariesVersions
// }
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppJvmJsAndroidProject.gradle"
mppProjectWithSerializationAndComposePresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerializationAndCompose.gradle"
mppJavaProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJavaProject.gradle"
mppJvmJsLinuxMingwProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJvmJsLinuxMingwProject.gradle"
mppJvmJsLinuxMingwLinuxArm64ProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJvmJsLinuxMingwLinuxArm64Project.gradle"
mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJvmJsAndroidLinuxMingwLinuxArm64Project.gradle"
mppComposeJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppComposeJvmJsAndroidLinuxMingwLinuxArm64Project.gradle"
mppAndroidProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppAndroidProject.gradle"
defaultAndroidSettingsPresetPath = "${rootProject.projectDir.absolutePath}/defaultAndroidSettings.gradle"
publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle"
publishJvmOnlyPath = "${rootProject.projectDir.absolutePath}/jvm.publish.gradle"
properties.forEach { k, v ->
it[k] = v
}
}
}

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
androidTarget {
@ -29,7 +29,7 @@ kotlin {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"
java {
sourceCompatibility = JavaVersion.VERSION_17

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
jvm {
@ -100,7 +100,7 @@ kotlin {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"
java {
sourceCompatibility = JavaVersion.VERSION_17

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
jvm {

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
jvm {
@ -80,7 +80,7 @@ kotlin {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"
java {
sourceCompatibility = JavaVersion.VERSION_17

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
jvm {

View File

@ -1,7 +1,7 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
apply from: "$publish"
kotlin {
jvm {
@ -83,7 +83,7 @@ kotlin {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"
java {
sourceCompatibility = JavaVersion.VERSION_17

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
apply from: "$publishJvmOnlyPath"
apply from: "$publish_jvm"
repositories {
mavenCentral()

View File

@ -5,7 +5,7 @@ plugins {
id "com.google.devtools.ksp"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
apply from: "$publishJvmOnlyPath"
apply from: "$publish_jvm"
repositories {
mavenCentral()

View File

@ -5,7 +5,7 @@ plugins {
id "com.google.devtools.ksp"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {

View File

@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
apply from: "$publishJvmOnlyPath"
apply from: "$publish_jvm"
repositories {
mavenCentral()

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
apply from: "$publishJvmOnlyPath"
apply from: "$publish_jvm"
repositories {
mavenCentral()

View File

@ -5,7 +5,7 @@ plugins {
id "com.google.devtools.ksp"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -1,82 +0,0 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
kotlin {
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "17"
}
}
}
js (IR) {
browser {
testTask {
useMocha {
timeout = "60000"
}
}
}
nodejs {
testTask {
useMocha {
timeout = "60000"
}
}
}
}
androidTarget {
publishAllLibraryVariants()
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
}
linuxX64()
mingwX64()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api libs.kt.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kt.coroutines.test
}
}
jvmTest {
dependencies {
implementation kotlin('test-junit')
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
}
}
androidUnitTest {
dependencies {
implementation kotlin('test-junit')
implementation libs.android.test.junit
implementation libs.android.espresso
}
}
androidMain.dependsOn jvmMain
}
}
apply from: "$defaultAndroidSettingsPresetPath"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

View File

@ -1,72 +0,0 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
kotlin {
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "17"
}
}
}
js (IR) {
browser {
testTask {
useMocha {
timeout = "60000"
}
}
}
nodejs {
testTask {
useMocha {
timeout = "60000"
}
}
}
}
linuxX64()
mingwX64()
linuxArm64()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api libs.kt.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kt.coroutines.test
}
}
jvmTest {
dependencies {
implementation kotlin('test-junit')
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
}
}
nativeMain.dependsOn commonMain
linuxX64Main.dependsOn nativeMain
mingwX64Main.dependsOn nativeMain
linuxArm64Main.dependsOn nativeMain
androidMain.dependsOn jvmMain
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -61,7 +61,7 @@ kotlin {
}
}
apply from: "$defaultAndroidSettingsPresetPath"
apply from: "$defaultAndroidSettings"
java {
sourceCompatibility = JavaVersion.VERSION_17

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {

View File

@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
apply from: "$publishJvmOnlyPath"
apply from: "$publish_jvm"
repositories {
mavenCentral()

View File

@ -5,7 +5,7 @@ plugins {
id "com.google.devtools.ksp"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,7 +4,7 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -5,7 +5,7 @@ plugins {
id "com.google.devtools.ksp"
}
apply from: "$mppJvmJsLinuxMingwProjectPresetPath"
apply from: "$mppJvmJsLinuxMingwProject"
kotlin {
sourceSets {

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJvmJsLinuxMingwProjectPresetPath"
apply from: "$mppJvmJsLinuxMingwProject"
kotlin {
sourceSets {

View File

@ -5,7 +5,7 @@ plugins {
alias(libs.plugins.compose)
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"
kotlin {
sourceSets {

View File

@ -4,4 +4,4 @@ plugins {
id "com.android.library"
}
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath"
apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64Project"

View File

@ -3,7 +3,7 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"
apply from: "$mppJavaProject"
kotlin {
sourceSets {