179 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			179 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/*
 | 
						|
 * Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
 | 
						|
 *
 | 
						|
 * 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 com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
 | 
						|
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
 | 
						|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
 | 
						|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
 | 
						|
 | 
						|
group = "net.sergeych"
 | 
						|
version = "0.9.3"
 | 
						|
 | 
						|
buildscript {
 | 
						|
    repositories {
 | 
						|
        mavenCentral()
 | 
						|
    }
 | 
						|
    dependencies {
 | 
						|
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
 | 
						|
        classpath("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:latest_version")
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
plugins {
 | 
						|
    alias(libs.plugins.kotlinMultiplatform)
 | 
						|
    alias(libs.plugins.androidLibrary)
 | 
						|
//    alias(libs.plugins.vanniktech.mavenPublish)
 | 
						|
    kotlin("plugin.serialization") version "2.1.0"
 | 
						|
    id("com.codingfeline.buildkonfig") version "0.17.1"
 | 
						|
    `maven-publish`
 | 
						|
}
 | 
						|
 | 
						|
buildkonfig {
 | 
						|
    packageName = "net.sergeych.lyng"
 | 
						|
    // objectName = "YourAwesomeConfig"
 | 
						|
    // exposeObjectWithName = "YourAwesomePublicConfig"
 | 
						|
 | 
						|
    defaultConfigs {
 | 
						|
        buildConfigField(STRING, "bcprovider", "codingfeline")
 | 
						|
        buildConfigField(STRING, "version", version.toString())
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
kotlin {
 | 
						|
    jvm()
 | 
						|
    androidTarget {
 | 
						|
        publishLibraryVariants("release")
 | 
						|
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
 | 
						|
        compilerOptions {
 | 
						|
            jvmTarget.set(JvmTarget.JVM_11)
 | 
						|
        }
 | 
						|
    }
 | 
						|
    iosX64()
 | 
						|
    iosArm64()
 | 
						|
    iosSimulatorArm64()
 | 
						|
    macosX64()
 | 
						|
    macosArm64()
 | 
						|
    mingwX64()
 | 
						|
    linuxX64()
 | 
						|
    linuxArm64()
 | 
						|
    js {
 | 
						|
        browser()
 | 
						|
        nodejs()
 | 
						|
    }
 | 
						|
    @OptIn(ExperimentalWasmDsl::class)
 | 
						|
    wasmJs() {
 | 
						|
        browser()
 | 
						|
        nodejs()
 | 
						|
    }
 | 
						|
 | 
						|
    sourceSets {
 | 
						|
        all {
 | 
						|
            languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
 | 
						|
            languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
 | 
						|
            languageSettings.optIn("kotlin.coroutines.DelicateCoroutinesApi")
 | 
						|
            languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
 | 
						|
            languageSettings.optIn("kotlinx.coroutines.flow.DelicateCoroutinesApi")
 | 
						|
        }
 | 
						|
 | 
						|
        val commonMain by getting {
 | 
						|
            kotlin.srcDir("$buildDir/generated/buildConfig/commonMain/kotlin")
 | 
						|
            dependencies {
 | 
						|
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
 | 
						|
                //put your multiplatform dependencies here
 | 
						|
                api(libs.kotlinx.coroutines.core)
 | 
						|
                api(libs.mp.bintools)
 | 
						|
                api("net.sergeych:mp_stools:1.5.2")
 | 
						|
            }
 | 
						|
        }
 | 
						|
        val commonTest by getting {
 | 
						|
            dependencies {
 | 
						|
                implementation(libs.kotlin.test)
 | 
						|
                implementation(libs.kotlinx.coroutines.test)
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
android {
 | 
						|
    namespace = "org.jetbrains.kotlinx.multiplatform.library.template"
 | 
						|
    compileSdk = libs.versions.android.compileSdk.get().toInt()
 | 
						|
    defaultConfig {
 | 
						|
        minSdk = libs.versions.android.minSdk.get().toInt()
 | 
						|
    }
 | 
						|
    compileOptions {
 | 
						|
        sourceCompatibility = JavaVersion.VERSION_11
 | 
						|
        targetCompatibility = JavaVersion.VERSION_11
 | 
						|
    }
 | 
						|
}
 | 
						|
dependencies {
 | 
						|
    implementation(libs.firebase.crashlytics.buildtools)
 | 
						|
    implementation(libs.compiler)
 | 
						|
}
 | 
						|
 | 
						|
publishing {
 | 
						|
    val mavenToken by lazy {
 | 
						|
        File("${System.getProperty("user.home")}/.gitea_token").readText()
 | 
						|
    }
 | 
						|
    repositories {
 | 
						|
        maven {
 | 
						|
            credentials(HttpHeaderCredentials::class) {
 | 
						|
                name = "Authorization"
 | 
						|
                value = mavenToken
 | 
						|
            }
 | 
						|
            url = uri("https://gitea.sergeych.net/api/packages/SergeychWorks/maven")
 | 
						|
            authentication {
 | 
						|
                create("Authorization", HttpHeaderAuthentication::class)
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
//mavenPublishing {
 | 
						|
//    publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
 | 
						|
//
 | 
						|
//    signAllPublications()
 | 
						|
//
 | 
						|
//    coordinates(group.toString(), "library", version.toString())
 | 
						|
//
 | 
						|
//    pom {
 | 
						|
//        name = "Lyng language"
 | 
						|
//        description = "Kotlin-bound scripting loanguage"
 | 
						|
//        inceptionYear = "2025"
 | 
						|
////        url = "https://sergeych.net"
 | 
						|
//        licenses {
 | 
						|
//            license {
 | 
						|
//                name = "XXX"
 | 
						|
//                url = "YYY"
 | 
						|
//                distribution = "ZZZ"
 | 
						|
//            }
 | 
						|
//        }
 | 
						|
//        developers {
 | 
						|
//            developer {
 | 
						|
//                id = "XXX"
 | 
						|
//                name = "YYY"
 | 
						|
//                url = "ZZZ"
 | 
						|
//            }
 | 
						|
//        }
 | 
						|
//        scm {
 | 
						|
//            url = "XXX"
 | 
						|
//            connection = "YYY"
 | 
						|
//            developerConnection = "ZZZ"
 | 
						|
//        }
 | 
						|
//    }
 | 
						|
//}
 |