Skip to content

Commit

Permalink
add xcframework to root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilveirah committed Sep 4, 2024
1 parent a76bf47 commit c496afd
Show file tree
Hide file tree
Showing 30 changed files with 45,569 additions and 43 deletions.
8 changes: 4 additions & 4 deletions core/SPMobileCore.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |spec|
spec.name = 'SPMobileCore'
spec.version = '0.0.1'
spec.homepage = 'https://github.com/SourcepointUSA/SPMobileCore'
spec.version = '0.0.2-beta1'
spec.homepage = 'https://github.com/SourcePointUSA/mobile-core.git'
spec.source = { :http=> ''}
spec.authors = 'André Herculano'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.summary = 'A prototype of a iOS pod generated by Kotlin Multiplatform'
spec.license = { :type => 'APACHE 2' }
spec.summary = 'The internal Network & Data layers used by our mobile SDKs'
spec.vendored_frameworks = 'build/cocoapods/framework/SPMobileCore.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '11.0'
Expand Down
78 changes: 39 additions & 39 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ plugins {
id("maven-publish")
id("signing")
}
val coreVersion = "0.0.1"

val coreVersion = "0.0.2-beta1"
group = "com.sourcepoint"
version = coreVersion

val description = "The internal Network & Data layers used by our mobile SDKs"
val generatedSourcesPath = layout.buildDirectory.dir("generated").get()
val sourceDir = "${layout.projectDirectory}/cocoapods/publish/debug"
val destDir = "${layout.projectDirectory}/cocoapods/pod"
val gitRepoUrl = "https://github.com/SourcepointUSA/SPMobileCore.git"
val podVersion = kotlin.cocoapods.version
val gitRepoUrl = "https://github.com/SourcePointUSA/mobile-core.git"
val deviceName = project.findProperty("iosDevice") as? String ?: "iPhone 15"

// this generates a kotlin file with constants that can be used inside the project
buildConfig {
buildConfigField("Version", coreVersion)
Expand All @@ -48,10 +49,10 @@ kotlin {

cocoapods {
name = "SPMobileCore"
summary = "A prototype of a iOS pod generated by Kotlin Multiplatform"
homepage = "https://github.com/SourcepointUSA/SPMobileCore"
license = "{ :type => 'MIT', :file => 'LICENSE' }"
source = "{ :git => 'https://github.com/SourcepointUSA/SPMobileCore.git', :tag => '$coreVersion' }"
summary = description
homepage = gitRepoUrl
license = "{ :type => 'APACHE 2' }"
source = "{ :git => '$gitRepoUrl', :tag => '$coreVersion' }"
authors = "André Herculano"
version = coreVersion
ios.deploymentTarget = "11.0"
Expand Down Expand Up @@ -112,51 +113,51 @@ android {
}

tasks.register("podCloneOrPullGitRepo") {
doLast {
val dir = file(destDir)

if (!dir.exists()) {
dir.mkdirs()
project.exec {
workingDir = dir
commandLine("git", "clone", gitRepoUrl, ".")
}
} else {
project.exec {
workingDir = dir
commandLine("git", "pull")
}
}
}
// doLast {
// val dir = file(destDir)
//
// if (!dir.exists()) {
// dir.mkdirs()
// project.exec {
// workingDir = dir
// commandLine("git", "clone", gitRepoUrl, ".")
// }
// } else {
// project.exec {
// workingDir = dir
// commandLine("git", "pull")
// }
// }
// }
}

tasks.register<Copy>("podCopyDir") {
from(sourceDir)
into(destDir)
dependsOn("podPublishDebugXCFramework", "podCloneOrPullGitRepo")
// from(sourceDir)
// into(destDir)
// dependsOn("podPublishDebugXCFramework", "podCloneOrPullGitRepo")
}

tasks.register<Exec>("podReleaseToGit") {
workingDir = file(destDir)
println(workingDir.path)
println(file(".").path)
commandLine("git", "status")
commandLine("git", "add", ".")
commandLine("git", "status")
commandLine("git", "commit", "-m", "release $podVersion")
commandLine("git", "tag", "-a", podVersion, "-m", podVersion)
commandLine("git", "push", "--tags")
dependsOn("podCopyDir")
// workingDir = file(destDir)
// println(workingDir.path)
// println(file(".").path)
// commandLine("git", "status")
// commandLine("git", "add", ".")
// commandLine("git", "status")
// commandLine("git", "commit", "-m", "release $podVersion")
// commandLine("git", "tag", "-a", podVersion, "-m", podVersion)
// commandLine("git", "push", "--tags")
// dependsOn("podCopyDir")
}

tasks.register<Exec>("podReleaseToCocoapods") {
workingDir = file(destDir)
commandLine("pod", "trunk", "push", "${kotlin.cocoapods.name}.podspec", "--verbose", "--allow-warnings")
dependsOn("podReleaseToGit")
// dependsOn("podReleaseToGit")
}

tasks.register("podRelease") {
dependsOn("podPublishDebugXCFramework", "podCloneOrPullGitRepo", "podCopyDir", "podReleaseToGit")
dependsOn("podPublishReleaseXCFramework", "podCloneOrPullGitRepo", "podCopyDir", "podReleaseToGit")
}

// FIXME: this does not work for tvOS
Expand Down Expand Up @@ -232,7 +233,6 @@ publishing {
val releasesRepoUrl = uri(project.findProperty("releasesRepoUrl") as String)
val snapshotsRepoUrl = uri(findProperty("snapshotsRepoUrl") as String)
url = if (coreVersion.contains("beta")) snapshotsRepoUrl else releasesRepoUrl
println("Publishing on: $url")

credentials {
username = ossrhUsername
Expand Down
17 changes: 17 additions & 0 deletions xcframework/SPMobileCore.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Pod::Spec.new do |spec|
spec.name = 'SPMobileCore'
spec.version = '0.0.2-beta1'
spec.homepage = 'https://github.com/SourcePointUSA/mobile-core.git'
spec.source = { :git => 'https://github.com/SourcePointUSA/mobile-core.git', :tag => '0.0.2-beta1' }
spec.authors = 'André Herculano'
spec.license = { :type => 'APACHE 2' }
spec.summary = 'The internal Network & Data layers used by our mobile SDKs'
spec.vendored_frameworks = 'SPMobileCore.xcframework'
spec.libraries = 'c++'
spec.ios.deployment_target = '11.0'





end
83 changes: 83 additions & 0 deletions xcframework/SPMobileCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>SPMobileCore.framework/SPMobileCore</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SPMobileCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SPMobileCore.framework/SPMobileCore</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SPMobileCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SPMobileCore.framework/SPMobileCore</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SPMobileCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SPMobileCore.framework/SPMobileCore</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>SPMobileCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Loading

0 comments on commit c496afd

Please sign in to comment.