diff --git a/README.md b/README.md index 33d003a9..0cbaacc4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Then add the following dependency to your module's build.gradle ```gradle dependencies { ... - implementation "com.metallicus:protonsdk:0.5.0" + implementation "com.metallicus:protonsdk:0.5.1" } ``` diff --git a/build.gradle b/build.gradle index b94a5d12..911c570e 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' diff --git a/docs/build.gradle b/docs/build.gradle new file mode 100644 index 00000000..59a9ec5a --- /dev/null +++ b/docs/build.gradle @@ -0,0 +1,20 @@ +plugins { + id "com.eden.orchidPlugin" version "0.21.0" +} + +dependencies { + orchidRuntimeOnly "io.github.javaeden.orchid:OrchidDocs:0.21.0" + orchidRuntimeOnly "io.github.javaeden.orchid:OrchidKotlindoc:0.21.0" + orchidRuntimeOnly "io.github.javaeden.orchid:OrchidPluginDocs:0.21.0" +} + +repositories { + jcenter() + maven { url = "https://kotlin.bintray.com/kotlinx/" } +} + +orchid { + theme = "Editorial" + baseUrl = "https://username.github.io/project" + version = "1.0.0" +} \ No newline at end of file diff --git a/docs/src/orchid/resources/config.yml b/docs/src/orchid/resources/config.yml new file mode 100644 index 00000000..c8b98d70 --- /dev/null +++ b/docs/src/orchid/resources/config.yml @@ -0,0 +1,13 @@ +site: + about: + siteName: Proton Kotlin SDK + siteDescription: Kotlin library for handling Proton Chain operations. +Editorial: + primaryColor: '#582ACB' + social: + github: 'username/project' + metaComponents: # this is the replacement for the deprecated automatic search addition + - type: 'orchidSearch' +kotlindoc: + sourceDirs: + - './../../../../protonsdk/src/main/java' \ No newline at end of file diff --git a/docs/src/orchid/resources/homepage.md b/docs/src/orchid/resources/homepage.md new file mode 100644 index 00000000..496dc1d5 --- /dev/null +++ b/docs/src/orchid/resources/homepage.md @@ -0,0 +1,5 @@ +--- +components: + - type: 'pageContent' + - type: 'readme' +--- \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/protonsdk/build.gradle b/protonsdk/build.gradle index 4902feb8..4d1898f0 100644 --- a/protonsdk/build.gradle +++ b/protonsdk/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 30 - buildToolsVersion "30.0.0" + buildToolsVersion "30.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -23,8 +23,8 @@ android { minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "0.4.6" + versionCode 13 + versionName "0.5.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -61,7 +61,7 @@ dependencies { implementation "androidx.work:work-runtime-ktx:2.3.4" // OkHttp - def okhttp3_version = '4.7.2' + def okhttp3_version = '4.8.0' implementation "com.squareup.okhttp3:okhttp:$okhttp3_version" implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" @@ -102,18 +102,103 @@ dependencies { //implementation "com.greymass:esrsdk:1.0.1" } +ext { + bintrayRepo = "ProtonKotlin" + bintrayName = "com.metallicus.protonsdk" + userOrganization = "protonprotocol" + + libraryName = "protonsdk" + + publishedGroupId = "com.metallicus" + artifact = "protonsdk" + libraryVersion = android.defaultConfig.versionName + + libraryDescription = "Kotlin library for handling Proton Chain operations" + siteUrl = "https://github.com/ProtonProtocol/ProtonKotlin" + gitUrl = "https://github.com/ProtonProtocol/ProtonKotlin.git" + developerId = "joey-harward" + developerName = "Metallicus Inc." + developerEmail = "joey@metalpay.co" + licenseName = "MIT License" + licenseUrl = "https://opensource.org/licenses/MIT" + allLicenses = ["MIT"] +} + +group = publishedGroupId +version = libraryVersion + +task sourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs +} + +def pomConfig = { + licenses { + license { + name licenseName + url licenseUrl + } + } + developers { + developer { + id developerId + name developerName + email developerEmail + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } +} + project.afterEvaluate { publishing { publications { - aar(MavenPublication) { + ProtonSDKDebug(MavenPublication) { groupId = 'com.metallicus' - artifactId 'protonsdk' + artifactId = "${project.getName()}-debug" version = android.defaultConfig.versionName artifact bundleDebugAar pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') + def root = asNode() + root.appendNode('name', libraryName) + root.appendNode('description', libraryDescription) + root.appendNode('url', siteUrl) + root.children().last() + pomConfig + + def dependenciesNode = root.appendNode('dependencies') + configurations.implementation.allDependencies.each { + if (it.group != null && it.name != null && it.version != null && + it.name != 'unspecified' && it.version != 'unspecified') { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + } + } + } + + ProtonSDKRelease(MavenPublication) { + groupId = 'com.metallicus' + artifactId project.getName() + version = android.defaultConfig.versionName + + artifact bundleReleaseAar + artifact sourcesJar + + pom.withXml { + def root = asNode() + root.appendNode('name', libraryName) + root.appendNode('description', libraryDescription) + root.appendNode('url', siteUrl) + root.children().last() + pomConfig + + def dependenciesNode = root.appendNode('dependencies') configurations.implementation.allDependencies.each { if (it.group != null && it.name != null && it.version != null && it.name != 'unspecified' && it.version != 'unspecified') { @@ -128,3 +213,40 @@ project.afterEvaluate { } } } + +project.afterEvaluate { + bintray { + if (project.rootProject.file('local.properties').exists()) { + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + + publications = ['ProtonSDKRelease'] + + pkg { + repo = bintrayRepo + name = bintrayName + userOrg = userOrganization + desc = libraryDescription + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = allLicenses + publish = true + publicDownloadNumbers = true + version { + name = libraryVersion + desc = libraryDescription + released = new Date() + +// gpg { +// sign = true //Determines whether to GPG sign the files. The default is false +// passphrase = properties.getProperty("bintray.gpg.password") +// //Optional. The passphrase for GPG signing' +// } + } + } + } + } +} diff --git a/settings.gradle b/settings.gradle index 536a4336..0b0125c4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,4 @@ -include ':protonsdk' \ No newline at end of file +rootProject.name = 'Proton Kotlin SDK' + +include ':protonsdk' +include ':docs' \ No newline at end of file