Skip to content

Commit

Permalink
Merge pull request #2039 from microsoft/feature/SPM-support
Browse files Browse the repository at this point in the history
Swift Package Manager support (Analytics & Crashes)
  • Loading branch information
MatkovIvan authored May 8, 2020
2 parents ff78f0c + 3a7560f commit 8ca3526
Show file tree
Hide file tree
Showing 47 changed files with 135 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AppCenter.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/AppCenter.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSAbstractLog.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSAppCenter.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSAppCenterErrors.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSChannelGroupProtocol.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSChannelProtocol.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSConstants+Flags.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSConstants.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSCustomProperties.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSDevice.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSEnable.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSLog.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSLogWithProperties.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSLogger.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSService.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSServiceAbstract.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSWrapperLogger.h
1 change: 1 addition & 0 deletions AppCenter/AppCenter/include/MSWrapperSdk.h
1 change: 1 addition & 0 deletions AppCenterAnalytics/AppCenterAnalytics/include/MSEventLog.h
1 change: 1 addition & 0 deletions AppCenterAnalytics/AppCenterAnalytics/include/MSService.h
1 change: 1 addition & 0 deletions AppCenterCrashes/AppCenterCrashes/include/MSAbstractLog.h
1 change: 1 addition & 0 deletions AppCenterCrashes/AppCenterCrashes/include/MSCrashes.h
1 change: 1 addition & 0 deletions AppCenterCrashes/AppCenterCrashes/include/MSErrorReport.h
1 change: 1 addition & 0 deletions AppCenterCrashes/AppCenterCrashes/include/MSService.h
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### App Center

* **[Improvement]** Use namespaced `NSUserDefaults` keys with the **MSAppCenter** prefix for all the keys set by the SDK. Fixed a few keys missing namespace.
* **[Feature]** Swift Package Manager support for Analytics and Crashes modules.

___

## Version 3.1.1
Expand Down
82 changes: 82 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// swift-tools-version:5.0

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import PackageDescription

let package = Package(
name: "App Center",
platforms: [
.iOS(.v9),
.macOS(.v10_10),
.tvOS(.v11)
],
products: [
.library(
name: "AppCenterAnalytics",
type: .static,
targets: ["AppCenterAnalytics"]),
.library(
name: "AppCenterCrashes",
type: .static,
targets: ["AppCenterCrashes"])
],
dependencies: [
.package(url: "https://github.com/microsoft/plcrashreporter.git", .revision("44b167048312b404f5aeb70381019deb6158f219")),
],
targets: [
.target(
name: "AppCenter",
path: "AppCenter/AppCenter",
exclude: ["Support"],
cSettings: [
.define("APP_CENTER_C_NAME", to: "\"appcenter.ios\"", .when(platforms: [.iOS])),
.define("APP_CENTER_C_NAME", to: "\"appcenter.macos\"", .when(platforms: [.macOS])),
.define("APP_CENTER_C_NAME", to: "\"appcenter.tvos\"", .when(platforms: [.tvOS])),
.define("APP_CENTER_C_VERSION", to:"\"3.1.1\""),
.define("APP_CENTER_C_BUILD", to:"\"1\""),
.headerSearchPath("**"),
],
linkerSettings: [
.linkedLibrary("z"),
.linkedLibrary("sqlite3"),
.linkedFramework("Foundation"),
.linkedFramework("SystemConfiguration"),
.linkedFramework("AppKit", .when(platforms: [.macOS])),
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
.linkedFramework("CoreTelephony", .when(platforms: [.iOS])),
]
),
.target(
name: "AppCenterAnalytics",
dependencies: ["AppCenter"],
path: "AppCenterAnalytics/AppCenterAnalytics",
exclude: ["Support"],
cSettings: [
.headerSearchPath("**"),
.headerSearchPath("../../AppCenter/AppCenter/**"),
],
linkerSettings: [
.linkedFramework("Foundation"),
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
.linkedFramework("AppKit", .when(platforms: [.macOS])),
]
),
.target(
name: "AppCenterCrashes",
dependencies: ["AppCenter", "CrashReporter"],
path: "AppCenterCrashes/AppCenterCrashes",
exclude: ["Support"],
cSettings: [
.headerSearchPath("**"),
.headerSearchPath("../../AppCenter/AppCenter/**"),
],
linkerSettings: [
.linkedFramework("Foundation"),
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
.linkedFramework("AppKit", .when(platforms: [.macOS])),
]
)
]
)
5 changes: 5 additions & 0 deletions vsts/internal-version-increment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ fi
if [ "$BUILD_SOURCEBRANCHNAME" != "master" ]; then
sed -i '' 's/\(VERSION_STRING[[:space:]]*=[[:space:]]*\).*/\1'$publish_version'/g' $VERSION_FILENAME
fi

# Update swift package manager config file
swift_package_file='Package.swift'
sed -i '' 's/\(define("APP_CENTER_C_VERSION",[[:space:]]*to:*\).*/\1''"\\"'$publish_version'\\""),''/g' $swift_package_file
sed -i '' 's/\(define("APP_CENTER_C_BUILD",[[:space:]]*to:*\).*/\1''"\\"'$latest_build_number'\\""),''/g' $swift_package_file

0 comments on commit 8ca3526

Please sign in to comment.