|
| 1 | +repositories { |
| 2 | + maven { url "https://dl.bintray.com/spekframework/spek-dev" } |
| 3 | +} |
| 4 | +apply plugin: 'java' |
| 5 | +apply plugin: 'kotlin-multiplatform' |
| 6 | +apply plugin: 'kotlinx-atomicfu' |
| 7 | + |
| 8 | +archivesBaseName = 'redux-kotlin-threadsafe' |
| 9 | + |
| 10 | +group 'org.reduxkotlin' |
| 11 | +version '0.4.0' |
| 12 | + |
| 13 | +kotlin { |
| 14 | + jvm() |
| 15 | + js() { |
| 16 | + [compileKotlinJs, compileTestKotlinJs].each { configuration -> |
| 17 | + configuration.kotlinOptions { |
| 18 | + moduleKind = 'umd' |
| 19 | + sourceMap = true |
| 20 | + metaInfo = true |
| 21 | + } |
| 22 | + } |
| 23 | + } |
| 24 | + |
| 25 | + iosArm64("ios") |
| 26 | + iosX64("iosSim") |
| 27 | + macosX64("macos") |
| 28 | + mingwX64("win") |
| 29 | + wasm32("wasm") |
| 30 | + linuxArm32Hfp("linArm32") |
| 31 | + linuxMips32("linMips32") |
| 32 | + linuxMipsel32("linMipsel32") |
| 33 | + linuxX64("lin64") |
| 34 | + |
| 35 | + sourceSets { |
| 36 | + |
| 37 | + commonMain { |
| 38 | + dependencies { |
| 39 | + implementation kotlin("stdlib-common") |
| 40 | + implementation project(":lib") |
| 41 | + } |
| 42 | + } |
| 43 | + commonTest { |
| 44 | + kotlin.srcDir('src/test/kotlin') |
| 45 | + dependencies { |
| 46 | + implementation kotlin("test-common") |
| 47 | + implementation kotlin("test-annotations-common") |
| 48 | + implementation Libs.spek_dsl_metadata |
| 49 | + implementation Libs.atrium_cc_en_gb_robstoll_common |
| 50 | + implementation Libs.mockk_common |
| 51 | + implementation Libs.kotlin_coroutines |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + jvmMain { |
| 56 | + kotlin.srcDir('src/jvmMain/kotlin') |
| 57 | + dependencies { |
| 58 | + implementation kotlin("stdlib") |
| 59 | + } |
| 60 | + } |
| 61 | + jvmTest { |
| 62 | + dependencies { |
| 63 | + implementation kotlin("test") |
| 64 | + implementation kotlin("test-junit") |
| 65 | + implementation Libs.kotlin_coroutines_test |
| 66 | + implementation Libs.kotlin_coroutines_jvm |
| 67 | + implementation Libs.spek_dsl_jvm |
| 68 | + implementation Libs.atrium_cc_en_gb_robstoll |
| 69 | + implementation Libs.mockk |
| 70 | + |
| 71 | + runtimeOnly Libs.spek_runner_junit5 |
| 72 | + runtimeOnly Libs.kotlin_reflect |
| 73 | + |
| 74 | + } |
| 75 | + } |
| 76 | + jsMain { |
| 77 | + kotlin.srcDir('src/jsMain/kotlin') |
| 78 | + dependencies { |
| 79 | + implementation kotlin("stdlib-js") |
| 80 | + } |
| 81 | + compileKotlinJs { |
| 82 | + kotlinOptions.metaInfo = true |
| 83 | + kotlinOptions.sourceMap = true |
| 84 | + kotlinOptions.suppressWarnings = true |
| 85 | + kotlinOptions.verbose = true |
| 86 | + kotlinOptions.main = "call" |
| 87 | + kotlinOptions.moduleKind = "umd" |
| 88 | + } |
| 89 | + } |
| 90 | + jsTest { |
| 91 | + dependencies { |
| 92 | + implementation kotlin("test-js") |
| 93 | + implementation kotlin("stdlib-js") |
| 94 | + } |
| 95 | + } |
| 96 | + |
| 97 | + iosSimMain.dependsOn iosMain |
| 98 | + iosSimTest.dependsOn iosTest |
| 99 | + } |
| 100 | +} |
| 101 | + |
| 102 | + |
| 103 | +afterEvaluate { |
| 104 | + // Alias the task names we use elsewhere to the new task names. |
| 105 | + tasks.create('installMP').dependsOn('publishKotlinMultiplatformPublicationToMavenLocal') |
| 106 | + tasks.create('installLocally') { |
| 107 | + dependsOn 'publishKotlinMultiplatformPublicationToTestRepository' |
| 108 | + dependsOn 'publishJvmPublicationToTestRepository' |
| 109 | + dependsOn 'publishJsPublicationToTestRepository' |
| 110 | + dependsOn 'publishMetadataPublicationToTestRepository' |
| 111 | + } |
| 112 | + tasks.create('installIosLocally') { |
| 113 | + dependsOn 'publishKotlinMultiplatformPublicationToTestRepository' |
| 114 | + dependsOn 'publishIosArm32PublicationToTestRepository' |
| 115 | + dependsOn 'publishIosArm64PublicationToTestRepository' |
| 116 | + dependsOn 'publishIosX64PublicationToTestRepository' |
| 117 | + dependsOn 'publishMetadataPublicationToTestRepository' |
| 118 | + } |
| 119 | + // NOTE: We do not alias uploadArchives because CI runs it on Linux and we only want to run it on Mac OS. |
| 120 | + //tasks.create('uploadArchives').dependsOn('publishKotlinMultiplatformPublicationToMavenRepository') |
| 121 | +} |
| 122 | + |
| 123 | +apply from: rootProject.file('gradle/publish.gradle') |
| 124 | + |
| 125 | +publishing { |
| 126 | + publications.all { |
| 127 | + // Rewrite all artifacts from using the project name to just 'runtime'. |
| 128 | + artifactId = artifactId.replace(project.name, 'redux-kotlin-threadsafe') |
| 129 | + } |
| 130 | +} |
| 131 | + |
| 132 | +jvmTest { |
| 133 | + useJUnitPlatform { |
| 134 | + includeEngines 'spek2' |
| 135 | + } |
| 136 | +} |
0 commit comments