Skip to content

Commit 8b6c233

Browse files
committed
Public Release
1 parent e46d64d commit 8b6c233

Some content is hidden

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

56 files changed

+2778
-3
lines changed

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: publish-release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*' # publish on any tag (e.g., 1.0.2 or v1.0.2)
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Derive version from tag
19+
id: ver
20+
shell: bash
21+
run: |
22+
TAG="${GITHUB_REF##*/}" # "1.2.3" or "v1.2.3"
23+
VERSION="${TAG#v}" # strip leading 'v' if present
24+
if [[ -z "$VERSION" ]]; then
25+
echo "Tag is empty → cannot compute version"; exit 1
26+
fi
27+
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
28+
29+
- name: Set up JDK and import GPG key
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: temurin
33+
java-version: '21'
34+
cache: gradle
35+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
36+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
37+
38+
# ---- Sanity checks ----
39+
- name: Sanity - show derived version / Java / Gradle
40+
run: |
41+
echo "Derived version: ${{ steps.ver.outputs.VERSION }}"
42+
java -version
43+
./gradlew --version
44+
45+
- name: Sanity - list imported GPG secret keys
46+
run: gpg --list-secret-keys --keyid-format=long
47+
# -----------------------
48+
49+
- name: Configure Gradle (Central + signing via gpg)
50+
shell: bash
51+
run: |
52+
mkdir -p ~/.gradle
53+
cat > ~/.gradle/gradle.properties <<'EOF'
54+
# Sonatype Central Portal token credentials
55+
mavenCentralUsername=${{ secrets.MAVEN_CENTRAL_USERNAME }}
56+
mavenCentralPassword=${{ secrets.MAVEN_CENTRAL_PASSWORD }}
57+
58+
# Use system gpg imported by setup-java
59+
signing.gnupg.useGpgCmd=true
60+
signing.gnupg.keyName=${{ secrets.GPG_KEY_ID }}
61+
signing.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }}
62+
63+
# Let the Vanniktech plugin auto-release after upload
64+
mavenCentralAutomaticPublishing=true
65+
EOF
66+
67+
- name: Build (AAR + sources/javadoc jars)
68+
run: ./gradlew clean assembleRelease --no-daemon
69+
70+
- name: Publish to Maven Central (auto-release)
71+
run: ./gradlew -Pversion=${{ steps.ver.outputs.VERSION }} publishToMavenCentral --no-daemon --stacktrace

.gitignore

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

Example/.gitignore

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

Example/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Example/app/build.gradle.kts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
alias(libs.plugins.kotlin.compose)
5+
}
6+
7+
android {
8+
namespace = "io.deepone.app"
9+
compileSdk = 36
10+
11+
defaultConfig {
12+
applicationId = "io.deepone.app"
13+
minSdk = 24
14+
targetSdk = 36
15+
versionCode = 1
16+
versionName = "1.0"
17+
18+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19+
}
20+
21+
buildTypes {
22+
release {
23+
isMinifyEnabled = false
24+
proguardFiles(
25+
getDefaultProguardFile("proguard-android-optimize.txt"),
26+
"proguard-rules.pro"
27+
)
28+
}
29+
}
30+
compileOptions {
31+
sourceCompatibility = JavaVersion.VERSION_11
32+
targetCompatibility = JavaVersion.VERSION_11
33+
}
34+
kotlinOptions {
35+
jvmTarget = "11"
36+
}
37+
buildFeatures {
38+
compose = true
39+
}
40+
}
41+
42+
dependencies {
43+
implementation("io.deepone.sdk:deeponenesdk:1.0.10")
44+
45+
implementation(libs.androidx.core.ktx)
46+
implementation(libs.androidx.lifecycle.runtime.ktx)
47+
implementation(libs.androidx.activity.compose)
48+
implementation(platform(libs.androidx.compose.bom))
49+
implementation(libs.androidx.compose.ui)
50+
implementation(libs.androidx.compose.ui.graphics)
51+
implementation(libs.androidx.compose.ui.tooling.preview)
52+
implementation(libs.androidx.compose.material3)
53+
testImplementation(libs.junit)
54+
androidTestImplementation(libs.androidx.junit)
55+
androidTestImplementation(libs.androidx.espresso.core)
56+
androidTestImplementation(platform(libs.androidx.compose.bom))
57+
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
58+
debugImplementation(libs.androidx.compose.ui.tooling)
59+
debugImplementation(libs.androidx.compose.ui.test.manifest)
60+
}

Example/app/proguard-rules.pro

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.
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
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.Example">
14+
15+
<meta-data
16+
android:name="DeepOne.test_key"
17+
android:value="test_key_here" />
18+
<meta-data
19+
android:name="DeepOne.live_key"
20+
android:value="live_key_here" />
21+
22+
<activity
23+
android:name=".MainActivity"
24+
android:exported="true"
25+
android:label="@string/app_name"
26+
android:theme="@style/Theme.Example">
27+
<intent-filter>
28+
<action android:name="android.intent.action.MAIN" />
29+
<category android:name="android.intent.category.LAUNCHER" />
30+
</intent-filter>
31+
32+
<intent-filter android:autoVerify="true">
33+
<action android:name="android.intent.action.VIEW" />
34+
<category android:name="android.intent.category.DEFAULT" />
35+
<category android:name="android.intent.category.BROWSABLE" />
36+
<data
37+
android:scheme="https"
38+
android:host="{your_app}.deepone.io" />
39+
</intent-filter>
40+
41+
<intent-filter>
42+
<action android:name="android.intent.action.VIEW" />
43+
<category android:name="android.intent.category.DEFAULT" />
44+
<category android:name="android.intent.category.BROWSABLE" />
45+
46+
<data android:scheme="examplescheme" />
47+
</intent-filter>
48+
</activity>
49+
</application>
50+
51+
</manifest>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
package io.deepone.app
2+
3+
import android.os.Bundle
4+
import android.widget.Toast
5+
import androidx.activity.ComponentActivity
6+
import androidx.activity.compose.setContent
7+
import androidx.activity.enableEdgeToEdge
8+
import androidx.compose.foundation.layout.fillMaxSize
9+
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.material3.Scaffold
11+
import androidx.compose.material3.Text
12+
import androidx.compose.runtime.Composable
13+
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.tooling.preview.Preview
15+
import io.deepone.app.ui.theme.ExampleTheme
16+
import io.deepone.sdk.DeepOne
17+
import io.deepone.sdk.DeepOneCreateLinkBuilder
18+
19+
class MainActivity : ComponentActivity() {
20+
override fun onCreate(savedInstanceState: Bundle?) {
21+
super.onCreate(savedInstanceState)
22+
setupDeepOne()
23+
enableEdgeToEdge()
24+
setContent {
25+
ExampleTheme {
26+
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
27+
Greeting(
28+
name = "Android",
29+
modifier = Modifier.padding(innerPadding)
30+
)
31+
}
32+
}
33+
}
34+
}
35+
36+
fun setupDeepOne() {
37+
// Initialize DeepOne SDK with attribution handler
38+
DeepOne.shared.configure(
39+
context = this, // Use Activity context for UI operations
40+
developmentMode = true // Set to false in production
41+
) { attributionData, error ->
42+
if (error != null) {
43+
updateStatus("Attribution failed: ${error.message}")
44+
} else if (attributionData != null) {
45+
updateStatus("Attribution received!")
46+
updateStatus("Origin URL: ${attributionData.originURL ?: "N/A"}")
47+
updateStatus("Route host: ${attributionData.routeHost ?: "N/A"}")
48+
updateStatus("Route Path: ${attributionData.routePath ?: "N/A"}")
49+
updateStatus("Query Params: ${attributionData.queryParameters}")
50+
updateStatus("Is First Session: ${attributionData.isFirstSession}")
51+
if (attributionData.marketingSource != null) {
52+
updateStatus("Marketing: ${attributionData.marketingSource}/${attributionData.marketingMedium}")
53+
}
54+
// Handle attribution data here
55+
} else {
56+
updateStatus("No attribution data")
57+
}
58+
}
59+
}
60+
61+
private fun testCreateLinkFunction() {
62+
updateStatus("Testing createLink function...")
63+
64+
// Create link configuration using builder pattern
65+
val linkBuilder = DeepOneCreateLinkBuilder(
66+
destinationPath = "/product/123",
67+
linkIdentifier = "example_link"
68+
).setMarketingAttribution(
69+
source = "android_app",
70+
medium = "mobile",
71+
campaign = "example_campaign",
72+
content = "test_link"
73+
).setSocialPreview(
74+
title = "Check out this product!",
75+
description = "Amazing product you'll love"
76+
)
77+
78+
DeepOne.shared.createAttributedLink(linkBuilder) { url, error ->
79+
runOnUiThread {
80+
if (error != null) {
81+
updateStatus("Link creation failed: ${error.message}")
82+
Toast.makeText(this, "Link creation failed", Toast.LENGTH_SHORT).show()
83+
} else if (url != null) {
84+
updateStatus("Link created successfully: $url")
85+
Toast.makeText(this, "Link created!", Toast.LENGTH_SHORT).show()
86+
} else {
87+
updateStatus("Link creation returned null")
88+
}
89+
}
90+
}
91+
}
92+
93+
private fun updateStatus(message: String) {
94+
// log to console for debugging
95+
println("MainActivity: $message")
96+
}
97+
}
98+
99+
@Composable
100+
fun Greeting(name: String, modifier: Modifier = Modifier) {
101+
Text(
102+
text = "Hello $name!",
103+
modifier = modifier
104+
)
105+
}
106+
107+
@Preview(showBackground = true)
108+
@Composable
109+
fun GreetingPreview() {
110+
ExampleTheme {
111+
Greeting("Android")
112+
}
113+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package io.deepone.app.ui.theme
2+
3+
import androidx.compose.ui.graphics.Color
4+
5+
val Purple80 = Color(0xFFD0BCFF)
6+
val PurpleGrey80 = Color(0xFFCCC2DC)
7+
val Pink80 = Color(0xFFEFB8C8)
8+
9+
val Purple40 = Color(0xFF6650a4)
10+
val PurpleGrey40 = Color(0xFF625b71)
11+
val Pink40 = Color(0xFF7D5260)

0 commit comments

Comments
 (0)