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

Commit 9138528

Browse files
committed
Added maven publishing things
1 parent 4709590 commit 9138528

11 files changed

Lines changed: 97 additions & 21 deletions

File tree

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firebase-fetcher/build.gradle

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ android {
99
targetSdkVersion 25
1010
versionCode 1
1111
versionName "1.0"
12-
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14-
1512
}
1613
buildTypes {
1714
release {
@@ -22,12 +19,9 @@ android {
2219
}
2320

2421
dependencies {
25-
compile fileTree(dir: 'libs', include: ['*.jar'])
26-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27-
exclude group: 'com.android.support', module: 'support-annotations'
28-
})
29-
compile 'com.android.support:appcompat-v7:25.1.0'
3022
testCompile 'junit:junit:4.12'
3123
compile 'com.google.firebase:firebase-config:10.0.0'
3224
compile project(":library")
33-
}
25+
}
26+
27+
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

firebase-fetcher/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
POM_NAME=FirebaseFetcher
2+
POM_ARTIFACT_ID=firebase-fetcher
3+
POM_PACKAGING=aar
4+
POM_DESCRIPTION=Fetcher of app version from firebase remote config

gradle.properties

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# Project-wide Gradle settings.
2-
32
# IDE (e.g. Android Studio) users:
43
# Gradle settings configured through the IDE *will override*
54
# any settings specified in this file.
6-
75
# For more details on how to configure your build environment visit
86
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
107
# Specifies the JVM arguments used for the daemon process.
118
# The setting is particularly useful for tweaking memory settings.
129
org.gradle.jvmargs=-Xmx1536m
13-
1410
# When configured, Gradle will run in incubating parallel mode.
1511
# This option should only be used with decoupled projects. More details, visit
1612
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1713
# org.gradle.parallel=true
14+
VERSION_NAME=0.9.1
15+
VERSION_CODE=1
16+
GROUP=cz.ackee.versionfetcher
17+
POM_DESCRIPTION=Fetcher for application version with resolving status
18+
POM_URL=
19+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
20+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
21+
POM_LICENCE_DIST=repo
22+
POM_DEVELOPER_ID=davidbilik
23+
POM_DEVELOPER_NAME=David Bilik

gradle/gradle-mvn-push.gradle

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'maven-publish'
3+
4+
def isReleaseBuild() {
5+
return VERSION_NAME.contains("SNAPSHOT") == false
6+
}
7+
8+
9+
def getDestUrl() {
10+
if (isReleaseBuild()) {
11+
return "s3://android-maven/releases"
12+
} else {
13+
return "s3://android-maven/snapshots"
14+
}
15+
}
16+
17+
18+
publishing {
19+
publications {
20+
aar(MavenPublication) { // Publish aar knihovnu
21+
groupId GROUP
22+
version = VERSION_NAME
23+
artifactId POM_ARTIFACT_ID
24+
25+
// Tell maven to prepare the generated "*.aar" file for publishing
26+
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
27+
pom.withXml {
28+
//Creating additional node for dependencies
29+
def dependenciesNode = asNode().appendNode('dependencies')
30+
31+
//Defining configuration names from which dependencies will be taken (debugCompile or releaseCompile and compile)
32+
def configurationNames = ["releaseCompile", 'compile']
33+
34+
configurationNames.each { configurationName ->
35+
configurations[configurationName].allDependencies.each {
36+
if (it.group != null && it.name != null && it.version != null && it.version != 'unspecified') {
37+
def dependencyNode = dependenciesNode.appendNode('dependency')
38+
dependencyNode.appendNode('groupId', it.group)
39+
dependencyNode.appendNode('artifactId', it.name)
40+
dependencyNode.appendNode('version', it.version)
41+
42+
//If there are any exclusions in dependency
43+
if (it.excludeRules.size() > 0) {
44+
def exclusionsNode = dependencyNode.appendNode('exclusions')
45+
it.excludeRules.each { rule ->
46+
def exclusionNode = exclusionsNode.appendNode('exclusion')
47+
exclusionNode.appendNode('groupId', rule.group)
48+
exclusionNode.appendNode('artifactId', rule.module)
49+
}
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
repositories {
58+
add isReleaseBuild() ? project.repositories.s3releases : project.repositories.s3snapshots
59+
}
60+
}

gradlew

100644100755
File mode changed.

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ android {
2727
dependencies {
2828
testCompile 'junit:junit:4.12'
2929
compile 'io.reactivex:rxjava:1.2.5'
30-
compile 'io.reactivex:rxandroid:0.24.0'
31-
testCompile 'com.android.support.test:runner:0.5'
3230
}
31+
32+
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

library/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
POM_NAME=StatusResolver
2+
POM_ARTIFACT_ID=status-resolver
3+
POM_PACKAGING=aar
4+
POM_DESCRIPTION=Resolver of application update status

rest-fetcher/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ android {
2222
}
2323

2424
dependencies {
25-
compile fileTree(dir: 'libs', include: ['*.jar'])
26-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27-
exclude group: 'com.android.support', module: 'support-annotations'
28-
})
29-
compile 'com.android.support:appcompat-v7:25.1.0'
3025
compile 'com.squareup.retrofit2:retrofit:2.1.0'
3126
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
3227
compile "com.squareup.retrofit2:adapter-rxjava:2.1.0"
3328
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
3429
testCompile 'junit:junit:4.12'
3530
compile project(":library")
3631
}
32+
33+
34+
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

0 commit comments

Comments
 (0)