Skip to content

Commit

Permalink
Swift package manager support (#32)
Browse files Browse the repository at this point in the history
* swift package manager support
* dart 3.7.0 format
  • Loading branch information
AlexisChoupault authored Mar 5, 2025
1 parent e76a270 commit 6e99ce2
Show file tree
Hide file tree
Showing 27 changed files with 241 additions and 223 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v22.7.4), do not edit directly.
// Autogenerated from Pigeon (v24.2.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

Expand Down Expand Up @@ -58,7 +58,6 @@ class FlutterError (
* [isWritable] is a boolean to indicate if the calendar is writable.
*
* [account] is the account the calendar belongs to
* TODO: explain android/ios differences
*
* Generated class from Pigeon that represents data sent in messages.
*/
Expand Down
6 changes: 0 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
PODS:
- eventide (0.1.0):
- Flutter
- Flutter (1.0.0)

DEPENDENCIES:
- eventide (from `.symlinks/plugins/eventide/ios`)
- Flutter (from `Flutter`)

EXTERNAL SOURCES:
eventide:
:path: ".symlinks/plugins/eventide/ios"
Flutter:
:path: Flutter

SPEC CHECKSUMS:
eventide: 49d6de19a7d84b90e51cc70a058631fb2bbe9cb8
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7

PODFILE CHECKSUM: 687a4f822c79d65793be5e7d85d1c6a0768b0a5f
Expand Down
40 changes: 22 additions & 18 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
3C5FCAE6DA74CDB40827FC98 /* Pods_EventideTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0D9C842D5B628A006386AB /* Pods_EventideTests.framework */; };
6B3F8EEDF0F4C499DF24CCA6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 361A682E7976717241103791 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -106,6 +107,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
6B3F8EEDF0F4C499DF24CCA6 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -261,13 +263,15 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
CB66F7AC56765634DC864D9F /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
packageProductDependencies = (
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -325,6 +329,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -462,23 +469,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CB66F7AC56765634DC864D9F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -965,6 +955,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = FlutterGeneratedPluginSwiftPackage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Prepare Flutter Framework Script"
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down Expand Up @@ -53,7 +71,7 @@
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EA5B29842D37F382005E7771"
BlueprintIdentifier = "EA0D9C8C2D5B6B9A006386AB"
BuildableName = "EventideTests.xctest"
BlueprintName = "EventideTests"
ReferencedContainer = "container:Runner.xcodeproj">
Expand All @@ -70,6 +88,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
3 changes: 3 additions & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.build/
.swiftpm/

.idea/
.vagrant/
.sconsign.dblite
Expand Down
Empty file removed ios/Assets/.gitkeep
Empty file.
15 changes: 8 additions & 7 deletions ios/eventide.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
Pod::Spec.new do |s|
s.name = 'eventide'
s.version = '0.1.0'
s.summary = 'A new Flutter plugin project.'
s.summary = 'Flutter calendar plugin'
s.description = <<-DESC
A new Flutter plugin project.
Eventide provides a easy-to-use flutter interface to access & modify native device calendars.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.homepage = 'https://github.com/sncf-connect-tech/eventide'
s.license = { :type => "MIT", :file => '../LICENSE' }
s.author = { 'SNCF Connect & Tech' => 'alexis.choupault@connect-tech.sncf' }
s.source = { :git => 'https://github.com/sncf-connect-tech/eventide.git', :tag => s.version.to_s }
s.source_files = 'eventide/Sources/eventide/**/*.swift'
s.resource_bundles = {'eventide_privacy' => ['eventide/Sources/eventide/PrivacyInfo.xcprivacy']}
s.dependency 'Flutter'
s.platform = :ios, '13.0'

Expand Down
24 changes: 24 additions & 0 deletions ios/eventide/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "eventide",
platforms: [
.iOS("13.0")
],
products: [
.library(name: "eventide", targets: ["eventide"])
],
dependencies: [],
targets: [
.target(
name: "eventide",
dependencies: [],
resources: [
.process("PrivacyInfo.xcprivacy"),
]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v22.7.4), do not edit directly.
// Autogenerated from Pigeon (v24.2.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand All @@ -15,9 +15,9 @@ import Foundation
final class PigeonError: Error {
let code: String
let message: String?
let details: Any?
let details: Sendable?

init(code: String, message: String?, details: Any?) {
init(code: String, message: String?, details: Sendable?) {
self.code = code
self.message = message
self.details = details
Expand Down Expand Up @@ -75,7 +75,6 @@ private func nilOrValue<T>(_ value: Any?) -> T? {
/// [isWritable] is a boolean to indicate if the calendar is writable.
///
/// [account] is the account the calendar belongs to
/// TODO: explain android/ios differences
///
/// Generated class from Pigeon that represents data sent in messages.
struct Calendar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

class CalendarImplem: CalendarApi {
private let easyEventStore: EasyEventStoreProtocol
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import EventKit
import UIKit

final class EasyEventStore: EasyEventStoreProtocol {
private let eventStore: EKEventStore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

protocol EasyEventStoreProtocol {
func createCalendar(title: String, color: UIColor, account: Account?) throws -> Calendar
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation
import EventKit
import UIKit

extension Date {
var millisecondsSince1970: Int64 {
Expand Down
3 changes: 2 additions & 1 deletion lib/eventide.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
library;

export 'src/eventide.dart' show Eventide;
export 'src/eventide_platform_interface.dart' show ETCalendar, ETEvent, ETAccount;
export 'src/eventide_platform_interface.dart'
show ETCalendar, ETEvent, ETAccount;
export 'src/eventide_exception.dart'
show
ETException,
Expand Down
Loading

0 comments on commit 6e99ce2

Please sign in to comment.