Skip to content

Commit 50b5515

Browse files
author
Joey Harward
committed
added publishing and uploading for bintray
using orchid for docs updated gradle plugin, build tools, okhttp3 update version
1 parent 40b738f commit 50b5515

File tree

8 files changed

+173
-10
lines changed

8 files changed

+173
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Then add the following dependency to your module's build.gradle
2424
```gradle
2525
dependencies {
2626
...
27-
implementation "com.metallicus:protonsdk:0.5.0"
27+
implementation "com.metallicus:protonsdk:0.5.1"
2828
}
2929
```
3030

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.0.0'
11+
classpath 'com.android.tools.build:gradle:4.0.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
1414
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'

docs/build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
plugins {
2+
id "com.eden.orchidPlugin" version "0.21.0"
3+
}
4+
5+
dependencies {
6+
orchidRuntimeOnly "io.github.javaeden.orchid:OrchidDocs:0.21.0"
7+
orchidRuntimeOnly "io.github.javaeden.orchid:OrchidKotlindoc:0.21.0"
8+
orchidRuntimeOnly "io.github.javaeden.orchid:OrchidPluginDocs:0.21.0"
9+
}
10+
11+
repositories {
12+
jcenter()
13+
maven { url = "https://kotlin.bintray.com/kotlinx/" }
14+
}
15+
16+
orchid {
17+
theme = "Editorial"
18+
baseUrl = "https://username.github.io/project"
19+
version = "1.0.0"
20+
}

docs/src/orchid/resources/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
site:
2+
about:
3+
siteName: Proton Kotlin SDK
4+
siteDescription: Kotlin library for handling Proton Chain operations.
5+
Editorial:
6+
primaryColor: '#582ACB'
7+
social:
8+
github: 'username/project'
9+
metaComponents: # this is the replacement for the deprecated automatic search addition
10+
- type: 'orchidSearch'
11+
kotlindoc:
12+
sourceDirs:
13+
- './../../../../protonsdk/src/main/java'

docs/src/orchid/resources/homepage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
components:
3+
- type: 'pageContent'
4+
- type: 'readme'
5+
---

gradlew

100644100755
File mode changed.

protonsdk/build.gradle

Lines changed: 129 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven'
88

99
android {
1010
compileSdkVersion 30
11-
buildToolsVersion "30.0.0"
11+
buildToolsVersion "30.0.1"
1212

1313
compileOptions {
1414
sourceCompatibility JavaVersion.VERSION_1_8
@@ -23,8 +23,8 @@ android {
2323
minSdkVersion 21
2424
targetSdkVersion 30
2525

26-
versionCode 11
27-
versionName "0.4.6"
26+
versionCode 13
27+
versionName "0.5.1"
2828

2929
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3030
consumerProguardFiles 'consumer-rules.pro'
@@ -61,7 +61,7 @@ dependencies {
6161
implementation "androidx.work:work-runtime-ktx:2.3.4"
6262

6363
// OkHttp
64-
def okhttp3_version = '4.7.2'
64+
def okhttp3_version = '4.8.0'
6565
implementation "com.squareup.okhttp3:okhttp:$okhttp3_version"
6666
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version"
6767

@@ -102,18 +102,103 @@ dependencies {
102102
//implementation "com.greymass:esrsdk:1.0.1"
103103
}
104104

105+
ext {
106+
bintrayRepo = "ProtonKotlin"
107+
bintrayName = "com.metallicus.protonsdk"
108+
userOrganization = "protonprotocol"
109+
110+
libraryName = "protonsdk"
111+
112+
publishedGroupId = "com.metallicus"
113+
artifact = "protonsdk"
114+
libraryVersion = android.defaultConfig.versionName
115+
116+
libraryDescription = "Kotlin library for handling Proton Chain operations"
117+
siteUrl = "https://github.com/ProtonProtocol/ProtonKotlin"
118+
gitUrl = "https://github.com/ProtonProtocol/ProtonKotlin.git"
119+
developerId = "joey-harward"
120+
developerName = "Metallicus Inc."
121+
developerEmail = "[email protected]"
122+
licenseName = "MIT License"
123+
licenseUrl = "https://opensource.org/licenses/MIT"
124+
allLicenses = ["MIT"]
125+
}
126+
127+
group = publishedGroupId
128+
version = libraryVersion
129+
130+
task sourcesJar(type: Jar) {
131+
archiveClassifier.set('sources')
132+
from android.sourceSets.main.java.srcDirs
133+
}
134+
135+
def pomConfig = {
136+
licenses {
137+
license {
138+
name licenseName
139+
url licenseUrl
140+
}
141+
}
142+
developers {
143+
developer {
144+
id developerId
145+
name developerName
146+
email developerEmail
147+
}
148+
}
149+
scm {
150+
connection gitUrl
151+
developerConnection gitUrl
152+
url siteUrl
153+
}
154+
}
155+
105156
project.afterEvaluate {
106157
publishing {
107158
publications {
108-
aar(MavenPublication) {
159+
ProtonSDKDebug(MavenPublication) {
109160
groupId = 'com.metallicus'
110-
artifactId 'protonsdk'
161+
artifactId = "${project.getName()}-debug"
111162
version = android.defaultConfig.versionName
112163

113164
artifact bundleDebugAar
114165

115166
pom.withXml {
116-
def dependenciesNode = asNode().appendNode('dependencies')
167+
def root = asNode()
168+
root.appendNode('name', libraryName)
169+
root.appendNode('description', libraryDescription)
170+
root.appendNode('url', siteUrl)
171+
root.children().last() + pomConfig
172+
173+
def dependenciesNode = root.appendNode('dependencies')
174+
configurations.implementation.allDependencies.each {
175+
if (it.group != null && it.name != null && it.version != null &&
176+
it.name != 'unspecified' && it.version != 'unspecified') {
177+
def dependencyNode = dependenciesNode.appendNode('dependency')
178+
dependencyNode.appendNode('groupId', it.group)
179+
dependencyNode.appendNode('artifactId', it.name)
180+
dependencyNode.appendNode('version', it.version)
181+
}
182+
}
183+
}
184+
}
185+
186+
ProtonSDKRelease(MavenPublication) {
187+
groupId = 'com.metallicus'
188+
artifactId project.getName()
189+
version = android.defaultConfig.versionName
190+
191+
artifact bundleReleaseAar
192+
artifact sourcesJar
193+
194+
pom.withXml {
195+
def root = asNode()
196+
root.appendNode('name', libraryName)
197+
root.appendNode('description', libraryDescription)
198+
root.appendNode('url', siteUrl)
199+
root.children().last() + pomConfig
200+
201+
def dependenciesNode = root.appendNode('dependencies')
117202
configurations.implementation.allDependencies.each {
118203
if (it.group != null && it.name != null && it.version != null &&
119204
it.name != 'unspecified' && it.version != 'unspecified') {
@@ -128,3 +213,40 @@ project.afterEvaluate {
128213
}
129214
}
130215
}
216+
217+
project.afterEvaluate {
218+
bintray {
219+
if (project.rootProject.file('local.properties').exists()) {
220+
Properties properties = new Properties()
221+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
222+
223+
user = properties.getProperty("bintray.user")
224+
key = properties.getProperty("bintray.apikey")
225+
226+
publications = ['ProtonSDKRelease']
227+
228+
pkg {
229+
repo = bintrayRepo
230+
name = bintrayName
231+
userOrg = userOrganization
232+
desc = libraryDescription
233+
websiteUrl = siteUrl
234+
vcsUrl = gitUrl
235+
licenses = allLicenses
236+
publish = true
237+
publicDownloadNumbers = true
238+
version {
239+
name = libraryVersion
240+
desc = libraryDescription
241+
released = new Date()
242+
243+
// gpg {
244+
// sign = true //Determines whether to GPG sign the files. The default is false
245+
// passphrase = properties.getProperty("bintray.gpg.password")
246+
// //Optional. The passphrase for GPG signing'
247+
// }
248+
}
249+
}
250+
}
251+
}
252+
}

settings.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
include ':protonsdk'
1+
rootProject.name = 'Proton Kotlin SDK'
2+
3+
include ':protonsdk'
4+
include ':docs'

0 commit comments

Comments
 (0)