Skip to content

Commit 97f2ad1

Browse files
authored
feat: hello world foundation work (#1)
1 parent 45cefa7 commit 97f2ad1

File tree

57 files changed

+831
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+831
-0
lines changed

.github/workflows/pull-request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Pull Request"
2+
3+
on: [ workflow_dispatch, pull_request ]
4+
5+
jobs:
6+
7+
higgs-shop-sample-app:
8+
name: "Check Higgs Shop Sample App"
9+
uses: mParticle/mparticle-workflows/.github/workflows/android-sample-app-pull-request.yml@stable
10+
with:
11+
app_relative_path: "core-sdk-samples/higgs-shop-sample-app"

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: "Release Sample Apps"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryRun:
7+
description: "Do a dry run to preview instead of a real release [true/false]"
8+
required: true
9+
default: "true"
10+
11+
jobs:
12+
13+
# SDK release is done from public main branch.
14+
confirm-public-repo-main-branch:
15+
name: "Confirm release is run from public/main branch"
16+
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@stable
17+
18+
create-release-branch:
19+
name: "Create Release Branch"
20+
runs-on: ubuntu-18.04
21+
needs: confirm-public-repo-main-branch
22+
steps:
23+
- name: "Checkout next release branch"
24+
uses: actions/checkout@v2
25+
with:
26+
ref: development
27+
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
28+
- name: "Create and push release branch"
29+
run: |
30+
git checkout -b release/${{ github.run_number }}
31+
git push origin release/${{ github.run_number }}
32+
33+
# Bump up version for each sample app in repo
34+
# make sure to add build.gradle in release.sh
35+
semantic-release:
36+
name: "Semantic Release"
37+
needs: create-release-branch
38+
runs-on: macos-11
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
41+
GIT_AUTHOR_NAME: mparticle-bot
42+
GIT_AUTHOR_EMAIL: [email protected]
43+
GIT_COMMITTER_NAME: mparticle-bot
44+
GIT_COMMITTER_EMAIL: [email protected]
45+
steps:
46+
- name: "Checkout public main branch"
47+
uses: actions/checkout@v2
48+
with:
49+
fetch-depth: 0
50+
ref: main
51+
- name: "Install JDK 11"
52+
uses: actions/setup-java@v2
53+
with:
54+
distribution: "zulu"
55+
java-version: "11"
56+
- name: "Merge release branch into main branch"
57+
run: |
58+
git pull origin release/${{ github.run_number }}
59+
- name: "Semantic Release --dry-run"
60+
if: ${{ github.event.inputs.dryRun == 'true' }}
61+
run: |
62+
npx \
63+
-p lodash \
64+
-p semantic-release@17 \
65+
-p @semantic-release/changelog@5 \
66+
-p @semantic-release/git@9 \
67+
-p @semantic-release/exec@5 \
68+
semantic-release --dry-run
69+
- name: "Semantic Release"
70+
if: ${{ github.event.inputs.dryRun == 'false' }}
71+
run: |
72+
npx \
73+
-p lodash \
74+
-p semantic-release@17 \
75+
-p @semantic-release/changelog@5 \
76+
-p @semantic-release/git@9 \
77+
-p @semantic-release/exec@5 \
78+
semantic-release
79+
- name: "Push automated release commits to release branch"
80+
if: ${{ github.event.inputs.dryRun == 'false' }}
81+
run: |
82+
git push origin HEAD:release/${{ github.run_number }}
83+
84+
# Sample App APK
85+
- name: "Compile Higgs Shop Sample App"
86+
if: ${{ github.event.inputs.dryRun == 'false' }}
87+
working-directory: "core-sdk-samples/higgs-shop-sample-app"
88+
run: |
89+
./gradlew assembleRelease
90+
91+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
25+
.idea

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.iml
2+
.gradle
3+
.idea
4+
*/.idea/*
5+
/local.properties
6+
/.idea/caches
7+
/.idea/libraries
8+
/.idea/modules.xml
9+
/.idea/workspace.xml
10+
/.idea/navEditor.xml
11+
/.idea/assetWizardSettings.xml
12+
.DS_Store
13+
/build
14+
/captures
15+
.externalNativeBuild
16+
.cxx
17+
local.properties

core-sdk-samples/higgs-shop-sample-app/CHANGELOG.md

core-sdk-samples/higgs-shop-sample-app/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import java.text.SimpleDateFormat
2+
import java.util.Date
3+
import java.util.TimeZone
4+
5+
plugins {
6+
id("com.android.application")
7+
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
8+
kotlin("android")
9+
}
10+
11+
android {
12+
compileSdk = 31
13+
defaultConfig {
14+
applicationId = "com.mparticle.example.higgsshopsampleapp"
15+
minSdk = 16
16+
targetSdk = 31
17+
versionCode = buildVersionCode()
18+
versionName = "0.0.1-SNAPSHOT"
19+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
20+
}
21+
22+
buildTypes {
23+
getByName("release") {
24+
isMinifyEnabled = false
25+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26+
}
27+
}
28+
}
29+
30+
dependencies {
31+
implementation("androidx.core:core-ktx:1.7.0")
32+
implementation("androidx.appcompat:appcompat:1.4.1")
33+
implementation("com.google.android.material:material:1.5.0")
34+
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
35+
testImplementation("junit:junit:4.13.2")
36+
androidTestImplementation("androidx.test.ext:junit:1.1.3")
37+
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
38+
}
39+
40+
fun buildVersionCode(): Int {
41+
val df = SimpleDateFormat("yyyyMMddHH")
42+
df.setTimeZone(TimeZone.getTimeZone("EST"))
43+
return df.format(Date()).toInt()
44+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.kts.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)