Skip to content

Commit b3af70d

Browse files
zhu-xiaoweizxkane
authored andcommitted
feat: init project and add configuration.
1 parent 23e3569 commit b3af70d

21 files changed

+956
-6
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/
6+
DerivedData/
7+
.swiftpm/config/registries.json
8+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
9+
.netrc

.gitlab-ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
default:
2+
image: swift
3+
tags:
4+
- size:2xlarge
5+
- arch:amd64
6+
7+
workflow:
8+
rules:
9+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
10+
when: always
11+
- if: $CI_COMMIT_REF_NAME == "main"
12+
when: always
13+
- when: never
14+
15+
# Check merge request message
16+
lint:
17+
stage: build
18+
script:
19+
- echo Start PR Validation
20+
- env
21+
- '[[ "$CI_COMMIT_MESSAGE" =~ ^(feat|fix|chore|docs|tests|ci) ]] || (echo "no commit type is specified in merge request title" && exit 1)'
22+
23+
24+

.swiftformat

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# file options
2+
--exclude Pods
3+
4+
# rules with format options
5+
6+
--enable braces
7+
--allman false
8+
--enable elseOnSameLine
9+
--elseposition same-line
10+
--enable fileHeader
11+
--header "//\n// Copyright Amazon.com Inc. or its affiliates.\n// All Rights Reserved.\n//\n// SPDX-License-Identifier: Apache-2.0\n//"
12+
--disable hoistPatternLet
13+
--patternlet inline
14+
--disable indent
15+
--ifdef outdent
16+
--indent 4
17+
--indentcase false
18+
--xcodeindentation disabled
19+
--enable linebreaks
20+
--linebreaks lf
21+
--enable numberFormatting
22+
--binarygrouping none
23+
--decimalgrouping 3
24+
--exponentcase lowercase
25+
--exponentgrouping disabled
26+
--fractiongrouping disabled
27+
--hexgrouping none
28+
--hexliteralcase lowercase
29+
--octalgrouping none
30+
--enable spaceAroundOperators
31+
--operatorfunc spaced
32+
--enable redundantSelf
33+
--self init-only
34+
--selfrequired
35+
--enable semicolons
36+
--semicolons never
37+
--disable sortedImports
38+
--importgrouping testable-bottom
39+
--enable spaceAroundOperators
40+
--operatorfunc spaced
41+
--enable trailingClosures
42+
--trailingclosures
43+
--disable trailingCommas
44+
--commas inline
45+
--enable trailingSpace
46+
--trimwhitespace always
47+
--disable unusedArguments
48+
--stripunusedargs closure-only
49+
--enable void
50+
--empty void
51+
--disable wrapArguments
52+
--closingparen same-line
53+
--wraparguments after-first
54+
--wrapcollections before-first
55+
56+
# standalone rules
57+
--disable andOperator
58+
--disable anyObjectProtocol
59+
--disable blankLinesAroundMark
60+
--disable blankLinesAtEndOfScope
61+
--disable blankLinesAtStartOfScope
62+
--disable blankLinesBetweenScopes
63+
--disable consecutiveBlankLines
64+
--disable consecutiveSpaces
65+
--disable duplicateImports
66+
--disable emptyBraces
67+
--enable isEmpty
68+
--enable leadingDelimiters
69+
--enable linebreakAtEndOfFile
70+
--enable redundantBackticks
71+
--enable redundantBreak
72+
--enable redundantExtensionACL
73+
--enable redundantFileprivate
74+
--enable redundantGet
75+
--disable redundantInit
76+
--enable redundantLet
77+
--enable redundantLetError
78+
--enable redundantNilInit
79+
--enable redundantObjc
80+
--enable redundantParens
81+
--disable redundantPattern
82+
--enable redundantRawValues
83+
--disable redundantReturn
84+
--enable redundantVoidReturnType
85+
--disable spaceAroundBraces
86+
--enable spaceAroundBrackets
87+
--enable spaceAroundComments
88+
--enable spaceAroundGenerics
89+
--enable spaceAroundParens
90+
--disable spaceInsideBraces
91+
--enable spaceInsideBrackets
92+
--disable spaceInsideComments
93+
--enable spaceInsideGenerics
94+
--disable spaceInsideParens
95+
--enable strongOutlets
96+
--enable strongifiedSelf
97+
--disable todos
98+
--enable typeSugar
99+
--enable yodaConditions

.swiftlint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Do not specify an `included` section at this top-level file. Specify the
2+
# `--config` option pointing to this file, and the `--path` option to the files
3+
# you wish to lint
4+
5+
excluded:
6+
- Pods
7+
- .build
8+
9+
analyzer_rules:
10+
- unused_import
11+
- unused_declaration
12+
13+
opt_in_rules:
14+
- empty_count
15+
16+
# configurable rules can be customized from this configuration file
17+
closing_brace: error
18+
colon:
19+
severity: error
20+
comma: error
21+
empty_count: warning
22+
empty_enum_arguments: error
23+
function_body_length:
24+
warning: 100
25+
error: 150
26+
identifier_name:
27+
excluded:
28+
- id
29+
- of
30+
- or
31+
line_length:
32+
warning: 120
33+
error: 160
34+
opening_brace: error
35+
return_arrow_whitespace: error
36+
statement_position:
37+
severity: error
38+
todo: warning
39+
trailing_semicolon: error
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>FILEHEADER</key>
6+
<string>
7+
// Copyright Amazon.com Inc. or its affiliates.
8+
// All Rights Reserved.
9+
//
10+
// SPDX-License-Identifier: Apache-2.0
11+
//</string>
12+
</dict>
13+
</plist>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Package.resolved

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// swift-tools-version: 5.7
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let platforms: [SupportedPlatform] = [.iOS(.v13), .macOS(.v10_15)]
7+
let package = Package(
8+
name: "aws-solution-clickstream-swift",
9+
platforms: platforms,
10+
products: [
11+
.library(
12+
name: "Clickstream",
13+
targets: ["Clickstream"]),
14+
],
15+
dependencies: [
16+
.package(url: "https://github.com/aws-amplify/amplify-swift.git", exact: "2.4.0"),
17+
],
18+
targets: [
19+
.target(
20+
name: "Clickstream",
21+
dependencies: [
22+
.product(name: "AWSPluginsCore", package: "amplify-swift"),
23+
]),
24+
.testTarget(
25+
name: "ClickstreamTests",
26+
dependencies: ["Clickstream"]),
27+
])

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
1-
## Clickstream Swift SDK
1+
# AWS Solution Clickstream Analytics SDK for Swift
22

3-
TODO: Fill this README out!
3+
## Introduction
44

5-
Be sure to:
5+
Clickstream iOS SDK can help you easily report in-app events on iOS. After the event is reported, statistics and analysis of specific scenario data can be completed on AWS Clickstream solution.
66

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
7+
The SDK relies on the Amplify for Swift Core Library and is developed according to the Amplify Swift SDK plug-in specification. In addition to this, we've added commonly used preset event statistics to make it easier to use.
8+
9+
## Platform Support
10+
11+
The Clickstream SDK supports iOS 13+.
12+
13+
## How to build&test locally
14+
15+
### Config your code format
16+
17+
Install [swiftformat plugin](https://github.com/nicklockwood/SwiftFormat#xcode-source-editor-extension) in your Xcode, and config shortcut for code format.
18+
19+
### Config your code lint
20+
21+
Install [swiftlint](https://github.com/realm/SwiftLint), and execute the below command at the project root folder:
22+
23+
```bash
24+
swiftlint
25+
```
26+
27+
### Build
28+
29+
Open an termial window, at the root project folder to execute:
30+
31+
```bash
32+
swift build
33+
```
34+
35+
### Test
36+
37+
```bash
38+
swift test
39+
```
940

1041
## Security
1142

1243
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
1344

1445
## License
1546

16-
This project is licensed under the Apache-2.0 License.
47+
This library is licensed under [Apache 2.0 License](./LICENSE).

0 commit comments

Comments
 (0)