Skip to content

Commit 1cb12e1

Browse files
author
alexey_zalevskyi_cr
committed
Initial commit.
1 parent eda167c commit 1cb12e1

6 files changed

+146
-3
lines changed

bintrayv1.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
2+
3+
apply plugin: 'com.jfrog.bintray'
4+
5+
version = libraryVersion
6+
7+
if (project.hasProperty("android")) { // Android libraries
8+
task sourcesJar(type: Jar) {
9+
classifier = 'sources'
10+
from android.sourceSets.main.java.srcDirs
11+
}
12+
13+
task javadoc(type: Javadoc) {
14+
source = android.sourceSets.main.java.srcDirs
15+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
16+
}
17+
} else { // Java libraries
18+
task sourcesJar(type: Jar, dependsOn: classes) {
19+
classifier = 'sources'
20+
from sourceSets.main.allSource
21+
}
22+
}
23+
24+
task javadocJar(type: Jar, dependsOn: javadoc) {
25+
classifier = 'javadoc'
26+
from javadoc.destinationDir
27+
}
28+
29+
artifacts {
30+
// archives javadocJar
31+
archives sourcesJar
32+
}
33+
34+
// Bintray
35+
Properties properties = new Properties()
36+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
37+
38+
bintray {
39+
user = properties.getProperty("bintray.user")
40+
key = properties.getProperty("bintray.apikey")
41+
42+
configurations = ['archives']
43+
pkg {
44+
repo = bintrayRepo
45+
name = bintrayName
46+
desc = libraryDescription
47+
websiteUrl = siteUrl
48+
vcsUrl = gitUrl
49+
licenses = allLicenses
50+
publish = true
51+
publicDownloadNumbers = true
52+
version {
53+
desc = libraryDescription
54+
gpg {
55+
sign = true //Determines whether to GPG sign the files. The default is false
56+
passphrase = properties.getProperty("bintray.gpg.password")
57+
//Optional. The passphrase for GPG signing'
58+
}
59+
}
60+
}
61+
}

blur_tutorial/build.gradle

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ apply plugin: 'kotlin-android-extensions'
66

77
apply plugin: 'kotlin-kapt'
88

9+
apply from: 'lib_jcenter.settings.gradle'
10+
911
android {
1012
compileSdkVersion 29
1113

1214
defaultConfig {
1315
minSdkVersion 21
1416
targetSdkVersion 29
15-
versionCode 1
16-
versionName "1.0"
17+
versionCode libraryVersionCode
18+
versionName libraryVersion
1719

1820
consumerProguardFiles 'proguard-rules.pro'
1921
}
@@ -37,4 +39,11 @@ dependencies {
3739
implementation supportDependencies.constraintlayout
3840
implementation supportDependencies.design
3941
implementation supportDependencies.kotlin
40-
}
42+
}
43+
44+
//Add these lines to publish library to bintray
45+
//Place it at the end of the file
46+
apply from: '../installv1.gradle'
47+
//https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle
48+
apply from: '../bintrayv1.gradle'
49+
// https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apply from: '../main_jcenter.settings.gradle'
2+
3+
ext {
4+
bintrayRepo = 'blur-tutorial'
5+
bintrayName = 'blur-tutorial'
6+
7+
publishedGroupId = 'com.cleveroad.blur_tutorial'
8+
libraryName = 'blur-tutorial'
9+
artifact = 'blur-tutorial'
10+
11+
libraryDescription = 'Blur tutorial'
12+
}

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ buildscript {
1616
classpath "com.android.tools.build:gradle:$build_gradle_version"
1717
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1818
classpath "gradle.plugin.io.gitlab.arturbosch:detekt-gradle-plugin:$detekt_version"
19+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
20+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1921
}
2022
}
2123

installv1.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle
2+
3+
apply plugin: 'com.github.dcendents.android-maven'
4+
5+
group = publishedGroupId // Maven Group ID for the artifact
6+
7+
install {
8+
repositories.mavenInstaller {
9+
// This generates POM.xml with proper parameters
10+
pom {
11+
project {
12+
packaging 'aar'
13+
groupId publishedGroupId
14+
artifactId artifact
15+
16+
// Add your description here
17+
name libraryName
18+
description libraryDescription
19+
url siteUrl
20+
21+
// Set your license
22+
licenses {
23+
license {
24+
name licenseName
25+
url licenseUrl
26+
}
27+
}
28+
developers {
29+
developer {
30+
id developerId
31+
name developerName
32+
email developerEmail
33+
}
34+
}
35+
scm {
36+
connection gitUrl
37+
developerConnection gitUrl
38+
url siteUrl
39+
40+
}
41+
}
42+
}
43+
}
44+
}

main_jcenter.settings.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ext {
2+
libraryVersionCode = 1
3+
libraryVersion = '1.0.0'
4+
5+
developerId = 'cleveroad'
6+
developerName = 'Eugene Altynpara'
7+
developerEmail = '[email protected]'
8+
9+
siteUrl = 'https://github.com/Cleveroad/BlurTutorial'
10+
gitUrl = 'https://github.com/Cleveroad/BlurTutorial.git'
11+
12+
licenseName = 'The Apache Software License, Version 2.0'
13+
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
14+
allLicenses = ["Apache-2.0"]
15+
}

0 commit comments

Comments
 (0)