From d9eaf590ea17c43c55ec64bbd88deec3d27dcd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Wed, 12 Sep 2018 19:06:17 +0200 Subject: [PATCH 1/8] Bump version number --- SRGAppearance.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SRGAppearance.xcodeproj/project.pbxproj b/SRGAppearance.xcodeproj/project.pbxproj index 0f34592..654bd3f 100644 --- a/SRGAppearance.xcodeproj/project.pbxproj +++ b/SRGAppearance.xcodeproj/project.pbxproj @@ -599,7 +599,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -698,7 +698,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -874,7 +874,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -929,7 +929,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; From 5945cb8d5deabe026c8db04fba2593d1d67da95a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Wed, 19 Sep 2018 19:18:19 +0200 Subject: [PATCH 2/8] Update dependencies --- .gitignore | 3 +++ fastlane/Fastfile | 42 ++++++++++++++++++++++++++++++++++++++++++ fastlane/README.md | 29 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 fastlane/Fastfile create mode 100644 fastlane/README.md diff --git a/.gitignore b/.gitignore index d0a3007..e38c46a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ xcuserdata archive build + +fastlane/report.xml +fastlane/test_output \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..c66111d --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,42 @@ +# Customise this file, documentation can be found here: +# https://github.com/fastlane/fastlane/tree/master/fastlane/docs +# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md +# can also be listed using the `fastlane actions` command + +# Change the syntax highlighting to Ruby +# All lines starting with a # are ignored when running `fastlane` + +# This is the minimum version number required. +fastlane_version "1.95.0" + +default_platform :ios + +platform :ios do + before_all do |lane| + ensure_git_status_clean + end + + desc "Run library tests" + lane :test do + scan( + scheme: "SRGAppearance", + clean: true + ) + end + + after_all do |lane| + reset_git_repo(skip_clean: true) + end + + error do |lane, exception| + clean_build_artifacts + reset_git_repo(skip_clean: true, force: true) + end +end + + +# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md +# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md + +# fastlane reports which actions are used +# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 0000000..cd66005 --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,29 @@ +fastlane documentation +================ +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +``` +xcode-select --install +``` + +Install _fastlane_ using +``` +[sudo] gem install fastlane -NV +``` +or alternatively using `brew cask install fastlane` + +# Available Actions +## iOS +### ios test +``` +fastlane ios test +``` +Run library tests + +---- + +This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. +More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). +The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). From 40c2f7579198a3034df112112372d098d376bcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 20 Sep 2018 09:23:39 +0200 Subject: [PATCH 3/8] Update to class methods --- Demo/Sources/Application/AppDelegate.m | 2 +- Demo/Sources/Application/main.m | 2 +- Demo/Sources/Fonts/FontsViewController.m | 4 ++-- Framework/Sources/NSBundle+SRGAppearance.h | 4 ++-- Framework/Sources/NSBundle+SRGAppearance.m | 2 +- Framework/Sources/UIColor+SRGAppearance.h | 4 ++-- Framework/Sources/UIColor+SRGAppearance.m | 6 +++--- SRGAppearance.xcodeproj/project.pbxproj | 2 +- Tests/Sources/Helpers/BundleFix.m | 2 +- Tests/Sources/ImageTestCase.m | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Demo/Sources/Application/AppDelegate.m b/Demo/Sources/Application/AppDelegate.m index eafe3d0..f573023 100644 --- a/Demo/Sources/Application/AppDelegate.m +++ b/Demo/Sources/Application/AppDelegate.m @@ -13,7 +13,7 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - self.window.backgroundColor = [UIColor blackColor]; + self.window.backgroundColor = UIColor.blackColor; [self.window makeKeyAndVisible]; FontsViewController *fontsViewController = [[FontsViewController alloc] init]; diff --git a/Demo/Sources/Application/main.m b/Demo/Sources/Application/main.m index 2ace7f3..791d2ce 100644 --- a/Demo/Sources/Application/main.m +++ b/Demo/Sources/Application/main.m @@ -11,6 +11,6 @@ int main(int argc, char * argv[]) { @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + return UIApplicationMain(argc, argv, nil, NSStringFromClass(AppDelegate.class)); } } diff --git a/Demo/Sources/Fonts/FontsViewController.m b/Demo/Sources/Fonts/FontsViewController.m index 3ef054a..4a642a5 100644 --- a/Demo/Sources/Fonts/FontsViewController.m +++ b/Demo/Sources/Fonts/FontsViewController.m @@ -69,7 +69,7 @@ @implementation FontsViewController - (instancetype)init { - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:NSStringFromClass([self class]) bundle:nil]; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:NSStringFromClass(self.class) bundle:nil]; return [storyboard instantiateInitialViewController]; } @@ -79,7 +79,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.tableView.rowHeight = 60.f; + self.tableView.rowHeight = 60.f; [self reloadData]; } diff --git a/Framework/Sources/NSBundle+SRGAppearance.h b/Framework/Sources/NSBundle+SRGAppearance.h index cdb9cb5..b7eec2a 100644 --- a/Framework/Sources/NSBundle+SRGAppearance.h +++ b/Framework/Sources/NSBundle+SRGAppearance.h @@ -11,9 +11,9 @@ NS_ASSUME_NONNULL_BEGIN @interface NSBundle (SRGAppearance) /** - * The appearance resource bundle + * The appearance resource bundle. */ -+ (NSBundle *)srg_appearanceBundle; +@property (class, nonatomic, readonly) NSBundle *srg_appearanceBundle; @end diff --git a/Framework/Sources/NSBundle+SRGAppearance.m b/Framework/Sources/NSBundle+SRGAppearance.m index 1c545c2..0c5b11f 100644 --- a/Framework/Sources/NSBundle+SRGAppearance.m +++ b/Framework/Sources/NSBundle+SRGAppearance.m @@ -21,7 +21,7 @@ + (NSBundle *)srg_appearanceBundle static NSBundle *s_bundle; static dispatch_once_t s_onceToken; dispatch_once(&s_onceToken, ^{ - NSString *bundlePath = [[NSBundle bundleForClass:[SRGAppearanceBundle class]].bundlePath stringByAppendingPathComponent:@"SRGAppearance.bundle"]; + NSString *bundlePath = [[NSBundle bundleForClass:SRGAppearanceBundle.class].bundlePath stringByAppendingPathComponent:@"SRGAppearance.bundle"]; s_bundle = [NSBundle bundleWithPath:bundlePath]; NSAssert(s_bundle, @"Please add SRGAppearance.bundle to your project resources"); }); diff --git a/Framework/Sources/UIColor+SRGAppearance.h b/Framework/Sources/UIColor+SRGAppearance.h index 0103bbc..cbbf2d6 100644 --- a/Framework/Sources/UIColor+SRGAppearance.h +++ b/Framework/Sources/UIColor+SRGAppearance.h @@ -19,12 +19,12 @@ OBJC_EXPORT NSValueTransformer *SRGHexadecimalColorTransformer(void); /** * The official SRG SSR red color. */ -+ (UIColor *)srg_redColor; +@property (class, nonatomic, readonly) UIColor *srg_redColor; /** * The official SRG SSR blue color. */ -+ (UIColor *)srg_blueColor; +@property (class, nonatomic, readonly) UIColor *srg_blueColor; /** * Return the color matching a hexadecimal string (with or without leading wildcard), `nil` if the string does diff --git a/Framework/Sources/UIColor+SRGAppearance.m b/Framework/Sources/UIColor+SRGAppearance.m index 98bcfb9..e80bf8c 100644 --- a/Framework/Sources/UIColor+SRGAppearance.m +++ b/Framework/Sources/UIColor+SRGAppearance.m @@ -35,7 +35,7 @@ @implementation SRGHexadecimalColorValueTransformer + (Class)transformedValueClass { - return [UIColor class]; + return UIColor.class; } + (BOOL)allowsReverseTransformation @@ -45,7 +45,7 @@ + (BOOL)allowsReverseTransformation - (id)transformedValue:(id)value { - if (! [value isKindOfClass:[NSString class]]) { + if (! [value isKindOfClass:NSString.class]) { return nil; } @@ -67,7 +67,7 @@ - (id)transformedValue:(id)value - (id)reverseTransformedValue:(id)value { - if (! [value isKindOfClass:[UIColor class]]) { + if (! [value isKindOfClass:UIColor.class]) { return nil; } diff --git a/SRGAppearance.xcodeproj/project.pbxproj b/SRGAppearance.xcodeproj/project.pbxproj index 654bd3f..044fe3c 100644 --- a/SRGAppearance.xcodeproj/project.pbxproj +++ b/SRGAppearance.xcodeproj/project.pbxproj @@ -215,9 +215,9 @@ 6FA09D731D9E861600EDCA64 /* Sources */ = { isa = PBXGroup; children = ( + 6FE08CD91E8AA8E300EC4716 /* Helpers */, 6F5543EC20ADA2950049ECB2 /* FontsTestCase.m */, 6FA09D741D9E861600EDCA64 /* ColorTestCase.m */, - 6FE08CD91E8AA8E300EC4716 /* Helpers */, 6F5769B01EBCBE6100F931CA /* ImageTestCase.m */, ); path = Sources; diff --git a/Tests/Sources/Helpers/BundleFix.m b/Tests/Sources/Helpers/BundleFix.m index 05f5709..ac13454 100644 --- a/Tests/Sources/Helpers/BundleFix.m +++ b/Tests/Sources/Helpers/BundleFix.m @@ -28,7 +28,7 @@ + (void)load + (NSBundle *)swizzled_mainBundle { - return [NSBundle bundleForClass:[DummyClass class]]; + return [NSBundle bundleForClass:DummyClass.class]; } @end diff --git a/Tests/Sources/ImageTestCase.m b/Tests/Sources/ImageTestCase.m index a838a3d..43702cf 100644 --- a/Tests/Sources/ImageTestCase.m +++ b/Tests/Sources/ImageTestCase.m @@ -49,7 +49,7 @@ - (void)testTintedImageWithColor UIImage *image = [UIImage imageWithContentsOfFile:TestImagePath()]; XCTAssertEqualObjects([image srg_imageTintedWithColor:nil], image); - UIImage *tintedImage = [image srg_imageTintedWithColor:[UIColor blueColor]]; + UIImage *tintedImage = [image srg_imageTintedWithColor:UIColor.blueColor]; XCTAssertTrue(CGSizeEqualToSize(image.size, tintedImage.size)); } From f7649b7c091c4b7d3813067ede88b9d568ac72b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 20 Sep 2018 09:25:45 +0200 Subject: [PATCH 4/8] Parallelize and randomize tests --- .../xcshareddata/xcschemes/SRGAppearance.xcscheme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SRGAppearance.xcodeproj/xcshareddata/xcschemes/SRGAppearance.xcscheme b/SRGAppearance.xcodeproj/xcshareddata/xcschemes/SRGAppearance.xcscheme index 7566c95..82b5d11 100644 --- a/SRGAppearance.xcodeproj/xcshareddata/xcschemes/SRGAppearance.xcscheme +++ b/SRGAppearance.xcodeproj/xcshareddata/xcschemes/SRGAppearance.xcscheme @@ -30,7 +30,9 @@ shouldUseLaunchSchemeArgsEnv = "YES"> + skipped = "NO" + parallelizable = "YES" + testExecutionOrdering = "random"> Date: Thu, 20 Sep 2018 09:29:12 +0200 Subject: [PATCH 5/8] Update documentation --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 0f98ae1..ad23cb3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,7 +12,7 @@ SRG Appearance is a lightweight library providing unified SRG SSR appearance to ## Compatibility -The library is suitable for applications running on iOS 9 and above. The project is meant to be opened with the latest Xcode version (currently Xcode 9). +The library is suitable for applications running on iOS 9 and above. The project is meant to be opened with the latest Xcode version (currently Xcode 10). ## Installation From f4d2ed1d56695ab26ef34ff42a590fbbe8832f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Mon, 24 Sep 2018 08:55:50 +0200 Subject: [PATCH 6/8] Ignore root folders --- .gitignore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e38c46a..f61574d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,10 @@ *.xcscmblueprint xcuserdata -archive -build +/archive +/build -fastlane/report.xml -fastlane/test_output \ No newline at end of file +/Carthage + +/fastlane/report.xml +/fastlane/test_output \ No newline at end of file From 75cb90d710f4706f3756278520b9ef00471916ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 28 Sep 2018 10:12:20 +0200 Subject: [PATCH 7/8] Improve documentation --- docs/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index ad23cb3..6d2e672 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,8 +22,6 @@ The library can be added to a project using [Carthage](https://github.com/Cartha github "SRGSSR/srgappearance-ios" ``` -Until Carthage 0.30, only dynamic frameworks could be integrated. Starting with Carthage 0.30, though, frameworks can be integrated statically as well, which avoids slow application startups usually associated with the use of too many dynamic frameworks. - For more information about Carthage and its use, refer to the [official documentation](https://github.com/Carthage/Carthage). ### Dependencies From 0d9a344d98c961cc48c07f2c46a6a0873570c350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Fri, 28 Sep 2018 13:23:30 +0200 Subject: [PATCH 8/8] Add contributing guide and code of conduct --- docs/CODE_OF_CONDUCT.md | 46 +++++++++++++++++++++++++++++++++++++++++ docs/CONTRIBUTING.md | 41 ++++++++++++++++++++++++++++++++++++ docs/README.md | 4 ++++ 3 files changed, 91 insertions(+) create mode 100644 docs/CODE_OF_CONDUCT.md create mode 100644 docs/CONTRIBUTING.md diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..baa8507 --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 0000000..57158b9 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,41 @@ +## Introduction + +Thank you for very much for your interest in contributing to our project! As a public service company, we want to shape a product that better matches our user needs and desires. Ideas or direct contributions are therefore warmly welcome and will be considered with great care, provided they fulfill a few requirements listed in this document. Please read it first before you decide to contribute. + +### Why guidelines? + +Our development team is small, our ability to quickly evaluate a need or a code submission is therefore critical. Please follow the present contributing guidelines so that we can efficiently consider your proposal. You should also read or our [code of conduct](CODE_OF_CONDUCT.md), providing a few guidelines to keep interactions as respectful as possible. + +### Contributions we are looking for + +Any kind of contribution is welcome, as long as it improves the overall quality of our product, for example: + +* Requests for new features or ideas. +* Bug reports or fixes. +* Documentation improvements. +* Translation improvements. + +Contributions can either take the form of simple issues where you describe the problem you face or what you would like to see in our products. If you feel up to the challenge, you can even submit code in the form of pull requests which our team will review. + +### Contributions we are not looking for + +Requests which are too vague or not related to our product will not be taken into account. We also have no editorial influence, any issue related to the content available on our platform will simply be closed. + +## Contributing + +You can use issues to report bugs, submit ideas or request features. People with a programming background can also submit changes directly via pull requests. Creating issues or pull requests requires you to own or [open](https://github.com/join) a GitHub account. + +If you are not sure about the likelihood of a change you propose to be accepted, please open an issue first. We can discuss it there, especially whether it is compatible with our product or not. This way you can avoid creating an entire pull request we will never be able to merge. + +Templates are available when you want to contribute: + +* [Issues](https://github.com/SRGSSR/playsrg-ios/issues/new): Please follow our issue template. You can omit information which does not make sense but, in general, the more details you can provide, the better. This ensures we can quickly reproduce the problem you are facing, increasing the likelihood we can fix it. +* [Pull requests](https://github.com/SRGSSR/playsrg-ios/compare): Please follow our code conventions, test your code well, and write unit tests when this makes sense. We will review your work and, if successful, merge it back into the main development branch. + +## Code conventions + +We currently have no formal code conventions, but we try to keep our codebase consistent. In general, having a look at the code itself should be enough for you to discover how you should write your changes. + +## Code review + +Pull requests, once complete, can be submitted for review by our team. Depending on the complexity of the involved changes, a few iterations might be needed. Once a pull request has been approved, it will be rebased, merged back into the development trunk and delivered with the next release. \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 6d2e672..4618c3e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,6 +14,10 @@ SRG Appearance is a lightweight library providing unified SRG SSR appearance to The library is suitable for applications running on iOS 9 and above. The project is meant to be opened with the latest Xcode version (currently Xcode 10). +## Contributing + +If you want to contribute to the project, have a look at our [contributing guide](CONTRIBUTING.md). + ## Installation The library can be added to a project using [Carthage](https://github.com/Carthage/Carthage) by adding the following dependency to your `Cartfile`: