export library framework experiment
This commit is contained in:
		
							parent
							
								
									62397b5425
								
							
						
					
					
						commit
						e7093ab15f
					
				@ -145,107 +145,103 @@ kotlin {
 | 
			
		||||
        println("Configuring Linux Arm 32 targets")
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    runningOnMacos {
 | 
			
		||||
        println("Configuring macos targets")
 | 
			
		||||
        iosX64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        iosArm64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        iosArm32() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        macosX64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            compilations.getByName("main") {
 | 
			
		||||
                val libsodiumCinterop by cinterops.creating {
 | 
			
		||||
                    defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
 | 
			
		||||
                    compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include")
 | 
			
		||||
                }
 | 
			
		||||
                kotlinOptions.freeCompilerArgs = listOf(
 | 
			
		||||
                    "-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a"
 | 
			
		||||
                )
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        tvosX64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        tvosArm64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        watchosArm64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        watchosArm32() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        watchosX86() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                framework {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
    println("Configuring macos targets")
 | 
			
		||||
    iosX64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    runningOnWindows {
 | 
			
		||||
        println("Configuring Mingw targets")
 | 
			
		||||
        mingwX64() {
 | 
			
		||||
            binaries {
 | 
			
		||||
                staticLib {
 | 
			
		||||
                    optimized = true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            compilations.getByName("main") {
 | 
			
		||||
                val libsodiumCinterop by cinterops.creating {
 | 
			
		||||
                    defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
 | 
			
		||||
                    compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include")
 | 
			
		||||
                }
 | 
			
		||||
                kotlinOptions.freeCompilerArgs = listOf(
 | 
			
		||||
                    "-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a"
 | 
			
		||||
                )
 | 
			
		||||
    iosArm64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    iosArm32() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    macosX64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        compilations.getByName("main") {
 | 
			
		||||
            val libsodiumCinterop by cinterops.creating {
 | 
			
		||||
                defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
 | 
			
		||||
                compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include")
 | 
			
		||||
            }
 | 
			
		||||
            kotlinOptions.freeCompilerArgs = listOf(
 | 
			
		||||
                "-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a"
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    tvosX64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    tvosArm64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    watchosArm64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    watchosArm32() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    watchosX86() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            framework {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    println("Configuring Mingw targets")
 | 
			
		||||
    mingwX64() {
 | 
			
		||||
        binaries {
 | 
			
		||||
            staticLib {
 | 
			
		||||
                optimized = true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        compilations.getByName("main") {
 | 
			
		||||
            val libsodiumCinterop by cinterops.creating {
 | 
			
		||||
                defFile(project.file("src/nativeInterop/cinterop/libsodium.def"))
 | 
			
		||||
                compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include")
 | 
			
		||||
            }
 | 
			
		||||
            kotlinOptions.freeCompilerArgs = listOf(
 | 
			
		||||
                "-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a"
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    println(targets.names)
 | 
			
		||||
 | 
			
		||||
    sourceSets {
 | 
			
		||||
 | 
			
		||||
@ -99,9 +99,18 @@ kotlin {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    runningOnMacos {
 | 
			
		||||
        val iosX64Target = iosX64()
 | 
			
		||||
        val iosArm64Target = iosArm64()
 | 
			
		||||
        val iosArm32Target = iosArm32()
 | 
			
		||||
        val iosX64Target = iosX64() {
 | 
			
		||||
            baseName = "LibsodiumBindings"
 | 
			
		||||
            export(Deps.Common.libsodiumBindings)
 | 
			
		||||
        }
 | 
			
		||||
        val iosArm64Target = iosArm64() {
 | 
			
		||||
            baseName = "LibsodiumBindings"
 | 
			
		||||
            export(Deps.Common.libsodiumBindings)
 | 
			
		||||
        }
 | 
			
		||||
        val iosArm32Target = iosArm32() {
 | 
			
		||||
            baseName = "LibsodiumBindings"
 | 
			
		||||
            export(Deps.Common.libsodiumBindings)
 | 
			
		||||
        }
 | 
			
		||||
        val macosX64Target = macosX64()
 | 
			
		||||
        val tvosX64Target = tvosX64()
 | 
			
		||||
        val tvosArm64Target = tvosArm64()
 | 
			
		||||
@ -113,16 +122,16 @@ kotlin {
 | 
			
		||||
            binaries.executable {}
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        configure(listOf(
 | 
			
		||||
            iosX64Target, iosArm64Target, iosArm32Target,
 | 
			
		||||
            tvosX64Target, tvosArm64Target, watchosArm64Target,
 | 
			
		||||
            watchosArm32Target, watchosX86Target)
 | 
			
		||||
        ) {
 | 
			
		||||
            binaries.framework {
 | 
			
		||||
                baseName = "LibsodiumBindings"
 | 
			
		||||
                export(Deps.Common.libsodiumBindings)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
//        configure(listOf(
 | 
			
		||||
//            iosX64Target, iosArm64Target, iosArm32Target,
 | 
			
		||||
//            tvosX64Target, tvosArm64Target, watchosArm64Target,
 | 
			
		||||
//            watchosArm32Target, watchosX86Target)
 | 
			
		||||
//        ) {
 | 
			
		||||
//            binaries.framework {
 | 
			
		||||
//                baseName = "LibsodiumBindings"
 | 
			
		||||
//                export(Deps.Common.libsodiumBindings)
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
        val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
 | 
			
		||||
        println("Mode $mode")
 | 
			
		||||
        // Create a task to build a fat framework.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user