Skip to content

Commit

Permalink
Preparation for open source repo
Browse files Browse the repository at this point in the history
OKTA-404190
<<<Jenkins Check-In of Tested SHA: 5c10baa for [email protected]>>>
Artifact: okta-ios-logger
Files changed count: 39
PR Link: "#39"
  • Loading branch information
marcpowell-okta authored and eng-prod-CI-bot-okta committed Jul 1, 2021
1 parent 803c948 commit c1dcd19
Show file tree
Hide file tree
Showing 39 changed files with 490 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.0
2.7.2
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: swift
os: osx
osx_image: xcode12.2

before_install:
- gem install xcpretty
- gem install cocoapods
jobs:
include:
- stage: Linting
name: SwiftLint
addons:
homebrew:
packages:
- swiftlint
update: true
script:
- swiftlint
- stage: Unit Tests
name: iOS
script:
- xcodebuild -workspace "OktaLogger.xcworkspace" -scheme "OktaLogger" -destination "platform=iOS Simulator,OS=latest,name=iPhone 11" clean test | xcpretty
- stage: Dependency Manager Validation
name: CocoaPods
script:
- pod lib lint --allow-warnings
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Contributing to Okta Open Source Repos
======================================

Sign the CLA
------------

If you haven't already, [sign the CLA](https://developer.okta.com/cla/). Common questions/answers are also listed on the CLA page.

Summary
-------
This document covers how to contribute to an Okta Open Source project. These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the Okta Logger SDK project and you will submit a Pull Request for your changes to be added.

_Lets get started!!!_


Fork the code
-------------

In your browser, navigate to: [https://github.com/okta/okta-logger-swift](https://github.com/okta/okta-os)

Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command.

On your computer, follow these steps to setup a local repository for working on the Okta Logger SDK:

``` bash
$ git clone https://github.com/YOUR_ACCOUNT/okta-logger-swift.git
$ cd okta-logger-swift
$ git remote add upstream https://github.com/okta/okta-logger-swift.git
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
```


Making changes
--------------

It is important that you create a new branch to make changes on and that you do not change the `master` branch (other than to rebase in changes from `upstream/master`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the Okta Logger SDK project.

It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.

``` bash
$ git checkout -b feature_x
(make your changes)
$ git status
$ git add .
$ git commit -a -m "descriptive commit message for your changes"
```

> The `-b` specifies that you want to create a new branch called `feature_x`. You only specify `-b` the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.

Rebase `feature_x` to include updates from `upstream/master`
------------------------------------------------------------

It is important that you maintain an up-to-date `master` branch in your local repository. This is done by rebasing in the code changes from `upstream/master` (the official Okta Logger SDK project repository) into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.

This process will do the following:

1. Checkout your local `master` branch
2. Synchronize your local `master` branch with the `upstream/master` so you have all the latest changes from the project
3. Rebase the latest project code into your `feature_x` branch so it is up-to-date with the upstream code

``` bash
$ git checkout master
$ git fetch upstream
$ git rebase upstream/master
$ git checkout feature_x
$ git rebase master
```

> Now your `feature_x` branch is up-to-date with all the code in `upstream/master`.

Make a GitHub Pull Request to contribute your changes
-----------------------------------------------------

When you are happy with your changes and you are ready to contribute them, you will create a Pull Request on GitHub to do so. This is done by pushing your local changes to your forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.

> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/master` _before_ you do this.
``` bash
$ git push origin master
$ git push origin feature_x
```

Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.

To initiate the pull request, do the following:

1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/okta-logger-swift](https://github.com/YOUR_ACCOUNT/okta-logger-swift)
2. Click the new button called '**Compare & pull request**' that showed up just above the main area in your forked repository
3. Validate the pull request will be into the upstream `master` and will be from your `feature_x` branch
4. Enter a detailed description of the work you have done and then click '**Send pull request**'

If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.


Cleaning up after a successful pull request
-------------------------------------------

Once the `feature_x` branch has been committed into the `upstream/master` branch, your local `feature_x` branch and the `origin/feature_x` branch are no longer needed. If you want to make additional changes, restart the process with a new branch.

> **IMPORTANT:** Make sure that your changes are in `upstream/master` before you delete your `feature_x` and `origin/feature_x` branches!
You can delete these deprecated branches with the following:

``` bash
$ git checkout master
$ git branch -D feature_x
$ git push origin :feature_x
```
10 changes: 0 additions & 10 deletions Config.xcconfig

This file was deleted.

19 changes: 11 additions & 8 deletions Example/Example-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// AppDelegate.swift
// OktaLoggerDemoApp
//
// Created by Lihao Li on 6/5/20.
// Copyright © 2020 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 UIKit
import OktaLogger
import Firebase
Expand Down
19 changes: 11 additions & 8 deletions Example/Example-iOS/DemoTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// DemoTableViewCell.swift
// OktaLoggerDemoApp
//
// Created by Kaushik Krishnakumar on 7/14/20.
// Copyright © 2020 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 UIKit

class DemoTableViewCell: UITableViewCell {
Expand Down
19 changes: 11 additions & 8 deletions Example/Example-iOS/LoggerDemoViewController.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// LoggerDemoViewController.swift
// OktaLoggerDemoApp
//
// Created by Lihao Li on 6/5/20.
// Copyright © 2020 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 UIKit
import OktaLogger

Expand Down
19 changes: 11 additions & 8 deletions Example/Example-iOS/LoggerDemoViewModel.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// LoggerDemoViewModel.swift
// OktaLoggerDemoApp
//
// Created by Borys Kasianenko on 3/3/21.
// Copyright © 2021 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 Foundation
import OktaLogger
import FirebaseCrashlytics
Expand Down
19 changes: 11 additions & 8 deletions Example/Example-iOS/LogsBrowseViewController.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// LogsBrowseViewController.swift
// OktaLoggerDemoApp
//
// Created by Borys Kasianenko on 3/4/21.
// Copyright © 2021 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 UIKit

class LogsBrowseViewController: UIViewController {
Expand Down
19 changes: 11 additions & 8 deletions Example/Example-iOS/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// SceneDelegate.swift
// OktaLoggerDemoApp
//
// Created by Lihao Li on 6/5/20.
// Copyright © 2020 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
Expand Down
2 changes: 1 addition & 1 deletion OktaLogger.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OktaLogger"
s.version = "1.2.1"
s.version = "1.2.2"
s.summary = "Logging proxy for standardized logging interface across products"
s.description = "Standard interface for all logging in Okta apps + SDK. Supports file, console, firebase logging destinations."
s.homepage = "https://github.com/okta/okta-logger-swift"
Expand Down
6 changes: 2 additions & 4 deletions OktaLogger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
804F18F724C0174800894A52 /* OktaLoggerFileLoggerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 804F18F624C0174800894A52 /* OktaLoggerFileLoggerTests.swift */; };
806FF25E24B95A3300994D4D /* OktaLoggerFileLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 806FF25D24B95A3300994D4D /* OktaLoggerFileLogger.swift */; };
80AA110224BE799800981074 /* DemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80AA110124BE799800981074 /* DemoTableViewCell.swift */; };
8DCF5F682644B25D008698CD /* AppCenterLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DCF5F672644B25D008698CD /* AppCenterLogger.swift */; };
8DCF5EB8263CACAD008698CD /* DDLogFileManagerCustomName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DCF5EB7263CACAC008698CD /* DDLogFileManagerCustomName.swift */; };
8DCF5F682644B25D008698CD /* AppCenterLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DCF5F672644B25D008698CD /* AppCenterLogger.swift */; };
B3E071E3B33C4657A8B4381B /* libPods-OktaLogger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 62BB891524DBDEF8FC8E9711 /* libPods-OktaLogger.a */; };
C4AA0759EDAC342A3B6B6796 /* libPods-OktaLoggerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FFB48B8C0D4F4DD1D258FFD /* libPods-OktaLoggerTests.a */; };
D52C2AD12474A4F5003CCF4D /* ReadWriteLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52C2AD02474A4F5003CCF4D /* ReadWriteLock.swift */; };
Expand Down Expand Up @@ -102,9 +102,8 @@
804F18F624C0174800894A52 /* OktaLoggerFileLoggerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaLoggerFileLoggerTests.swift; sourceTree = "<group>"; };
806FF25D24B95A3300994D4D /* OktaLoggerFileLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OktaLoggerFileLogger.swift; sourceTree = "<group>"; };
80AA110124BE799800981074 /* DemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTableViewCell.swift; sourceTree = "<group>"; };
80DDE79324B972FC00D0E2F3 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
8DCF5F672644B25D008698CD /* AppCenterLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCenterLogger.swift; sourceTree = "<group>"; };
8DCF5EB7263CACAC008698CD /* DDLogFileManagerCustomName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DDLogFileManagerCustomName.swift; sourceTree = "<group>"; };
8DCF5F672644B25D008698CD /* AppCenterLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCenterLogger.swift; sourceTree = "<group>"; };
C58A9E54B6CE1A902894264C /* Pods-OktaLoggerDemoApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OktaLoggerDemoApp.debug.xcconfig"; path = "Target Support Files/Pods-OktaLoggerDemoApp/Pods-OktaLoggerDemoApp.debug.xcconfig"; sourceTree = "<group>"; };
D52C2AD02474A4F5003CCF4D /* ReadWriteLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadWriteLock.swift; sourceTree = "<group>"; };
D54461C02469FFBA00C755F1 /* OktaLoggerLogLevel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaLoggerLogLevel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -206,7 +205,6 @@
D5C824CA2469DBF1005CF747 = {
isa = PBXGroup;
children = (
80DDE79324B972FC00D0E2F3 /* Config.xcconfig */,
DEC5276524DBF9630022B698 /* GoogleService-Info.plist */,
E251E7F5248AD13D00EF466D /* Example */,
D5C824D62469DBF1005CF747 /* OktaLogger */,
Expand Down
3 changes: 0 additions & 3 deletions OktaLogger.xcworkspace/contents.xcworkspacedata

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

16 changes: 11 additions & 5 deletions OktaLogger/AppCenterLogger/AppCenterLogger.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
//
// Created by Brenner Ryan on 5/11/21.
// Copyright (c) 2021 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 AppCenterAnalytics

/**
Expand Down
19 changes: 11 additions & 8 deletions OktaLogger/FileLoggers/DDLogFileManagerCustomName.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//
// DDLogFileManagerCustomName.swift
// OktaLogger
//
// Created by Brenner Ryan on 4/30/21.
// Copyright (c) 2021 Okta, Inc. All rights reserved.
//

/*
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (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 Foundation
import CocoaLumberjack

Expand Down
Loading

0 comments on commit c1dcd19

Please sign in to comment.