Skip to content

Commit ab5e617

Browse files
committed
init commit
0 parents  commit ab5e617

File tree

22 files changed

+808
-0
lines changed

22 files changed

+808
-0
lines changed

.github/CONTRIBUTING.md

Whitespace-only changes.

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: triage
6+
assignees: bsneed
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Do '...'
16+
2. '....'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Platform (please complete the following information):**
26+
- Library Version in use: [e.g. 0.0.5]
27+
- Platform being tested: [e.g. Android]
28+
- Integrations in use: [e.g. Firebase, Amplitude]
29+
30+
**Additional context**
31+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: triage
6+
assignees: prayansh
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Purpose
2+
_Describe the problem or feature in addition to a link to the issues._
3+
4+
## Approach
5+
_How does this change address the problem?_
6+
7+
#### Open Questions and Pre-Merge TODOs
8+
- [ ] Use github checklists. When solved, check the box and explain the answer.
9+
10+
## Learning
11+
_Describe the research stage_
12+
13+
_Links to blog posts, patterns, libraries or addons used to solve this problem_

.github/workflows/build.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
12+
cancel_previous:
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: styfle/[email protected]
17+
with:
18+
workflow_id: ${{ github.event.workflow.id }}
19+
20+
build:
21+
22+
needs: cancel_previous
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
- name: cache gradle dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
36+
restore-keys: |
37+
${{ runner.os }}-gradle-
38+
- name: Run Tests
39+
run: ./gradlew check
40+
41+
security:
42+
43+
needs: cancel_previous
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Grant execute permission for gradlew
49+
run: chmod +x gradlew
50+
- name: Snyk
51+
run: ./gradlew snyk-test
52+
env:
53+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
54+

.github/workflows/release.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
environment: deployment
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Get tag
15+
id: vars
16+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
17+
- name: Verify tag
18+
run: |
19+
VERSION=$(grep VERSION_NAME gradle.properties | awk -F= '{ print $2 }' | sed "s/-SNAPSHOT//")
20+
if [ "${{ steps.vars.outputs.tag }}" != "$VERSION" ]; then {
21+
echo "Tag ${{ steps.vars.outputs.tag }} does not match the package version ($VERSION)"
22+
exit 1
23+
} fi
24+
25+
- name: Grant execute permission for gradlew
26+
run: chmod +x gradlew
27+
- name: cache gradle dependencies
28+
uses: actions/cache@v2
29+
with:
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
34+
restore-keys: |
35+
${{ runner.os }}-gradle-core-
36+
- name: Publush release to sonatype
37+
run: ./gradlew publishToSonatype -Prelease closeAndReleaseSonatypeStagingRepository
38+
env:
39+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
40+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
41+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
42+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
43+
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}
44+
45+
- name: create release
46+
run: |
47+
curl \
48+
-X POST \
49+
-H "Authorization: token $GITHUB_TOKEN" \
50+
https://api.github.com/repos/${{github.repository}}/releases \
51+
-d '{"tag_name": "${{ env.RELEASE_VERSION }}", "name": "${{ env.RELEASE_VERSION }}", "body": "Release of version ${{ env.RELEASE_VERSION }}", "draft": false, "prerelease": false, "generate_release_notes": true}'
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}

.github/workflows/snapshot.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Snapshot
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
snapshot:
9+
runs-on: ubuntu-latest
10+
environment: deployment
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Grant execute permission for gradlew
14+
run: chmod +x gradlew
15+
- name: cache gradle dependencies
16+
uses: actions/cache@v2
17+
with:
18+
path: |
19+
~/.gradle/caches
20+
~/.gradle/wrapper
21+
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
22+
restore-keys: |
23+
${{ runner.os }}-gradle-core-
24+
- name: Publush snapshot to sonatype
25+
run: ./gradlew publishToSonatype
26+
env:
27+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
28+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
29+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
30+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
31+
SIGNING_PRIVATE_KEY_BASE64: ${{ secrets.SIGNING_PRIVATE_KEY_BASE64 }}

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
.idea
8+
9+
lib/build

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// add badges and stuff here
2+
3+
# Destination
4+
5+
## Getting Started
6+
7+
// TODO
8+
9+
10+
## License
11+
```
12+
MIT License
13+
14+
Copyright (c) 2021 Segment
15+
16+
Permission is hereby granted, free of charge, to any person obtaining a copy
17+
of this software and associated documentation files (the "Software"), to deal
18+
in the Software without restriction, including without limitation the rights
19+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
copies of the Software, and to permit persons to whom the Software is
21+
furnished to do so, subject to the following conditions:
22+
23+
The above copyright notice and this permission notice shall be included in all
24+
copies or substantial portions of the Software.
25+
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32+
SOFTWARE.
33+
```

RELEASING.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Update Version
2+
=========
3+
1. Update VERSION_CODE in `gradle.properties`
4+
2. Update VERSION_NAME in `gradle.properties`
5+
6+
Releasing
7+
=========
8+
9+
1. Create a new branch called `release/X.Y.Z`
10+
2. `git checkout -b release/X.Y.Z`
11+
3. Change the version in `gradle.properties` to your desired release version (see `Update Version`)
12+
4. `git commit -am "Create release X.Y.Z."` (where X.Y.Z is the new version)
13+
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
14+
6. Upgrade to next version by changing version in `gradle.properties`
15+
7. `git commit -am "Prepare snapshot X.Y.Z-SNAPSHOT"`
16+
8. `git push && git push --tags`
17+
9. Create a PR to merge the new branch into `master`
18+
10. The CI pipeline will recognize the tag and upload, close and promote the artifacts automatically, and generate changelog automatically
19+
20+
Example (stable release)
21+
========
22+
1. Current VERSION_NAME in `gradle.properties` = 1.3.0
23+
2. `git checkout -b release/1.3.1`
24+
3. Change VERSION_NAME = 1.3.1 (next higher version)
25+
4. Update CHANGELOG.md
26+
5. `git commit -am "Create release 1.3.1`
27+
6. `git tag -a 1.3.1 -m "Version 1.3.1"`
28+
6. `git push && git push --tags`
29+
7. Change VERSION_NAME = 1.3.2 (next higher version)
30+
8. `git commit -am "Prepare snapshot 1.3.2-SNAPSHOT"`
31+
9. `git push && git push --tags`
32+
10. Merging PR master will create a snapshot release 1.3.2-SNAPSHOT and tag push will create stable release 1.3.1

build.gradle.kts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
val GROUP: String by project
2+
val VERSION_NAME: String by project
3+
4+
group = GROUP
5+
version = getVersionName()
6+
7+
plugins {
8+
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
9+
id("org.jetbrains.kotlin.jvm") version "1.5.30"
10+
11+
// Apply snyk plugin to test vulnerability
12+
id("io.snyk.gradle.plugin.snykplugin") version "0.4"
13+
14+
// Apply the java-library plugin for API and implementation separation.
15+
`java-library`
16+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
17+
18+
}
19+
20+
repositories {
21+
// Use JCenter for resolving dependencies.
22+
mavenCentral()
23+
gradlePluginPortal()
24+
}
25+
buildscript {
26+
dependencies {
27+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
28+
}
29+
}
30+
31+
configure<io.snyk.gradle.plugin.SnykExtension> {
32+
// setSeverity("high")
33+
setAutoDownload(true)
34+
setAutoUpdate(true)
35+
setArguments("--all-sub-projects --fail-on=upgradable")
36+
}
37+
38+
nexusPublishing {
39+
repositories {
40+
sonatype()
41+
}
42+
}
43+
44+
fun getVersionName() =
45+
if (hasProperty("release"))
46+
VERSION_NAME
47+
else
48+
"$VERSION_NAME-SNAPSHOT"

gradle.properties

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Deployment variables
2+
GROUP=com.segment.analytics.kotlin
3+
4+
VERSION_CODE=<100>
5+
VERSION_NAME=<1.0.0>
6+
7+
POM_ARTIFACT_ID=<destination-name>
8+
POM_NAME=<Destination Name>
9+
POM_DESCRIPTION=<Destination Description>
10+
11+
POM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
12+
POM_SCM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
13+
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/<analytics-kotlin-destination>.git
14+
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/segmentio/<analytics-kotlin-destination>.git
15+
16+
POM_LICENCE_NAME=The MIT License (MIT)
17+
POM_LICENCE_URL=http://opensource.org/licenses/MIT
18+
POM_LICENCE_DIST=repo
19+
20+
POM_DEVELOPER_ID=segmentio
21+
POM_DEVELOPER_NAME=Segment, Inc.

gradle/wrapper/gradle-wrapper.jar

58.1 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)