@@ -20,7 +20,7 @@ buildscript {
2020 google()
2121 gradlePluginPortal()
2222 mavenLocal()
23- // maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
23+ maven { url ' https://dl.bintray.com/kotlin/kotlin-eap' }
2424 }
2525
2626 dependencies {
@@ -33,78 +33,101 @@ apply plugin: 'org.jetbrains.kotlin.multiplatform'
3333repositories {
3434 mavenCentral()
3535 mavenLocal()
36- // maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
36+ maven { url ' https://dl.bintray.com/kotlin/kotlin-eap' }
3737}
3838
3939group = GROUP
4040version = VERSION_NAME
4141
4242kotlin {
4343 targets {
44-
44+
4545 fromPreset(presets. jvm, ' jvm' )
46-
46+
4747// fromPreset(presets.macosX64, 'nativeCommon')
4848
4949 fromPreset(presets. macosX64, ' macos' ){
50+ compilations. main {
51+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/macos_x64/tlruntime.bc" ]
52+ }
5053 compilations. test {
5154 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
52- it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/macos_x64/tlruntime.bc" ]
5355 }
5456 }
5557
5658 fromPreset(presets. mingwX64, ' mingw' ){
59+ compilations. main {
60+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/mingw_x64/tlruntime.bc" ]
61+ }
5762 compilations. each {
5863 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -Lc:\\ msys64\\ mingw64\\ lib" ]
5964 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
6065 }
61- compilations. test {
62- // it.kotlinOptions.freeCompilerArgs("-native-library", "../KotlinCpp/bcdist/mingw_x64/tlruntime.bc")
63- }
6466 }
6567
6668 fromPreset(presets. iosX64, ' iosX64' ){
69+ compilations. main {
70+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/ios_x64/tlruntime.bc" ]
71+ }
6772 compilations. test {
6873 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
69- // it.kotlinOptions.freeCompilerArgs("-native-library", "../KotlinCpp/bcdist/ios_x64/tlruntime.bc")
7074 }
7175 }
72-
76+
7377 fromPreset(presets. iosArm64, ' iosArm64' ){
78+ compilations. main {
79+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/ios_arm64/tlruntime.bc" ]
80+ }
7481 compilations. test {
7582 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
76- // it.kotlinOptions.freeCompilerArgs("-native-library", "../KotlinCpp/bcdist/ios_arm64/tlruntime.bc")
7783 }
7884 }
79-
85+
8086 fromPreset(presets. iosArm32, ' iosArm32' ){
87+ compilations. main {
88+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/ios_arm32/tlruntime.bc" ]
89+ }
8190 compilations. test {
8291 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
83- // it.kotlinOptions.freeCompilerArgs("-native-library", "../KotlinCpp/bcdist/ios_arm32/tlruntime.bc")
8492 }
8593 }
8694
8795 fromPreset(presets. watchosArm32, ' watchosArm32' ){
96+ compilations. main {
97+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/watchos_arm32/tlruntime.bc" ]
98+ }
8899 compilations. test {
89100 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
90101 }
91102 }
92103 fromPreset(presets. watchosArm64, ' watchosArm64' ){
104+ compilations. main {
105+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/watchos_arm64/tlruntime.bc" ]
106+ }
93107 compilations. test {
94108 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
95109 }
96110 }
97111 fromPreset(presets. watchosX86, ' watchosX86' ){
112+ compilations. main {
113+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/watchos_x86/tlruntime.bc" ]
114+ }
98115 compilations. test {
99116 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
100117 }
101118 }
102119 fromPreset(presets. tvosArm64, ' tvosArm64' ){
120+ compilations. main {
121+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/tvos_arm64/tlruntime.bc" ]
122+ }
103123 compilations. test {
104124 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
105125 }
106126 }
107127 fromPreset(presets. tvosX64, ' tvosX64' ){
128+ compilations. main {
129+ it. kotlinOptions. freeCompilerArgs + = [" -native-library" , " ../KotlinCpp/bcdist/tvos_x64/tlruntime.bc" ]
130+ }
108131 compilations. test {
109132 it. kotlinOptions. freeCompilerArgs + = [" -linker-options" , " -lsqlite3" ]
110133 }
@@ -166,40 +189,4 @@ configurations {
166189 compileClasspath
167190}
168191
169- void mergeCppOutput (String archFolder , String archZip ){
170- try {
171- ant. zip(
172- update : " true" ,
173- destfile : " ${ project.buildDir} /classes/kotlin/$archFolder /main/sqliter.klib"
174- ) {
175- zipfileset(
176- dir : " ${ project.projectDir} /../KotlinCpp/bcdist/$archZip " ,
177- prefix : " targets/$archZip /native"
178- ) {
179- include(name : ' **.bc' )
180- }
181- }
182- } catch (Throwable t) {
183-
184- }
185- }
186-
187- task mergeCppAll (dependsOn :build) {
188- doLast {
189- mergeCppOutput(" iosArm32" , " ios_arm32" )
190- mergeCppOutput(" iosArm64" , " ios_arm64" )
191- mergeCppOutput(" iosX64" , " ios_x64" )
192- mergeCppOutput(" macos" , " macos_x64" )
193- mergeCppOutput(" watchosArm32" , " watchos_arm32" )
194- mergeCppOutput(" watchosArm64" , " watchos_arm64" )
195- mergeCppOutput(" watchosX86" , " watchos_x86" )
196- mergeCppOutput(" tvosArm64" , " tvos_arm64" )
197- mergeCppOutput(" tvosX64" , " tvos_x64" )
198- mergeCppOutput(" mingw" , " mingw_x64" )
199- }
200- }
201-
202192apply from : " $rootDir /gradle/gradle-mvn-mpp-push.gradle"
203-
204- tasks. findByName(" publish" ). dependsOn(" mergeCppAll" )
205- tasks. findByName(" publishToMavenLocal" ). dependsOn(" mergeCppAll" )
0 commit comments