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

Migrate to SPM compatible structure #94 #95

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion CapacitorCommunityPrivacyScreen.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.homepage = package['repository']['url']
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.source_files = '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 Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "capacitor-swift-pm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ionic-team/capacitor-swift-pm.git",
"state" : {
"branch" : "6.0.0",
"revision" : "8a46dff3a8292761df1bded13a508da1c85859e8"
}
}
],
"version" : 2
}
28 changes: 28 additions & 0 deletions 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: "CapacitorCommunityPrivacyScreen",
platforms: [.iOS(.v13)],
products: [
.library(
name: "PrivacyScreenPlugin",
targets: ["PrivacyScreenPlugin"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "6.0.0")
],
targets: [
.target(
name: "PrivacyScreenPlugin",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")
],
path: "ios/Sources"),
.testTarget(
name: "PrivacyScreenPluginTests",
dependencies: ["PrivacyScreenPlugin"],
path: "ios/Tests")
]
)
575 changes: 0 additions & 575 deletions ios/Plugin.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

This file was deleted.

77 changes: 0 additions & 77 deletions ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme

This file was deleted.

68 changes: 0 additions & 68 deletions ios/Plugin.xcodeproj/xcshareddata/xcschemes/PluginTests.xcscheme

This file was deleted.

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

This file was deleted.

8 changes: 0 additions & 8 deletions ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

This file was deleted.

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

This file was deleted.

10 changes: 0 additions & 10 deletions ios/Plugin/PrivacyScreenPlugin.h

This file was deleted.

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

This file was deleted.

16 changes: 0 additions & 16 deletions ios/Podfile

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import Capacitor
* here: https://capacitorjs.com/docs/plugins/ios
*/
@objc(PrivacyScreenPlugin)
public class PrivacyScreenPlugin: CAPPlugin {
public class PrivacyScreenPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "PrivacyScreenPlugin"
public let jsName = "PrivacyScreen"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "enable", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "disable", returnType: CAPPluginReturnPromise)
]
private var implementation: PrivacyScreen?

override public func load() {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"android/src/main/",
"android/build.gradle",
"dist/",
"ios/Plugin/",
"ios/Sources/",
"ios/Tests/",
"Package.swift",
"CapacitorCommunityPrivacyScreen.podspec"
],
"author": "Robin Genz <[email protected]>",
Expand All @@ -29,10 +31,10 @@
],
"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 -scheme CapacitorCommunityPrivacyScreen -destination generic/platform=iOS",
"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",
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint ios",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
Expand Down