diff --git a/README.md b/README.md index 37677aa..cd5a638 100644 --- a/README.md +++ b/README.md @@ -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' } ``` diff --git a/build/lanternsdk-android.aar b/build/lanternsdk-android.aar deleted file mode 100644 index b6f3117..0000000 --- a/build/lanternsdk-android.aar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a305960337c4f3aedd1ce09f40e7c35bea0cfee685b08633ed72203799f18e8 -size 58364205 diff --git a/example/build.gradle b/example/build.gradle index 592005f..8a271cb 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -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" @@ -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"]) diff --git a/gradle.properties b/gradle.properties index 73e3648..76d1c39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,5 +22,5 @@ kotlin.code.style=official android.nonTransitiveRClass=true -ossrhUsername=OWJfTfFh -ossrhPassword=WzS1/D1AeRCXnDIezfvvYiz9t+PSOiRnHwcIS+MYyNDW \ No newline at end of file +systemProp.org.gradle.internal.http.connectionTimeout=60000 +systemProp.org.gradle.internal.http.socketTimeout=60000 \ No newline at end of file diff --git a/sdk/build.gradle b/sdk/build.gradle index 1c8edd5..c0b7f65 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -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" } } }