Skip to content

Commit

Permalink
feat(spm): Add CordovaPlugins SPM to template
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored and dpogue committed Dec 17, 2024
1 parent 3737f51 commit 880f1e2
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 4 deletions.
20 changes: 16 additions & 4 deletions templates/project/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
90CBB5282C06968500B805A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5272C06968500B805A2 /* AppDelegate.swift */; };
90CBB52A2C06968500B805A2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5292C06968500B805A2 /* SceneDelegate.swift */; };
90CBB52C2C06968500B805A2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB52B2C06968500B805A2 /* ViewController.swift */; };
90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */ = {isa = PBXBuildFile; productRef = 90D82ABC2CF19AEA001383CF /* CordovaPlugins */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -80,6 +81,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */,
90A914592CA3D370003DB979 /* CordovaLib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -191,6 +193,7 @@
name = App;
packageProductDependencies = (
90A914582CA3D370003DB979 /* CordovaLib */,
90D82ABC2CF19AEA001383CF /* CordovaPlugins */,
);
productName = App;
productReference = 90BD9B6C2C06907D000DEBAB /* App.app */;
Expand Down Expand Up @@ -222,6 +225,7 @@
mainGroup = 90BD9B632C06907D000DEBAB /* CustomTemplate */;
packageReferences = (
90A914572CA3D370003DB979 /* XCLocalSwiftPackageReference "../../../cordova-ios" */,
90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "CordovaPlugins" */,
);
productRefGroup = 90BD9B6D2C06907D000DEBAB /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -317,8 +321,8 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
DSTROOT = "$(SRCROOT)/build";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand All @@ -338,8 +342,8 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -391,8 +395,8 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
"DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
"DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
"DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
DSTROOT = "$(SRCROOT)/build";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -406,8 +410,8 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
"INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
"INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -525,13 +529,21 @@
isa = XCLocalSwiftPackageReference;
relativePath = "../../../cordova-ios";
};
90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "CordovaPlugins" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = CordovaPlugins;
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
90A914582CA3D370003DB979 /* CordovaLib */ = {
isa = XCSwiftPackageProductDependency;
productName = CordovaLib;
};
90D82ABC2CF19AEA001383CF /* CordovaPlugins */ = {
isa = XCSwiftPackageProductDependency;
productName = CordovaPlugins;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 90BD9B642C06907D000DEBAB /* Project object */;
Expand Down
37 changes: 37 additions & 0 deletions templates/project/CordovaPlugins/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// swift-tools-version:5.5

/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

import PackageDescription

let package = Package(
name: "CordovaPlugins",
platforms: [
.iOS(.v13),
.macCatalyst(.v13)
],
products: [
.library(name: "CordovaPlugins", targets: ["CordovaPlugins"])
],
targets: [
.target(name: "CordovaPlugins")
]
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

// We need something here so that the empty package will compile successfully
public let isCordovaApp = true

0 comments on commit 880f1e2

Please sign in to comment.