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

Fix version number reported by telemetry when using SPM #651

Merged
merged 1 commit into from
Feb 2, 2022
Merged
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
1 change: 1 addition & 0 deletions .shiprc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"files": {
"Auth0/Info.plist": [],
"Auth0/Version.swift": [],
"Auth0.podspec": [],
"README.md": ["~> {MAJOR}.{MINOR}"]
},
Expand Down
10 changes: 10 additions & 0 deletions Auth0.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
5BEDE18A1EC21B040007300D /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BEDE1891EC21B040007300D /* CredentialsManager.swift */; };
5BEDE1951EC333380007300D /* CredentialsManagerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BEDE1931EC3331A0007300D /* CredentialsManagerSpec.swift */; };
5BFB98A51F7D1232001FE50D /* AuthenticationServicesSessionCallback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BFB98A41F7D1232001FE50D /* AuthenticationServicesSessionCallback.swift */; };
5C23FAB027A9E3C900204391 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C23FAAF27A9E3C900204391 /* Version.swift */; };
5C23FAB127A9E3C900204391 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C23FAAF27A9E3C900204391 /* Version.swift */; };
5C23FAB227A9E3C900204391 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C23FAAF27A9E3C900204391 /* Version.swift */; };
5C23FAB327A9E3C900204391 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C23FAAF27A9E3C900204391 /* Version.swift */; };
5C29743223FDBD5400BC18FA /* Optional+DebugDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB41D3F23D0BA2C00074024 /* Optional+DebugDescription.swift */; };
5C29743323FDBD5400BC18FA /* Optional+DebugDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB41D3F23D0BA2C00074024 /* Optional+DebugDescription.swift */; };
5C29743423FDBD5500BC18FA /* Optional+DebugDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB41D3F23D0BA2C00074024 /* Optional+DebugDescription.swift */; };
Expand Down Expand Up @@ -516,6 +520,7 @@
5BEDE1891EC21B040007300D /* CredentialsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CredentialsManager.swift; sourceTree = "<group>"; };
5BEDE1931EC3331A0007300D /* CredentialsManagerSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = CredentialsManagerSpec.swift; path = Auth0Tests/CredentialsManagerSpec.swift; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
5BFB98A41F7D1232001FE50D /* AuthenticationServicesSessionCallback.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationServicesSessionCallback.swift; sourceTree = "<group>"; };
5C23FAAF27A9E3C900204391 /* Version.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = "<group>"; };
5C41F6A3244DC94E00252548 /* BaseAuthTransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseAuthTransaction.swift; sourceTree = "<group>"; };
5C41F6A6244DC9DB00252548 /* SessionTransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionTransaction.swift; sourceTree = "<group>"; };
5C41F6A9244DCAFB00252548 /* SessionCallbackTransaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionCallbackTransaction.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -886,6 +891,7 @@
5F3965C01CF679B500CDE7C0 /* Auth */,
5F06DDC81CC66B710011842B /* Auth0.swift */,
5FD255B61D14F00900387ECB /* Auth0Error.swift */,
5C23FAAF27A9E3C900204391 /* Version.swift */,
);
path = Auth0;
sourceTree = "<group>";
Expand Down Expand Up @@ -1762,6 +1768,7 @@
5C4F551E23C8FB8E00C89615 /* Array+Encode.swift in Sources */,
5B9262C01ECF0CA800F4F6D3 /* BioAuthentication.swift in Sources */,
5C4F552823C9116B00C89615 /* A0SimpleKeychain+RSAPublicKey.swift in Sources */,
5C23FAB027A9E3C900204391 /* Version.swift in Sources */,
5CB41D7123D0BED200074024 /* ClaimValidators.swift in Sources */,
5FADB60C1CED7E0800D4BB50 /* UserPatchAttributes.swift in Sources */,
5FCAB1791D09124D00331C84 /* NSURL+Auth0.swift in Sources */,
Expand Down Expand Up @@ -1835,6 +1842,7 @@
5C41F6CE244F970500252548 /* IDTokenValidator.swift in Sources */,
5C41F6CA244F96AE00252548 /* BaseAuthTransaction.swift in Sources */,
5FADB60D1CED7E0800D4BB50 /* UserPatchAttributes.swift in Sources */,
5C23FAB127A9E3C900204391 /* Version.swift in Sources */,
5C41F6CF244F970E00252548 /* IDTokenValidatorContext.swift in Sources */,
5C41F6DB244F97AB00252548 /* BaseWebAuth.swift in Sources */,
5F74CB411CEFD5E600226823 /* JSONObjectPayload.swift in Sources */,
Expand Down Expand Up @@ -1963,6 +1971,7 @@
5F23E6E51D4ACD8500C3F2D9 /* Request.swift in Sources */,
5F23E6E81D4ACD8500C3F2D9 /* Result.swift in Sources */,
5F23E6DD1D4ACD6100C3F2D9 /* NSURL+Auth0.swift in Sources */,
5C23FAB327A9E3C900204391 /* Version.swift in Sources */,
5F23E6E71D4ACD8500C3F2D9 /* Response.swift in Sources */,
5B2860D11EEAC30A00C75D54 /* UserInfo.swift in Sources */,
5F28B4631D8216180000EB23 /* Loggable.swift in Sources */,
Expand Down Expand Up @@ -2002,6 +2011,7 @@
5F23E71A1D4B891E00C3F2D9 /* Auth0.swift in Sources */,
5F23E7101D4B88FC00C3F2D9 /* Response.swift in Sources */,
5B2860D01EEAC30A00C75D54 /* UserInfo.swift in Sources */,
5C23FAB227A9E3C900204391 /* Version.swift in Sources */,
5F28B4641D8216180000EB23 /* Loggable.swift in Sources */,
5B0893E720F8A52400FBF962 /* CredentialsManagerError.swift in Sources */,
5F23E7091D4B88F600C3F2D9 /* Management.swift in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions Auth0/Telemetry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public struct Telemetry {
return items
}

static func versionInformation(bundle: Bundle = Bundle(for: Credentials.classForCoder())) -> [String: Any] {
let version = bundle.infoDictionary?["CFBundleShortVersionString"] as? String ?? Telemetry.NoVersion
static func versionInformation() -> [String: Any] {
let dict: [String: Any] = [
Telemetry.NameKey: Telemetry.LibraryName,
Telemetry.VersionKey: version,
Expand Down
1 change: 1 addition & 0 deletions Auth0/Version.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let version = "1.38.0"
32 changes: 1 addition & 31 deletions Auth0Tests/TelemetrySpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,8 @@ class TelemetrySpec: QuickSpec {

describe("versionInformation") {

let bundle = MockedBundle()

beforeEach {
bundle.version = nil
}

var subject: [String: Any] {
return Telemetry.versionInformation(bundle: bundle)
}

pending("should return bundle default version if nil") {
expect(subject["version"] as? String) == "0.0.0"
}

pending("should return bundle version") {
bundle.version = "1.0.0"
expect(subject["version"] as? String) == "1.0.0"
return Telemetry.versionInformation()
}

it("should return lib name") {
Expand Down Expand Up @@ -230,18 +215,3 @@ class TelemetrySpec: QuickSpec {
}

}


class MockedBundle: Bundle {

var version: String? = nil

override var infoDictionary: [String : Any]? {
if let version = self.version {
return [
"CFBundleShortVersionString": version
]
}
return nil
}
}