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

Commit 6a20710

Browse files
committed
Inc version, update gradle and update maven publish script
1 parent c524ba0 commit 6a20710

5 files changed

Lines changed: 5518 additions & 24 deletions

File tree

.idea/markdown-navigator/profiles_settings.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.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.3.0'
10+
classpath 'com.android.tools.build:gradle:2.3.3'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212
}
1313
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ org.gradle.jvmargs=-Xmx1536m
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel=true
14-
VERSION_NAME=1.0.0
14+
VERSION_NAME=1.0.1
1515
VERSION_CODE=1
1616
GROUP=cz.ackee.updatechecker
1717
POM_DESCRIPTION=Fetcher for application version with resolving status

gradle/gradle-mvn-push.gradle

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ def isReleaseBuild() {
55
return VERSION_NAME.contains("SNAPSHOT") == false
66
}
77

8-
98
def getDestUrl() {
109
if (isReleaseBuild()) {
1110
return "s3://android-maven/releases"
@@ -14,39 +13,77 @@ def getDestUrl() {
1413
}
1514
}
1615

16+
/**
17+
* 'type: Javadoc' doesn't define a parameter but rather a type of the task
18+
* There are about 40 different types available in docs.
19+
*
20+
* @see {https://docs.gradle.org/3.3/dsl/org.gradle.api.Task.html}
21+
*
22+
* @note Kotlin doesn't define javadoc but dokkaJavadoc using DokkaTask. This implementation
23+
* will probably always return empty javadoc for kotlin files.
24+
*/
25+
task androidJavadocs(type: Javadoc) {
26+
source = android.sourceSets.main.java.srcDirs
27+
}
28+
task androidJavadocsJar(type: Jar) {
29+
classifier = 'javadoc'
30+
from androidJavadocs.destinationDir
31+
}
32+
task androidSourcesJar(type: Jar) {
33+
classifier = 'sources'
34+
from android.sourceSets.main.java.srcDirs
35+
}
36+
37+
artifacts {
38+
archives androidSourcesJar
39+
archives androidJavadocsJar
40+
}
1741

42+
43+
// publishing part is defined in maven-publish and is run only during :publish
1844
publishing {
1945
publications {
20-
aar(MavenPublication) { // Publish aar knihovnu
46+
// aar here is our custom publication name
47+
aar(MavenPublication) {
2148
groupId GROUP
2249
version = VERSION_NAME
2350
artifactId POM_ARTIFACT_ID
2451

25-
// Tell maven to prepare the generated "*.aar" file for publishing
26-
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
52+
// This file is generated by previous :assemble command
53+
artifact "$buildDir/outputs/aar/${project.getName()}-release.aar"
54+
// These files are generated by tasks defined above during :publish
55+
artifact androidSourcesJar
56+
artifact androidJavadocsJar
57+
58+
// pom.withXml lets us tweak the POM file before publishing
2759
pom.withXml {
28-
//Creating additional node for dependencies
60+
// Create additional node for dependencies
2961
def dependenciesNode = asNode().appendNode('dependencies')
3062

31-
//Defining configuration names from which dependencies will be taken (debugCompile or releaseCompile and compile)
63+
// Defining configuration names from which dependencies will be taken (debugCompile or releaseCompile and compile)
3264
def configurationNames = ["releaseCompile", 'compile']
3365

3466
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-
}
67+
configurations[configurationName].allDependencies.each { Dependency dependency ->
68+
69+
if (dependency.group == null ||
70+
dependency.name == null ||
71+
dependency.version == null ||
72+
dependency.version == 'unspecified')
73+
return // ignore invalid dependencies
74+
75+
def dependencyNode = dependenciesNode.appendNode('dependency')
76+
dependencyNode.appendNode('groupId', dependency.group)
77+
dependencyNode.appendNode('artifactId', dependency.name)
78+
dependencyNode.appendNode('version', dependency.version)
79+
80+
// If there are any exclusions in dependency
81+
if (dependency.excludeRules.size() > 0) {
82+
def exclusionsNode = dependencyNode.appendNode('exclusions')
83+
dependency.excludeRules.each { rule ->
84+
def exclusionNode = exclusionsNode.appendNode('exclusion')
85+
exclusionNode.appendNode('groupId', rule.group)
86+
exclusionNode.appendNode('artifactId', rule.module)
5087
}
5188
}
5289
}

0 commit comments

Comments
 (0)