Skip to content

Migrate iOS plugin and example to use swift package manager #86

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

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
5 changes: 4 additions & 1 deletion arcgis_map_sdk_ios/ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ Icon?

/Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh
/Flutter/flutter_export_environment.sh

.swiftpm/
Package.resolved
Empty file.
4 changes: 0 additions & 4 deletions arcgis_map_sdk_ios/ios/Classes/ArcgisMapPlugin.h

This file was deleted.

18 changes: 0 additions & 18 deletions arcgis_map_sdk_ios/ios/Classes/ArcgisMapPlugin.m

This file was deleted.

2 changes: 1 addition & 1 deletion arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A new Flutter project.
s.homepage = 'http://example.com'
s.author = { 'Your Company' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'arcgis_map_sdk_ios/Sources/**/*'
s.dependency 'Flutter'
s.dependency 'ArcGIS-Runtime-Toolkit-iOS'
s.platform = :ios, '13.0'
Expand Down
25 changes: 25 additions & 0 deletions arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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: "arcgis_map_sdk_ios",
platforms: [
.iOS("14.0")
],
products: [
.library(name: "arcgis-map-sdk-ios", targets: ["arcgis_map_sdk_ios"])
],
dependencies: [
.package(url: "https://github.com/Esri/arcgis-runtime-ios", .upToNextMinor(from: "100.15.0")),
],
targets: [
.target(
name: "arcgis_map_sdk_ios",
dependencies: [
.product(name: "ArcGIS", package: "arcgis-runtime-ios")
]
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import Flutter
import UIKit
import ArcGIS

public class SwiftArcgisMapPlugin: NSObject, FlutterPlugin {

public class ArcgisMapPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
registrar.register(ArcgisMapViewFactory(registrar: registrar), withId: "<native_map_view>")

let instance = SwiftArcgisMapPlugin()
let instance = ArcgisMapPlugin()
let channel = FlutterMethodChannel(
name: "dev.fluttercommunity.arcgis_map_sdk",
binaryMessenger: registrar.messenger()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ArcGIS
import Foundation
import Flutter

class ArcgisMapView: NSObject, FlutterPlatformView {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import Flutter

class CenterPositionStreamHandler: NSObject, FlutterStreamHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Foundation
import ArcGIS
import Flutter

class GraphicsParser {
let registrar: FlutterPluginRegistrar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import UIKit

struct MapColor: Codable {
var red: Double
Expand All @@ -20,4 +21,4 @@ extension MapColor {
alpha: opacity
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import Flutter

class ZoomStreamHandler: NSObject, FlutterStreamHandler {

Expand Down
2 changes: 2 additions & 0 deletions example/ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ Runner/GeneratedPluginRegistrant.*
!default.mode2v3
!default.pbxuser
!default.perspectivev3

Package.resolved
17 changes: 0 additions & 17 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
PODS:
- ArcGIS-Runtime-SDK-iOS (100.14.1)
- ArcGIS-Runtime-Toolkit-iOS (100.14.0):
- ArcGIS-Runtime-SDK-iOS (~> 100.14.0)
- arcgis_map_sdk_ios (0.0.1):
- ArcGIS-Runtime-Toolkit-iOS
- Flutter
- Flutter (1.0.0)
- geolocator_apple (1.2.0):
- Flutter

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

SPEC REPOS:
trunk:
- ArcGIS-Runtime-SDK-iOS
- ArcGIS-Runtime-Toolkit-iOS

EXTERNAL SOURCES:
arcgis_map_sdk_ios:
:path: ".symlinks/plugins/arcgis_map_sdk_ios/ios"
Flutter:
:path: Flutter
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios"

SPEC CHECKSUMS:
ArcGIS-Runtime-SDK-iOS: 6ab51d28f8831ac73c00d34998cff3a555fe304f
ArcGIS-Runtime-Toolkit-iOS: e30bb45bd0bd0152bcb1ec73f9b99022a5c7d02d
arcgis_map_sdk_ios: deb0d9d2dfedca86984c0aa81e6245eed03c8344
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
geolocator_apple: d981750b9f47dbdb02427e1476d9a04397beb8d9

Expand Down
27 changes: 25 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
605FA5D163A7B2040C9667D1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBB57AA011A2DA64754497 /* 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 @@ -54,6 +55,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
605FA5D163A7B2040C9667D1 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -88,7 +90,6 @@
97C146EF1CF9000F007C117D /* Products */,
EC58D96A64CE4D3D7740F25D /* Pods */,
3776939CBC3633F36418AFD9 /* Frameworks */,
838A69020171B4AA9B387170 /* SimpleMarkerSymbolPayload.swift */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -122,7 +123,6 @@
AFBD59F3D7EBE98D9F0820DA /* Pods-Runner.release.xcconfig */,
48FDB075D82D2D5142D6BACF /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand All @@ -147,6 +147,9 @@
dependencies = (
);
name = Runner;
packageProductDependencies = (
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -175,6 +178,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -363,6 +369,7 @@
DEVELOPMENT_TEAM = 64Z45JP26B;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -492,6 +499,7 @@
DEVELOPMENT_TEAM = 64Z45JP26B;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -515,6 +523,7 @@
DEVELOPMENT_TEAM = 64Z45JP26B;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -551,6 +560,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/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
Expand Up @@ -5,6 +5,24 @@
<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