-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from DataDog/ncreated/RUMM-101-create-sdk-project
RUMM-101 Create SDK project
- Loading branch information
Showing
14 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Contributing | ||
|
||
## Installation | ||
|
||
### `kickoff` tool | ||
|
||
The easiest way to start is to use `kickoff` tool. It will prepare your machine for contributions. Simply run the tool from repository root folder: | ||
```bash | ||
./tools/kickoff.sh | ||
``` | ||
|
||
### What does `kickoff` do? | ||
|
||
This project uses [Swift Package Manager](https://swift.org/package-manager/). `kickoff` will **generate `Datadog.xcodeproj`** for you. | ||
|
||
As part of our coding convention, we use **custom Xcode file templates** for creating `.swift` and unit test files. Templates will be automatically installed and available from Xcode's "New File..." menu (search for "Datadog" section). | ||
|
||
## Contributing to `Datadog` SDK | ||
|
||
_TBD_ | ||
|
||
## Contributing to Project Tools | ||
|
||
Tools are located in `tools` directory. They are set of scripts dedicated to project setup and development automation. | ||
|
||
Be aware of these conventions when contributing to tools: | ||
* each tool is located under separate directory in `tools/`, `kebab-case` convention is used for naming; | ||
* each script must work as it is executed from repository root folder (so they can be eventually used by `./tools/kickoff.sh`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// swift-tools-version:5.1 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Datadog", | ||
products: [ | ||
// Products define the executables and libraries produced by a package, and make them visible to other packages. | ||
.library( | ||
name: "Datadog", | ||
targets: ["Datadog"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
.target( | ||
name: "Datadog", | ||
dependencies: []), | ||
.testTarget( | ||
name: "DatadogTests", | ||
dependencies: ["Datadog"]), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Foundation | ||
|
||
public struct Datadog { | ||
public init() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import XCTest | ||
|
||
class DatadogTests: XCTestCase { | ||
|
||
func testItDoesSomething() { | ||
// 🐶 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR=${PWD##*/} | ||
|
||
if [ "$CURRENT_DIR" != "dd-sdk-ios" ]; then | ||
echo "\`kickoff.sh\` must be run in repository root folder: \`./tools/kickoff.sh\`"; exit 1 | ||
fi | ||
|
||
# Generate `Datadog.xcodeproj` | ||
swift package generate-xcodeproj | ||
|
||
# Install Datadog Xcode templates | ||
./tools/xcode-templates/install-xcode-templates.sh | ||
|
||
echo "💪 All good" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.56 KB
tools/xcode-templates/Datadog/Swift File.xctemplate/TemplateIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
tools/xcode-templates/Datadog/Swift File.xctemplate/TemplateInfo.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Kind</key> | ||
<string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string> | ||
<key>Description</key> | ||
<string>An empty Swift file.</string> | ||
<key>Summary</key> | ||
<string>An empty Swift file</string> | ||
<key>SortOrder</key> | ||
<string>30</string> | ||
<key>AllowedTypes</key> | ||
<array> | ||
<string>public.swift-source</string> | ||
</array> | ||
<key>DefaultCompletionName</key> | ||
<string>File</string> | ||
<key>MainTemplateFile</key> | ||
<string>___FILEBASENAME___.swift</string> | ||
</dict> | ||
</plist> |
1 change: 1 addition & 0 deletions
1
tools/xcode-templates/Datadog/Swift File.xctemplate/___FILEBASENAME___.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import Foundation |
Binary file added
BIN
+4.11 KB
tools/xcode-templates/Datadog/Unit Test Case Class.xctemplate/TemplateIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.56 KB
tools/xcode-templates/Datadog/Unit Test Case Class.xctemplate/TemplateIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
tools/xcode-templates/Datadog/Unit Test Case Class.xctemplate/TemplateInfo.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Kind</key> | ||
<string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string> | ||
<key>Description</key> | ||
<string>An empty Swift file.</string> | ||
<key>Summary</key> | ||
<string>An empty Swift file</string> | ||
<key>SortOrder</key> | ||
<string>30</string> | ||
<key>AllowedTypes</key> | ||
<array> | ||
<string>public.swift-source</string> | ||
</array> | ||
<key>DefaultCompletionName</key> | ||
<string>File</string> | ||
<key>MainTemplateFile</key> | ||
<string>___FILEBASENAME___.swift</string> | ||
</dict> | ||
</plist> |
8 changes: 8 additions & 0 deletions
8
tools/xcode-templates/Datadog/Unit Test Case Class.xctemplate/___FILEBASENAME___.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import XCTest | ||
|
||
class ___FILEBASENAMEASIDENTIFIER___: XCTestCase { | ||
|
||
func testItDoesSomething() { | ||
// 🐶 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
XCODE_LOCATION=$(xcode-select -p) | ||
XCODE_TEMPLATES_LOCATION="$XCODE_LOCATION/Library/Xcode/Templates/File Templates/" | ||
|
||
if [ -z "$XCODE_LOCATION" ]; then | ||
echo "🔥 Failed to install Xcode templates - cannot determine Xcode installation with \`xcode-select -p\`." | ||
exit 1 | ||
fi | ||
|
||
rm -r "$XCODE_TEMPLATES_LOCATION/Datadog" 2> /dev/null | ||
cp -R "./tools/xcode-templates/Datadog" "$XCODE_TEMPLATES_LOCATION" | ||
|
||
echo "✅ Installed Xcode templates" |