Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.

Commit 68b1a9b

Browse files
committed
initial bintray setup
1 parent 6b197df commit 68b1a9b

8 files changed

+167
-8
lines changed

app/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ android {
77
buildToolsVersion "29.0.2"
88

99
defaultConfig {
10-
applicationId "com.inplayer.zapp.sample"
10+
applicationId "com.inplayer.zapp"
1111
minSdkVersion 24
1212
targetSdkVersion 29
1313
versionCode 1
@@ -37,3 +37,5 @@ dependencies {
3737
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
3838
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3939
}
40+
41+
apply from: 'gradle-bintray-push.gradle'

app/gradle-bintray-push.gradle

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'com.jfrog.bintray'
3+
4+
/*
5+
* Gets the version name from the latest Git tag
6+
*/
7+
def getVersionName = { ->
8+
try {
9+
def stdout = new ByteArrayOutputStream()
10+
exec {
11+
commandLine 'git', 'describe', '--abbrev=0', '--tags'
12+
standardOutput = stdout
13+
}
14+
return stdout.toString().trim()
15+
} catch (ignored) {
16+
return null
17+
}
18+
}
19+
20+
publishing {
21+
publications {
22+
mavenJava(MavenPublication) {
23+
groupId GROUP
24+
25+
def versionFromTag = getVersionName()
26+
if (versionFromTag != null) {
27+
// There is a tag existing on the current commit - we can upload to Bintray
28+
version versionFromTag
29+
30+
artifactId ARTIFACT_ID
31+
artifact "build/outputs/aar/" + project.name + "-release.aar"
32+
artifact androidJavadocsJar
33+
artifact androidSourcesJar
34+
pom.withXml {
35+
Node root = asNode()
36+
root.appendNode('name', ARTIFACT_ID)
37+
root.appendNode('description', POM_DESCRIPTION)
38+
root.appendNode('url', POM_URL)
39+
40+
def issues = root.appendNode('issueManagement')
41+
issues.appendNode('system', 'github')
42+
issues.appendNode('url', ISSUE_URL)
43+
44+
def scm = root.appendNode('scm')
45+
scm.appendNode('url', POM_SCM_URL)
46+
scm.appendNode('connection', POM_SCM_CONNECTION)
47+
scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION)
48+
49+
def license = root.appendNode('licenses').appendNode('license')
50+
license.appendNode('name', POM_LICENCE_NAME)
51+
license.appendNode('url', POM_LICENCE_URL)
52+
license.appendNode('distribution', POM_LICENCE_DIST)
53+
54+
def developer = root.appendNode('developers').appendNode('developer')
55+
developer.appendNode('id', POM_DEVELOPER_ID)
56+
developer.appendNode('name', POM_DEVELOPER_NAME)
57+
developer.appendNode('email', POM_DEVELOPER_EMAIL)
58+
59+
def dependenciesNode = asNode().appendNode('dependencies')
60+
configurations.compile.allDependencies.each {
61+
if (!it.name.is('unspecified')) {
62+
def dependencyNode = dependenciesNode.appendNode('dependency')
63+
dependencyNode.appendNode('groupId', it.group)
64+
dependencyNode.appendNode('artifactId', it.name)
65+
dependencyNode.appendNode('version', it.version)
66+
}
67+
}
68+
configurations.api.allDependencies.each {
69+
if (!it.name.is('unspecified')) {
70+
def dependencyNode = dependenciesNode.appendNode('dependency')
71+
dependencyNode.appendNode('groupId', it.group)
72+
dependencyNode.appendNode('artifactId', it.name)
73+
dependencyNode.appendNode('version', it.version)
74+
}
75+
}
76+
}
77+
}
78+
}
79+
}
80+
}
81+
82+
bintray {
83+
user ='sarevd'
84+
key = 'c257e694aab9d1d39431ccc70b37ebf149074c93'
85+
publications = ['mavenJava']
86+
87+
dryRun = false
88+
publish = GROUP
89+
pkg {
90+
repo = 'inplayer-org'
91+
name = ARTIFACT_ID
92+
userOrg = 'inplayer-org'
93+
websiteUrl = POM_URL
94+
issueTrackerUrl = ISSUE_URL
95+
vcsUrl = POM_SCM_URL
96+
licenses = ['Apache-2.0']
97+
labels = ['aar', 'android']
98+
version {
99+
name = getVersionName()
100+
vcsTag = 'v' + getVersionName()
101+
}
102+
}
103+
}
104+
105+
task androidJavadocs(type: Javadoc) {
106+
source = android.sourceSets.main.java.srcDirs
107+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
108+
failOnError false
109+
}
110+
111+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
112+
classifier = 'javadoc'
113+
from androidJavadocs.destinationDir
114+
}
115+
116+
task androidSourcesJar(type: Jar) {
117+
classifier = 'sources'
118+
from android.sourceSets.main.java.sourceFiles
119+
}
120+
121+
task androidJar(type: Jar) {
122+
from 'build/intermediates/classes/release'
123+
}
124+
125+
artifacts {
126+
archives androidSourcesJar
127+
archives androidJavadocsJar
128+
archives androidJar
129+
}

app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.inplayer.zapp.sample">
4+
package="com.inplayer.zapp">
55

66
<application
77
android:name=".InPlayerApplication"

app/src/main/java/com/inplayer/zapp/sample/InPlayerApplication.kt app/src/main/java/com/inplayer/zapp/InPlayerApplication.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.inplayer.zapp.sample
1+
package com.inplayer.zapp
22

33
import android.app.Application
44
import com.sdk.inplayer.configuration.InPlayer

app/src/main/java/com/inplayer/zapp/sample/MainActivity.kt app/src/main/java/com/inplayer/zapp/MainActivity.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package com.inplayer.zapp.sample
1+
package com.inplayer.zapp
22

33
import androidx.appcompat.app.AppCompatActivity
44
import android.os.Bundle
5+
import com.inplayer.zapp.sample.R
56

67
class MainActivity : AppCompatActivity() {
78

app/src/main/res/layout/activity_main.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
tools:context=".MainActivity">
7+
tools:context="com.inplayer.zapp.MainActivity">
88

99
<TextView
1010
android:layout_width="wrap_content"

build.gradle

+13-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ buildscript {
55
repositories {
66
google()
77
jcenter()
8-
98
}
109
dependencies {
1110
classpath 'com.android.tools.build:gradle:3.6.0-rc01'
1211
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath 'com.github.dcendents:android-maven-plugin:1.2'
13+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
1314

1415
// NOTE: Do not place your application dependencies here; they belong
1516
// in the individual module build.gradle files
@@ -18,11 +19,20 @@ buildscript {
1819

1920
allprojects {
2021
repositories {
22+
maven {
23+
credentials {
24+
username System.getenv("MAVEN_USERNAME")
25+
password System.getenv("MAVEN_PASSWORD")
26+
}
27+
url 'https://inplayer-org.bintray.com/inplayer-org'
28+
}
2129
google()
2230
jcenter()
23-
repositories {
24-
maven { url "https://jitpack.io" }
31+
mavenCentral()
32+
maven {
33+
url 'https://maven.google.com'
2534
}
35+
maven { url 'https://jitpack.io' }
2636
}
2737
}
2838

gradle.properties

+17
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,20 @@ android.useAndroidX=true
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
22+
23+
VERSION_NAME=0.0.2
24+
VERSION_CODE=2
25+
GROUP=com.inplayer.zapp
26+
ARTIFACT_ID=zapp-android-plugin
27+
POM_DESCRIPTION=A plugin which will handle the authentication flows (login, register and forgot password) for AmericaTV.
28+
POM_URL=https://github.com/inplayer-org/zapp-android-plugin.git
29+
POM_SCM_URL=https://github.com/inplayer-org/zapp-android-plugin.git
30+
POM_SCM_CONNECTION=https://github.com/inplayer-org/zapp-android-plugin.git
31+
POM_SCM_DEV_CONNECTION=scm:https://github.com/inplayer-org/zapp-android-plugin.git
32+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
33+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
34+
POM_LICENCE_DIST=repo
35+
POM_DEVELOPER_ID=sarevd
36+
POM_DEVELOPER_NAME=sarevd
37+
POM_DEVELOPER_EMAIL=sarevd@gmail.com
38+
ISSUE_URL=https://github.com/inplayer-org/zapp-android-plugin/issues

0 commit comments

Comments
 (0)