Skip to content

Commit

Permalink
Next major Android SDK v3 (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: PostHog Github Bot <[email protected]>
  • Loading branch information
marandaneto and PostHog Github Bot committed Oct 3, 2023
1 parent 09940e6 commit 6a53f45
Show file tree
Hide file tree
Showing 263 changed files with 9,614 additions and 16,512 deletions.
28 changes: 0 additions & 28 deletions .buildscript/deploy_snapshot.sh

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @marandaneto
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 🐞 Bug Report
description: Tell us about something that's not working the way we (probably) intend.
labels: ["Platform: Android", "bug"]
body:


- type: input
id: version
attributes:
label: Version
description: SDK Version
placeholder: 3.0.0 ← should look like this
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: How can we see what you're seeing? Specific is terrific.
placeholder: |-
1. foo
2. bar
3. baz
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Result
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Result
description: Logs? Screenshots? Yes, please.
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask in the forums
url: https://posthog.com/questions
about: A place to ask questions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 💡 Feature Request
description: Tell us about a problem our SDK could solve but doesn't.
labels: ["enhacement"]
body:
- type: textarea
id: problem
attributes:
label: Problem Statement
description: What problem could we solve that it doesn't?
placeholder: |-
I want to make whirled peas, but it doesn't blend.
validations:
required: true

- type: textarea
id: expected
attributes:
label: Solution Brainstorm
description: We know you have bright ideas to share ... share away, friend.
placeholder: |-
Add a blender to it.
validations:
required: false
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/maintainer-blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Blank Issue
description: Blank Issue. Reserved for maintainers.
body:
- type: textarea
id: description
attributes:
label: Description
description: Please describe the issue.
validations:
required: true
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## :bulb: Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## :green_heart: How did you test it?


## :pencil: Checklist
<!--- Put an `x` in the boxes that apply -->

- [ ] I reviewed the submitted code.
- [ ] I added tests to verify the changes.
- [ ] I updated the docs if needed.
- [ ] No breaking change or entry added to the changelog.
27 changes: 0 additions & 27 deletions .github/workflows/android.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Build & Test'
on:
push:
pull_request:

jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}

build:
name: Build Job ${{ matrix.os }} - Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: ['17']

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: 'Set up Java: ${{ matrix.java }}'
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Make compile
run: make compile

- name: Make stop
run: make stop
11 changes: 11 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Validate Gradle Wrapper'
on:
push:
pull_request:

jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # [email protected]
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Release'
on:
release:
# runs for stable and pre-releases
types: [published]

jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}

release:
name: Release Job ${{ matrix.os }} - Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: ['17']
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: 'Set up Java: ${{ matrix.java }}'
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: Update version
run: ./scripts/bump-version.sh ${{ github.event.release.tag_name }}

- name: Commit & push
run: |
echo "Tag name from github.ref_name: ${{ github.event.release.target_commitish }}"
./scripts/commit-code.sh ${{ github.event.release.target_commitish }}
# Let's be sure that everything works before we release
- name: Dry release
run: make dryRelease

- name: Release
run: make release
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,7 @@ build/
gradle-app.setting

# Jacoco
/posthog/jacoco.exec
/posthog/jacoco.exec

# eclipse
.project/
17 changes: 0 additions & 17 deletions .project

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 3.0.0-alpha.3 - 2023-10-02

- Added many tests and fixed small issues

## 3.0.0-alpha.2 - 2023-09-27

- Fix permission check for Network status ([commit](https://github.com/PostHog/posthog-android/commit/57b9626a745a37a9c92437529ba9eaf308b03771))

## 3.0.0-alpha.1 - 2023-09-26

- Next major of the Android SDK rewritten in Kotlin
- Just testing the release automation

## 2.0.3 - 2023-01-30

- Feature flags will be sent with payloads by default for capture and screen events.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GitHub by forking the repository and opening a pull request against `master`.

When submitting code, please make every effort to follow existing conventions
and style in order to keep the code as readable as possible. Please also make
sure your code compiles by running `make build test`. In addition please consider adding
sure your code compiles by running `make compile`. In addition please consider adding
unit tests covering your change, this will make your change much more likely to be accepted

Above all, thank you for contributing!
6 changes: 2 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2014 Segment.io, Inc.

Copyright (c) 2020 Hiberly Inc.
Copyright (c) [2023] [PostHog]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.PHONY: clean compile stop checkFormat format api dryRelease release testReport test testJava

clean:
./gradlew clean

compile:
./gradlew build

# We stop gradle at the end to make sure the cache folders
# don't contain any lock files and are free to be cached.
stop:
./gradlew --stop

checkFormat:
./gradlew spotlessCheck

format:
./gradlew spotlessApply

api:
./gradlew apiDump

dryRelease:
./gradlew publishToMavenLocal

release:
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository

testReport:
./gradlew koverHtmlReport

# compile already runs the tests (tests java and android)
test:
./gradlew testDebugUnitTest

# compile already runs the tests (tests only java)
testJava:
./gradlew :posthog:test
Loading

0 comments on commit 6a53f45

Please sign in to comment.