Skip to content

Imported cocoapods plugin and config #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
41 changes: 37 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName


apply(from = "publish-root.gradle")

Expand All @@ -10,6 +7,8 @@ plugins {
id("maven-publish")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("signing")
id("org.jetbrains.gradle.apple.applePlugin") version "212.4638.14-0.13.1"
kotlin("native.cocoapods") version "1.9.0"
}

group = "dev.snipme"
Expand Down Expand Up @@ -41,6 +40,40 @@ kotlin {
browser()
nodejs()
}
// TODO Generate cocoapods framework
cocoapods {
// Required properties
// Specify the required Pod version here. Otherwise, the Gradle project version is used.
version = "0.7.1"
summary = "Kotlin Multiplatform syntax highlighting engine."
homepage = "Link to a Kotlin/Native module homepage"
// podfile = project.file("../kodeview_tester/ios/Podfile")

// Optional properties
// Configure the Pod name here instead of changing the Gradle project name
// name = "Highlights"

framework {
// Required properties
// Framework name configuration. Use this property instead of deprecated 'frameworkName'
baseName = "Highlights"
}
//
// // Optional properties
// // Specify the framework linking type. It's dynamic by default.
// isStatic = false
// // Dependency export
//// export(project(":"))
// transitiveExport = false // This is default.
// // Bitcode embedding
// embedBitcode(BITCODE)
// }

// // Maps custom Xcode configuration to NativeBuildType
// xcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = DEBUG
// xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = RELEASE
}

// Dependencies
sourceSets {
val commonTest by getting {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlin.js.compiler=ir
kotlin.js.compiler=ir
kotlin.native.cacheKind.iosArm64=none
39 changes: 39 additions & 0 deletions highlights.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Pod::Spec.new do |spec|
spec.name = 'highlights'
spec.version = '0.7.1'
spec.homepage = 'Link to a Kotlin/Native module homepage'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Kotlin Multiplatform syntax highlighting engine.'
spec.vendored_frameworks = 'build/cocoapods/framework/Highlights.framework'
spec.libraries = 'c++'



spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => '',
'PRODUCT_MODULE_NAME' => 'Highlights',
}

spec.script_phases = [
{
:name => 'Build highlights',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
SCRIPT
}
]

end
20 changes: 20 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'ios' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for ios
pod 'Highlights', :path => '../Highlights'

target 'iosTests' do
inherit! :search_paths
# Pods for testing
end

target 'iosUITests' do
# Pods for testing
end

end
Loading