Skip to content

Commit 385e9e1

Browse files
feat: real Android fixture for the upload-source-maps workflow (#2906)
1 parent b38091d commit 385e9e1

14 files changed

Lines changed: 407 additions & 12 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gradle/
2+
build/
3+
local.properties
4+
.idea/
5+
.kotlin/
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins {
2+
id("com.android.application")
3+
}
4+
5+
android {
6+
namespace = "com.posthog.sourcemapexample"
7+
compileSdk = 36
8+
9+
defaultConfig {
10+
applicationId = "com.posthog.sourcemapexample"
11+
minSdk = 24
12+
targetSdk = 36
13+
versionCode = 1
14+
versionName = "1.0"
15+
}
16+
17+
buildTypes {
18+
release {
19+
isMinifyEnabled = false
20+
proguardFiles(
21+
getDefaultProguardFile("proguard-android-optimize.txt"),
22+
"proguard-rules.pro",
23+
)
24+
// Debug-signed so `./gradlew installRelease` works without a keystore.
25+
signingConfig = signingConfigs.getByName("debug")
26+
}
27+
}
28+
}
29+
30+
dependencies {
31+
implementation("com.posthog:posthog-android:3.55.2")
32+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Project-specific ProGuard/R8 rules (none needed).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
6+
<application
7+
android:name=".SourceMapExampleApplication"
8+
android:label="SourceMapExampleAndroid">
9+
<activity
10+
android:name=".MainActivity"
11+
android:exported="true">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
<category android:name="android.intent.category.LAUNCHER" />
15+
</intent-filter>
16+
</activity>
17+
</application>
18+
19+
</manifest>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.posthog.sourcemapexample
2+
3+
import android.app.Activity
4+
import android.os.Bundle
5+
import android.view.Gravity
6+
import android.widget.TextView
7+
8+
class MainActivity : Activity() {
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
setContentView(
12+
TextView(this).apply {
13+
text = "Source Map Example (Android)"
14+
gravity = Gravity.CENTER
15+
},
16+
)
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.posthog.sourcemapexample
2+
3+
import android.app.Application
4+
import com.posthog.android.PostHogAndroid
5+
import com.posthog.android.PostHogAndroidConfig
6+
7+
class SourceMapExampleApplication : Application() {
8+
override fun onCreate() {
9+
super.onCreate()
10+
val config = PostHogAndroidConfig(
11+
apiKey = "phc_raG2H9V246hkNZk6K89DZGG98qQyPrKKlicifGlpOXA",
12+
host = "https://internal-c.posthog.com",
13+
)
14+
PostHogAndroid.setup(this, config)
15+
}
16+
}

apps/error-tracking-upload-source-maps/android/build.gradle

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id("com.android.application") version "9.0.0" apply false
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
2+
android.useAndroidX=true
Binary file not shown.

0 commit comments

Comments
 (0)