diff --git a/CHANGELOG.md b/CHANGELOG.md index 58eaf31..68a1d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.0.0 (24-07-2023) + +This major release does not have functional changes and is marked as such due to the change from `.framework` to `.xframework`, new testing pipelines, and dropped support for iOS 10 and 11. +Still, please view it as a major update and validate that it works in your existing projects. + +### Other + +- Updated internal API URL. +- Deprecated functionality removed (no effect on public methods). + +### Breaking changes + +- Moved to `.xcframework` format. +- Deployment target is set to iOS 11.0. + ## 0.10.2 (18-12-2020) ### Other diff --git a/Lokalise.framework/Info.plist b/Lokalise.framework/Info.plist deleted file mode 100644 index 6119c77..0000000 Binary files a/Lokalise.framework/Info.plist and /dev/null differ diff --git a/Lokalise.framework/Lokalise b/Lokalise.framework/Lokalise deleted file mode 100755 index ae17dd9..0000000 Binary files a/Lokalise.framework/Lokalise and /dev/null differ diff --git a/Lokalise.framework/strip-frameworks.sh b/Lokalise.framework/strip-frameworks.sh deleted file mode 100644 index 80814ab..0000000 --- a/Lokalise.framework/strip-frameworks.sh +++ /dev/null @@ -1,72 +0,0 @@ -################################################################################ -# -# Copyright 2015 Realm Inc. -# -# Licensed 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. -# -################################################################################ - -# This script strips all non-valid architectures from dynamic libraries in -# the application's `Frameworks` directory. -# -# The following environment variables are required: -# -# BUILT_PRODUCTS_DIR -# FRAMEWORKS_FOLDER_PATH -# VALID_ARCHS -# EXPANDED_CODE_SIGN_IDENTITY - - -# Signs a framework with the provided identity -code_sign() { - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" -} - -# Set working directory to product’s embedded frameworks -cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -if [ "$ACTION" = "install" ]; then - echo "Copy .bcsymbolmap files to .xcarchive" - find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \; -else - # Delete *.bcsymbolmap files from framework bundle unless archiving - find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\; -fi - -echo "Stripping frameworks" - -for file in $(find . -type f -perm +111); do - # Skip non-dynamic libraries - if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then - continue - fi - # Get architectures for current file - archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$file" "$file" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" != "" ]]; then - echo "Stripped $file of architectures:$stripped" - if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then - code_sign "${file}" - fi - fi -done diff --git a/Lokalise.podspec b/Lokalise.podspec index f22aa62..177de7a 100644 --- a/Lokalise.podspec +++ b/Lokalise.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Lokalise" - s.version = "0.10.2" + s.version = "1.0.0" s.summary = "Lokalise framework for OTA localization for iOS." s.description = <<-DESC.gsub(/^ +\|/,'') |No need to resubmit your app for review to update strings or translations anymore @@ -11,28 +11,22 @@ Pod::Spec.new do |s| | * Test localizations - create pre-release OTA localization bundles for your application. No need to recompile sources. Once the bundles are generated (at Lokalise Download page), see project settings to control versions and pre-release status. DESC - s.homepage = "https://lokalise.co" + s.homepage = "https://lokalise.com" s.license = { :type => "Custom", :file => 'LICENSE.md' } - s.author = { "Fedya Levkin" => "fedya@lokalise.co" } + s.author = { "Fedya Levkin" => "fedya@lokalise.com" } s.platform = :ios - s.ios.deployment_target = "9.0" + s.ios.deployment_target = "11.0" s.source = {:git => "https://github.com/lokalise/lokalise-ios-framework.git", :tag => s.version} - s.ios.vendored_frameworks = "Lokalise.framework" + s.ios.vendored_frameworks = "Lokalise.xcframework" s.frameworks = 'Foundation' s.libraries = 'c++', 'z' s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(inherited)" } - s.pod_target_xcconfig = { - 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' - } - - s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } - end diff --git a/Lokalise.xcframework/Info.plist b/Lokalise.xcframework/Info.plist new file mode 100644 index 0000000..35c78b5 --- /dev/null +++ b/Lokalise.xcframework/Info.plist @@ -0,0 +1,40 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + ios-arm64 + LibraryPath + Lokalise.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + Lokalise.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Lokalise.framework/Headers/Lokalise.h b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/Lokalise.h similarity index 98% rename from Lokalise.framework/Headers/Lokalise.h rename to Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/Lokalise.h index ad02ce7..ab51401 100644 --- a/Lokalise.framework/Headers/Lokalise.h +++ b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/Lokalise.h @@ -7,8 +7,8 @@ // #import -#import "LokaliseErrors.h" -#import "LokaliseLocalizationType.h" +#import +#import @protocol LokaliseDelegate; diff --git a/Lokalise.framework/Headers/LokaliseErrors.h b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/LokaliseErrors.h similarity index 100% rename from Lokalise.framework/Headers/LokaliseErrors.h rename to Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/LokaliseErrors.h diff --git a/Lokalise.framework/Headers/LokaliseLocalizationType.h b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/LokaliseLocalizationType.h similarity index 100% rename from Lokalise.framework/Headers/LokaliseLocalizationType.h rename to Lokalise.xcframework/ios-arm64/Lokalise.framework/Headers/LokaliseLocalizationType.h diff --git a/Lokalise.xcframework/ios-arm64/Lokalise.framework/Info.plist b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Info.plist new file mode 100644 index 0000000..6c1937a Binary files /dev/null and b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Info.plist differ diff --git a/Lokalise.xcframework/ios-arm64/Lokalise.framework/Lokalise b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Lokalise new file mode 100755 index 0000000..a9ce7f5 Binary files /dev/null and b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Lokalise differ diff --git a/Lokalise.framework/Modules/module.modulemap b/Lokalise.xcframework/ios-arm64/Lokalise.framework/Modules/module.modulemap similarity index 100% rename from Lokalise.framework/Modules/module.modulemap rename to Lokalise.xcframework/ios-arm64/Lokalise.framework/Modules/module.modulemap diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/Lokalise.h b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/Lokalise.h new file mode 100644 index 0000000..ab51401 --- /dev/null +++ b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/Lokalise.h @@ -0,0 +1,122 @@ +// +// Lokalise.h +// Lokalise +// +// Created by Fjodors Levkins on 20/05/15. +// Copyright (c) 2015 Lokalise SIA. All rights reserved. +// + +#import +#import +#import + +@protocol LokaliseDelegate; + +extern NSString *__nonnull LokaliseFrameworkVersion; +extern NSString *__nonnull LokaliseDidUpdateLocalizationNotification; + +@interface Lokalise : NSObject + +@property (class, readonly, strong) Lokalise *__nonnull sharedObject NS_SWIFT_NAME(shared); + +/** + Lokalise SDK token. + */ +@property (strong, nonatomic, readonly, nullable) NSString *token; + +/** + Lokalise Project ID. + */ +@property (strong, nonatomic, readonly, nullable) NSString *projectID; + +/** + Set api token and project ID. + + @param projectID Project ID. + @param token Lokalise SDK token. + */ +- (void)setProjectID:(NSString *__nonnull)projectID token:(NSString *__nonnull)token; + +/** + Set api token and project ID. + + @param apiToken Lokalise API Token. + @param projectID Project ID. + @deprecated Use [Lokalise.sharedObject setProjectId:projectId token:token] + */ +- (void)setAPIToken:(NSString *__nonnull)apiToken projectID:(NSString *__nonnull)projectID __deprecated_msg("Use [Lokalise.sharedObject setProjectId:projectId token:token]"); + +/** + Currently selected localization locale. + */ +@property (strong, nonatomic, readonly, nonnull) NSLocale *localizationLocale; + +/** + @return NSArray of NSLocale objects. Always has at least one locale. + */ +- (NSArray *__nonnull)availableLocales; + +/** + Sets localization locale which will be available right away. + Can be set only to one of available locales. + + @param localizationLocale Locale from availableLocales array. + @param makeDefault Application will remember selected locale if set to true. + @param completionBlock Completion block where error is nil if locale is set. + */ +- (void)setLocalizationLocale:(NSLocale *__nonnull)localizationLocale makeDefault:(BOOL)makeDefault completion:(void (^__nullable)(NSError *__nullable error))completionBlock; + +/** + Current bundle version. 0 if bundle is not loaded or downloaded. + */ +@property (nonatomic, readonly) NSInteger lokaliseBundleVersion; + +/** + Determines what source is used for localization. + Set to `LokaliseLocalizationRelease` by default. + */ +@property (nonatomic) LokaliseLocalizationType localizationType; + +/** + + This method returns the following when key is nil or not found in table: + + - If key is nil and value is nil, returns an empty string. + + - If key is nil and value is non-nil, returns value. + + - If key is not found and value is nil or an empty string, returns key. + + - If key is not found and value is non-nil and not empty, return value. + + @param key The key for a string in the table identified by tableName. + @param value The value to return if key is nil or if a localized string for key can’t be found in the table. + @param tableName The receiver’s string table to search. If tableName is nil or is an empty string, the method attempts to use the table in Localizable.strings. + + @return A localized version of the string designated by key in table tableName. + */ +- (NSString *__nonnull)localizedStringForKey:(NSString *__nonnull)key value:(NSString *__nullable)value table:(NSString *__nullable)tableName NS_FORMAT_ARGUMENT(1); + +/** + Check if new localization version is available and downloads it. + + @param completionBlock Completion block where parameter `updated` is set to true if new bundle was downloaded and `error` which provides details if something went wrong. + */ +- (void)checkForUpdatesWithCompletion:(void (^__nullable)(BOOL updated, NSError *__nullable error))completionBlock; + +/** +Deletes all files downloaded by lokalise framework. + */ +- (void)deleteLokaliseData; + +/** + Forces [[NSBundle mainBundle] localizedStringForKey:key value:value table:tableName] to use [[Lokalise shareObject] localizedStringForKey:key value:value table:tableName]. + */ +- (void)swizzleMainBundle; + +/** + Deswizzles [[NSBundle mainBundle] localizedStringForKey:key value:value table:tableName]. + */ +- (void)deswizzleMainBundle; + +@end diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseErrors.h b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseErrors.h new file mode 100644 index 0000000..89abf08 --- /dev/null +++ b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseErrors.h @@ -0,0 +1,40 @@ +// +// LokaliseErrors.h +// Lokalise +// +// Created by Fjodors Levkins on 21/05/15. +// Copyright (c) 2015 Lokalise SIA. All rights reserved. +// + +#ifndef Lokalise_LokaliseErrors_h +#define Lokalise_LokaliseErrors_h + +/** + Lokalise API error domain + */ +static NSString *LKLAPIErrorDomain = @"lokalise.api.error"; + +/** + Lokalise framework error domain + */ +static NSString *LKLErrorDomain = @"lokalise.error"; + +typedef NS_ENUM(NSInteger, LokaliseErrorCode) { + LokaliseErrorNoProjectData = 1, + LokaliseErrorLocaleNotSupported, + LokaliseErrorNoLokaliseFolder, + LokaliseErrorNoLokaliseBundle, + LokaliseErrorAlreadyUpdating, + LokaliseErrorFailedToExtact, + LokaliseErrorBadServerResponse, + LokaliseErrorBadBundleLocation, + LokaliseErrorBadServerBundleResponse, + LokaliseErrorNoLocalBundleForLocale, + LokaliseErrorNoLocalBundleForLocaleSwizzleDisabled, + LokaliseErrorNoLokaliseBundleForLocale, + LokaliseErrorNoUniqueIdentifier +}; + + +#endif + diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseLocalizationType.h b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseLocalizationType.h new file mode 100644 index 0000000..e895943 --- /dev/null +++ b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Headers/LokaliseLocalizationType.h @@ -0,0 +1,19 @@ +// +// LokaliseLocalizationType.h +// Lokalise +// +// Created by Fedya Levkin on 04/04/2017. +// Copyright © 2017 Lokalise SIA. All rights reserved. +// + +#ifndef LokaliseLocalizationType_h +#define LokaliseLocalizationType_h + +typedef NS_ENUM(NSInteger, LokaliseLocalizationType) { + LokaliseLocalizationRelease = 0, + LokaliseLocalizationPrerelease = 1, + LokaliseLocalizationLocal = 2, + LokaliseLocalizationDebug = 3 +}; + +#endif /* LokaliseLocalizationType_h */ diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Info.plist b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Info.plist new file mode 100644 index 0000000..5bb4c3f Binary files /dev/null and b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Info.plist differ diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Lokalise b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Lokalise new file mode 100755 index 0000000..a1ba818 Binary files /dev/null and b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Lokalise differ diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Modules/module.modulemap b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Modules/module.modulemap new file mode 100644 index 0000000..bc38c03 --- /dev/null +++ b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Lokalise { + umbrella header "Lokalise.h" + + export * + module * { export * } +} diff --git a/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/_CodeSignature/CodeResources b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..a0a3ac4 --- /dev/null +++ b/Lokalise.xcframework/ios-arm64_x86_64-simulator/Lokalise.framework/_CodeSignature/CodeResources @@ -0,0 +1,146 @@ + + + + + files + + Headers/Lokalise.h + + GzMYviNaapyNU8744wK+hAHOKnQ= + + Headers/LokaliseErrors.h + + iXwR7SRcLIa0gETUUGTMcyz51as= + + Headers/LokaliseLocalizationType.h + + 3xphzEo0BkQehdE/BdXcRjUyBYs= + + Info.plist + + CEdmQWloDLf6AcLFW3C620UgX4Q= + + Modules/module.modulemap + + 7jp7qCIzWo5+Uy4qhj0YIpJf2Zo= + + + files2 + + Headers/Lokalise.h + + hash2 + + qWw+VU0vA9aq9UG+SNTeSebCDNm+2e4o2KhP9VlDvNI= + + + Headers/LokaliseErrors.h + + hash2 + + H+FSsVOEJum1XgkM3GgzmfM+YP8zDla1RS/dSf/ngnI= + + + Headers/LokaliseLocalizationType.h + + hash2 + + upG5z7/Z2wWjNZr1dOJP7XfS8whpF+aafvF23/ZcJTs= + + + Modules/module.modulemap + + hash2 + + 1B0KiuyIY2twQLBa8vgbksKsK6uwwcvPJHJ417JLVQE= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/LokaliseCarthage.json b/LokaliseCarthage.json index f425551..d2a5635 100644 --- a/LokaliseCarthage.json +++ b/LokaliseCarthage.json @@ -1,4 +1,5 @@ { + "1.0.0": "https://github.com/lokalise/lokalise-ios-framework/archive/1.0.0.zip", "0.10.2": "https://github.com/lokalise/lokalise-ios-framework/archive/0.10.2.zip", "0.10.1": "https://github.com/lokalise/lokalise-ios-framework/archive/0.10.1.zip", "0.10.0": "https://github.com/lokalise/lokalise-ios-framework/archive/0.10.0.zip", diff --git a/Package.swift b/Package.swift index ae72a74..94d4dcd 100644 --- a/Package.swift +++ b/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "Lokalise", - platforms: [.iOS(.v9)], + platforms: [.iOS(.v11)], products: [ .library(name: "Lokalise", targets: ["Lokalise"]) @@ -13,8 +13,8 @@ let package = Package( targets: [ .binaryTarget( name: "Lokalise", - url: "https://github.com/lokalise/lokalise-ios-framework/releases/download/0.10.2/Lokalise.xcframework.0.10.2.zip", - checksum: "9e7c9ede0cc2092d3b86538e0b5c2244ed1d2f32323188a45f1dd06366a68be6" + url: "https://github.com/lokalise/lokalise-ios-framework/releases/download/1.0.0/Lokalise.xcframework.zip", + checksum: "aeedd53f1540ae6fce0952c43fadc07fe20fa35f4304962e1e897c9d1ff452c8" ) ] ) \ No newline at end of file diff --git a/Readme.md b/Readme.md index 063f880..34fa0ed 100644 --- a/Readme.md +++ b/Readme.md @@ -12,8 +12,8 @@ ## Requirements -- Xcode 12+ -- iOS 9.0+ +- Xcode 14+ +- iOS 11.0+ ## Setup @@ -21,11 +21,11 @@ To install using [Swift Package Manager](https://swift.org/package-manager/): -a. Add through **File -> Swift Packages -> Add Package Dependency...** action in Xcode. Use `https://github.com/lokalise/lokalise-ios-framework.git` repository URL and the **Version: Up to Next Minor** starting with `0.10.2` option. +a. Add through **File -> Swift Packages -> Add Package Dependency...** action in Xcode. Use `https://github.com/lokalise/lokalise-ios-framework.git` repository URL and the **Version: Up to Next Minor** starting with `1.0.0` option. b. Add this line to `dependencies` section of your `Package.swift`: ``` -.package(name: "Lokalise", url: "https://github.com/lokalise/lokalise-ios-framework.git", .upToNextMinor(from: "0.10.2")) +.package(name: "Lokalise", url: "https://github.com/lokalise/lokalise-ios-framework.git", .upToNextMinor(from: "1.0.0")) ``` ### CocoaPods @@ -36,7 +36,7 @@ To install using [CocoaPods](https://cocoapods.org): ``` use_frameworks! -pod 'Lokalise', '~> 0.10.2' +pod 'Lokalise', '~> 1.0.0' ``` ### Carthage @@ -46,31 +46,16 @@ To install using [Carthage](https://github.com/Carthage/Carthage): 1. Add this line to your Cartfile ``` -binary "https://raw.githubusercontent.com/lokalise/lokalise-ios-framework/master/LokaliseCarthage.json" ~> 0.10.2 +binary "https://raw.githubusercontent.com/lokalise/lokalise-ios-framework/master/LokaliseCarthage.json" ~> 1.0.0 ``` 2. Link **c++ (libc++.tbd)** and **z (libz.tbd)** libraries to your targets. -### Manual *(.framework)* - -To install manually: - -1. Download **Lokalise.framework** from this repository and add it to your project. - -2. Add it to your targets (embed and link). - -3. Link **c++ (libc++.tbd)** and **z (libz.tbd)** libraries. - -4. Add **Run Script** to your **Build Phases**. -``` -bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lokalise.framework/strip-frameworks.sh" -``` - ### Manual *(.xcframework)* To install **.xcframework** manualy: -1. Download the [Zip archive](https://github.com/lokalise/lokalise-ios-framework/releases/download/0.10.2/Lokalise.xcframework.0.10.2.zip) containing the **.xcframework**, extract it, and add it to your project. +1. Download **Lokalise.xcframework** from this repository and add it to your project. 2. Add it to your targets (embed and link).