Skip to content
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

chore(text-zoom): Add SPM support to text-zoom #1922

Merged
merged 8 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion text-zoom/CapacitorTextZoom.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.homepage = 'https://capacitorjs.com'
s.author = package['author']
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}', 'text-zoom/ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'text-zoom/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '13.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
Expand Down
14 changes: 14 additions & 0 deletions text-zoom/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "capacitor6-spm-test",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ionic-team/capacitor6-spm-test.git",
"state" : {
"branch" : "main",
"revision" : "cf4ff2bc1dffb14adc27b1e5a09ac37e85424b99"
}
}
],
"version" : 2
}
28 changes: 28 additions & 0 deletions text-zoom/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "CapacitorTextZoom",
platforms: [.iOS(.v13)],
products: [
.library(
name: "TextZoomPlugin",
targets: ["TextZoomPlugin"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor6-spm-test.git", branch: "main")
],
targets: [
.target(
name: "TextZoomPlugin",
dependencies: [
.product(name: "Capacitor", package: "capacitor6-spm-test"),
.product(name: "Cordova", package: "capacitor6-spm-test")
],
path: "ios/Sources/TextZoomPlugin"),
.testTarget(
name: "TextZoomPluginTests",
dependencies: ["TextZoomPlugin"],
path: "ios/Tests/TextZoomPluginTests")
]
)
571 changes: 0 additions & 571 deletions text-zoom/ios/Plugin.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions text-zoom/ios/Plugin.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions text-zoom/ios/Plugin/Info.plist

This file was deleted.

10 changes: 0 additions & 10 deletions text-zoom/ios/Plugin/TextZoomPlugin.h

This file was deleted.

8 changes: 0 additions & 8 deletions text-zoom/ios/Plugin/TextZoomPlugin.m

This file was deleted.

13 changes: 0 additions & 13 deletions text-zoom/ios/Plugin/TextZoomPlugin.swift

This file was deleted.

22 changes: 0 additions & 22 deletions text-zoom/ios/PluginTests/Info.plist

This file was deleted.

16 changes: 0 additions & 16 deletions text-zoom/ios/Podfile

This file was deleted.

18 changes: 18 additions & 0 deletions text-zoom/ios/Sources/TextZoomPlugin/TextZoomPlugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Foundation
import Capacitor

@objc(TextZoomPlugin)
public class TextZoomPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "TextZoomPlugin"
public let jsName = "TextZoom"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "getPreferred", returnType: CAPPluginReturnPromise),
]
private let textZoom = TextZoom()

@objc func getPreferred(_ call: CAPPluginCall) {
call.resolve([
"value": textZoom.preferredFontSize()
])
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
@testable import Plugin
@testable import TextZoomPlugin

class TextZoomTests: XCTestCase {

Expand Down
7 changes: 4 additions & 3 deletions text-zoom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"files": [
"android/src/main/",
"android/build.gradle",
"dist/",
markemer marked this conversation as resolved.
Show resolved Hide resolved
"ios/Plugin/",
"ios/Sources",
"ios/Tests",
"Package.swift",
"CapacitorTextZoom.podspec"
],
"author": "Ionic <[email protected]>",
Expand All @@ -29,7 +30,7 @@
],
"scripts": {
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
"verify:ios": "xcodebuild build -scheme CapacitorTextZoom -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'",
"verify:android": "cd android && ./gradlew clean build test && cd ..",
"verify:web": "npm run build",
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
Expand Down
Loading