diff --git a/.gitignore b/.gitignore index 5bd175f..bc4dbd8 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ .cxx local.properties .idea +.vscode/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..78b7006 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Dfns + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e499ae5..6c2679b 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,12 @@ In the `./app/src/main/java/co/dfns/sdk/tutorial/mobile/Constants.kt` set the fo - `appId` = the `App ID` of the new `Application` - `url` = either `http://localhost:8000` or if using ngrok, the public url `https://panda-new-kit.ngrok-free.app` + + +# Publishing +Uses [tddworks/central-portal-publisher](https://github.com/tddworks/central-portal-publisher) and requires signing + env var export for maven central auth tokens +``` +## Provide Sonatype Portal credentials +SONATYPE_USERNAME=[your-sonatype-username] +SONATYPE_PASSWORD=[your-sonatype-password] +``` \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index e3f8a07..eed58c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,4 +3,76 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.jetbrains.kotlin.android) apply false alias(libs.plugins.android.library) apply false -} \ No newline at end of file + id("com.tddworks.central-portal-publisher") version "0.0.5" + `java-library` + `maven-publish` + signing +} + + + +java { + withJavadocJar() + withSourcesJar() +} + +tasks.javadoc { + if (JavaVersion.current().isJava9Compatible) { + (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) + } +} + +signing { + useGpgCmd() + sign(configurations.runtimeElements.get()) +} + + +publishing { + publications { + create("mavenJava") { + group = "co.dfns" + version = "0.1.0" + artifactId = "androidsdk" + from(components["java"]) + versionMapping { + usage("java-api") { + fromResolutionOf("runtimeClasspath") + } + usage("java-runtime") { + fromResolutionResult() + } + } + pom { + name = "Dfns Android SDK" + description = "Dfns Passkey Android SDK" + url = "https://github.com/dfns/dfns-sdk-kotlin" + licenses { + license { + name = "MIT License" + url = "https://github.com/dfns/dfns-sdk-kotlin/blob/m/LICENSE" + } + } + developers { + developer { + id = "dfns" + name = "Dfns" + email = "john.doe@example.com" + } + } + scm { + connection = "scm:git:git://github.com/dfns/dfns-sdk-kotlin.git" + developerConnection = "scm:git:ssh://github.com/dfns/dfns-sdk-kotlin.git" + url = "https://github.com/dfns/dfns-sdk-kotlin/" + } + } + } + } +} + +sonatypePortalPublisher { + settings { + autoPublish = false + aggregation = false + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a273261..7a923aa 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,6 +16,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + mavenLocal() } }