Skip to content

Commit

Permalink
Update publishing config
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Jan 24, 2025
1 parent a993815 commit 5193b4d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 20 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ The following command builds both the Lantern core library and the Android SDK:
make build-sdk
```

This will produce the SDK as an .aar file located at [./build/lanternsdk-android.aar](build/lanternsdk-android.aar).
This will produce the SDK as an .aar file located at ./build/lanternsdk-android.aar.

The .aar file contains the compiled Go library and Kotlin bindings, ready for integration into your Android app.

### Integrating the Lantern SDK

1. Add the SDK to Your Project
1. Add the SDK Dependency

Copy the lanternsdk-android.aar file to your app’s libs/ directory and update your app’s build.gradle:
You can easily add the Lantern SDK to your Android project by including it as a dependency in your build configuration.

In your project-level build.gradle or settings.gradle file, add the JitPack repository:

```groovy
repositories {
flatDir {
dirs 'libs'
}
maven { url 'https://jitpack.io' }
}
```

In your app-level build.gradle file, include the dependency:

```groovy
dependencies {
implementation(name: 'lanternsdk-android', ext: 'aar')
implementation 'org.getlantern:lanternsdk-android:1.0.1'
}
```

Expand Down
3 changes: 0 additions & 3 deletions build/lanternsdk-android.aar

This file was deleted.

11 changes: 10 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

group = 'org.getlantern'
version = '1.0.1'

android {
namespace 'org.getlantern.lantern.sdk.example'
ndkVersion "27.0.12077973"
Expand Down Expand Up @@ -50,12 +53,18 @@ repositories {
flatDir {
dirs 'libs/'
}

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}


dependencies {
implementation 'com.github.getlantern:lanternsdk-android:v1.0.1'

implementation(name: 'lanternsdk-android', ext: 'aar')
//implementation(name: 'lanternsdk-android', ext: 'aar')
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
implementation fileTree(dir: "libs", include: ["*.jar"])

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ kotlin.code.style=official

android.nonTransitiveRClass=true

ossrhUsername=OWJfTfFh
ossrhPassword=WzS1/D1AeRCXnDIezfvvYiz9t+PSOiRnHwcIS+MYyNDW
systemProp.org.gradle.internal.http.connectionTimeout=60000
systemProp.org.gradle.internal.http.socketTimeout=60000
33 changes: 26 additions & 7 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,37 @@ publishing {
version = '1.0.1'

artifact("$buildDir/outputs/aar/sdk-release.aar")

// Add POM metadata required by Maven Central
pom {
name.set("Lantern Android SDK")
description.set("Lantern SDK for Android")
url.set("https://github.com/getlantern/lanternsdk-android")

licenses {
license {
name.set("Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("getlantern")
name.set("Lantern Team")
email.set("team@getlantern.org")
}
}
scm {
connection.set("scm:git:git://github.com/getlantern/lanternsdk-android.git")
developerConnection.set("scm:git:ssh://git@github.com:getlantern/lanternsdk-android.git")
url.set("https://github.com/getlantern/lanternsdk-android")
}
}
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/getlantern/lanternsdk-android")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
url = "https://jitpack.io"
}
}
}
Expand Down

0 comments on commit 5193b4d

Please sign in to comment.