11apply plugin : ' java'
2+ apply plugin : ' maven-publish'
3+ apply plugin : ' com.jfrog.bintray'
24
35sourceCompatibility = " 1.7"
46targetCompatibility = " 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+
621dependencies {
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+
0 commit comments