Skip to content

Commit a4c12dc

Browse files
committed
Added gradle script for publishing
1 parent 4f54060 commit a4c12dc

6 files changed

Lines changed: 98 additions & 79 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Android--Steam-Dota2-Loader
2-
Java library and Android Sample App for downloading Dota2 Data from Steam
2+
Java library for downloading Dota2 Data from Steam

build.gradle

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ext.minSdkVersion = 15
66
ext.compileSdkVersion = 25
77
ext.targetSdkVersion = 25
88
// Lib Versions
9-
ext.butterKnifeVersion = "8.5.1"
10-
ext.appCompatLibVersion = "25.2.0"
119
ext.retrofit2Version = "2.2.0"
1210
ext.retrofitGsonVersion = "2.2.0"
1311
ext.okhttp3Version = "3.6.0"
@@ -17,12 +15,11 @@ ext.gsonVersion = "2.4"
1715
buildscript {
1816
repositories {
1917
jcenter()
18+
mavenCentral()
2019
}
2120
dependencies {
2221
classpath 'com.android.tools.build:gradle:2.3.1'
23-
24-
// NOTE: Do not place your application dependencies here; they belong
25-
// in the individual module build.gradle files
22+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
2623
}
2724
}
2825

@@ -35,3 +32,17 @@ allprojects {
3532
task clean(type: Delete) {
3633
delete rootProject.buildDir
3734
}
35+
36+
def quoteString(final String str) {
37+
final String quote = "\"";
38+
39+
if (str.length() > 0) {
40+
if (str.startsWith(quote) && str.endsWith(quote)) {
41+
return str;
42+
} else {
43+
return quote + str + quote;
44+
}
45+
} else {
46+
return quote + quote;
47+
}
48+
}

net/build.gradle

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
apply plugin: 'java'
2+
apply plugin: 'maven-publish'
3+
apply plugin: 'com.jfrog.bintray'
24

35
sourceCompatibility = "1.7"
46
targetCompatibility = "1.7"
57

8+
final int versionMajor = 1
9+
final int versionMinor = 0
10+
final int versionPatch = 0
11+
12+
final String gitHubRepo = 'MikeFot/Android--Steam-Loader'
13+
final String artifactName = 'java-steam-loader'
14+
final String artifactDesc = 'Java library for fetching data from Steam'
15+
final String[] tags = ['steam', 'java', 'android']
16+
17+
final String artifactGroupId = 'com.michaelfotiadis'
18+
final String semanticVersion = "${versionMajor}.${versionMinor}.${versionPatch}"
19+
final String gitHubUrl = "https://github.com/${gitHubRepo}"
20+
621
dependencies {
722
compile "com.squareup.retrofit2:retrofit:${retrofit2Version}"
823
compile "com.squareup.retrofit2:converter-gson:${retrofitGsonVersion}"
@@ -12,3 +27,69 @@ dependencies {
1227
compile project(':steam')
1328
}
1429

30+
publishing {
31+
publications {
32+
mavenJava(MavenPublication) {
33+
if (plugins.hasPlugin('war')) {
34+
from components.web
35+
} else {
36+
from components.java
37+
}
38+
39+
groupId artifactGroupId
40+
artifactId artifactName
41+
version semanticVersion
42+
43+
artifact sourcesJar
44+
artifact javadocJar
45+
}
46+
}
47+
}
48+
49+
bintray {
50+
user = project.hasProperty('mfJCenterUser') ? mfJCenterUser : "<NO USER NAME>"
51+
key = project.hasProperty('mfJCenterToken') ? mfJCenterToken : "<NO TOKEN>"
52+
53+
dryRun = false
54+
publish = false
55+
publications = ['mavenJava']
56+
pkg {
57+
repo = 'maven'
58+
// userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
59+
name = artifactName
60+
desc = artifactDesc
61+
websiteUrl = "${gitHubUrl}"
62+
issueTrackerUrl = "${gitHubUrl}/issues"
63+
vcsUrl = "${gitHubUrl}.git"
64+
labels = tags
65+
licenses = ['Apache-2.0']
66+
publicDownloadNumbers = true
67+
githubRepo = "${gitHubRepo}"
68+
githubReleaseNotesFile = 'README.md'
69+
70+
version {
71+
name = semanticVersion
72+
//desc = 'optional, version-specific description'
73+
mavenCentralSync {
74+
sync = false
75+
// Optional (true by default). Determines whether to sync the version to Maven Central.
76+
user = 'userToken' //OSS user token
77+
password = 'paasword' //OSS user password
78+
close = '1'
79+
// Optional property. By default the staging repository is closed and artifacts are released to Maven Central.
80+
// You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
81+
}
82+
}
83+
}
84+
85+
task sourcesJar(type: Jar, dependsOn: classes) {
86+
classifier = 'sources'
87+
from sourceSets.main.allSource
88+
}
89+
90+
task javadocJar(type: Jar, dependsOn: javadoc) {
91+
classifier = 'javadoc'
92+
from javadoc.destinationDir
93+
}
94+
}
95+

sample/src/androidTest/java/com/michaelfotiadis/steam/dota2/loader/sample/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

sample/src/main/java/com/michaelfotiadis/steam/dota2/loader/sample/fragment/steam/SteamFragment.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

sample/src/test/java/com/michaelfotiadis/steam/dota2/loader/sample/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)