Skip to content

Commit

Permalink
Merge pull request #3 from ProtonProtocol/develop
Browse files Browse the repository at this point in the history
jcenter integration
  • Loading branch information
Joey Harward authored Jul 17, 2020
2 parents f8bed32 + 50b5515 commit 09a5fc3
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 20 additions & 0 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
13 changes: 13 additions & 0 deletions docs/src/orchid/resources/config.yml
Original file line number Diff line number Diff line change
@@ -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'
5 changes: 5 additions & 0 deletions docs/src/orchid/resources/homepage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
components:
- type: 'pageContent'
- type: 'readme'
---
Empty file modified gradlew
100644 → 100755
Empty file.
136 changes: 129 additions & 7 deletions protonsdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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 = "[email protected]"
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') {
Expand All @@ -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'
// }
}
}
}
}
}
5 changes: 4 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include ':protonsdk'
rootProject.name = 'Proton Kotlin SDK'

include ':protonsdk'
include ':docs'

0 comments on commit 09a5fc3

Please sign in to comment.