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

Commit 9e67e11

Browse files
committed
Added maven package configurations
1 parent e02cd50 commit 9e67e11

File tree

10 files changed

+126
-51
lines changed

10 files changed

+126
-51
lines changed

annotations-processor/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ apply plugin: 'java'
55
sourceCompatibility = JavaVersion.VERSION_1_7
66
targetCompatibility = JavaVersion.VERSION_1_7
77

8+
9+
/**
10+
* Upload new library version:
11+
* > gradlew install
12+
* > gradlew bintrayUpload
13+
*/
14+
15+
16+
//Without this line the Bintray upload will fail as it uses the module directory name as artifactId
17+
archivesBaseName = POM_ARTIFACT_ID
18+
group = GROUP
19+
version = VERSION_NAME
20+
21+
22+
823
dependencies {
924
compile fileTree(include: ['*.jar'], dir: 'libs')
1025
compile project(':annotations')
@@ -18,3 +33,6 @@ dependencies {
1833
// Fix for warning: "bootstrap class path not set in conjunction with -source 1.7"
1934
compileOnly files(Jvm.current().getToolsJar())
2035
}
36+
37+
apply from: rootProject.file('publish-library.gradle')
38+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=android-retainable-tasks-compiler
2+
POM_NAME=Android-Retainable-Tasks-Compiler
3+
POM_PACKAGING=jar

annotations/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ dependencies {
1010

1111
// Fix for warning: "bootstrap class path not set in conjunction with -source 1.7"
1212
compileOnly files(Jvm.current().getToolsJar())
13-
}
13+
}
14+
15+
apply from: rootProject.file('publish-library.gradle')

annotations/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=android-retainable-tasks-annotations
2+
POM_NAME=Android-Retainable-Tasks-Annotations
3+
POM_PACKAGING=jar

build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:2.3.2'
9-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
10-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
11-
//classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
9+
10+
// Bintray
11+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
12+
13+
// Maven for Android projects
14+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1215
// NOTE: Do not place your application dependencies here; they belong
1316
// in the individual module build.gradle files
1417
}

demo/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ android {
2121

2222
dependencies {
2323
compile project(':library')
24+
compile project(":annotations")
2425
annotationProcessor project(":annotations-processor")
2526
//compile 'org.neotech.library:android-retainable-tasks:1.0.0-alpha-1'
2627

gradle.properties

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,25 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
20+
GROUP=org.neotech.library
21+
VERSION_NAME=1.0.0-alpha-1
22+
23+
BINTRAY_REPO=maven
24+
BINTRAY_LICENCE=Apache-2.0
25+
26+
POM_DESCRIPTION=Android-Retainable-Tasks is an easy to use mini-library for easy asynchronous background tasking with callback support to the UI. This library is based on the Android AsyncTask implementation but with support for retaining tasks and therefore surviving configuration changes (orientation).
27+
28+
POM_URL=https://github.com/NeoTech-Software/Android-Retainable-Tasks
29+
POM_SCM_URL=https://github.com/NeoTech-Software/Android-Retainable-Tasks
30+
POM_SCM_CONNECTION=scm:git:git://github.com/NeoTech-Software/Android-Retainable-Tasks.git
31+
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/NeoTech-Software/Android-Retainable-Tasks.git
32+
33+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
34+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
35+
POM_LICENCE_DIST=repo
36+
37+
POM_DEVELOPER_ID=rolf-smit
38+
POM_DEVELOPER_NAME=Rolf Smit
39+
POM_DEVELOPER_EMAIL=[email protected]

library/build.gradle

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
apply plugin: 'com.android.library'
22

3-
ext {
3+
//ext {
44
/**
55
* Upload new library version:
66
* > gradlew install
77
* > gradlew bintrayUpload
88
*/
99

10+
/*
11+
1012
bintrayRepo = 'maven'
1113
bintrayName = 'android-retainable-tasks' //Should match the name of the Bintray online repository
1214
@@ -29,11 +31,12 @@ ext {
2931
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
3032
allLicenses = ["Apache-2.0"]
3133
}
34+
*/
3235

3336
//Without this line the Bintray upload will fail as it uses the module directory name as artifactId
34-
archivesBaseName = artifact
35-
group = publishedGroupId
36-
version = libraryVersion
37+
archivesBaseName = POM_ARTIFACT_ID
38+
group = GROUP
39+
version = VERSION_NAME
3740

3841
android {
3942
compileSdkVersion 25
@@ -42,7 +45,7 @@ android {
4245
defaultConfig {
4346
minSdkVersion 14
4447
targetSdkVersion 25
45-
versionName = libraryVersion
48+
versionName = VERSION_NAME
4649
}
4750
buildTypes {
4851
release {
@@ -53,17 +56,24 @@ android {
5356
}
5457

5558
configurations {
56-
javadocCompile
59+
javadoc
5760
}
5861

5962
dependencies {
6063
compile fileTree(include: ['*.jar'], dir: 'libs')
64+
65+
compile project(':annotations')
66+
67+
// Android Architecture Lifecycle library to support using the TaskManagerLifeCycleProxy in
68+
// combination with LifecycleOwner.getLifecycle().addObserver().
6169
compile 'android.arch.lifecycle:extensions:1.0.0-alpha1'
6270
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
63-
testCompile 'junit:junit:4.12'
71+
72+
// Support library for the support library specific TaskManagerOwners (TaskActivityCompat).
6473
compile 'com.android.support:appcompat-v7:25.3.1'
65-
javadocCompile 'com.android.support:appcompat-v7:25.3.1'
66-
compile project(':annotations')
74+
javadoc 'com.android.support:appcompat-v7:25.3.1'
75+
76+
testCompile 'junit:junit:4.12'
6777
}
6878

69-
apply from: 'publish-library.gradle'
79+
apply from: rootProject.file('publish-library.gradle')

library/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=android-retainable-tasks
2+
POM_NAME=Android-Retainable-Tasks
3+
POM_PACKAGING=aar
Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,62 @@
11
apply plugin: 'com.github.dcendents.android-maven'
22

3-
group = publishedGroupId // Maven Group ID for the artifact
3+
4+
5+
6+
group = GROUP // Maven Group ID for the artifact
47

58
install {
69
repositories.mavenInstaller {
710
// This generates POM.xml with proper parameters
11+
812
pom {
913

14+
groupId = GROUP
15+
artifactId = POM_ARTIFACT_ID
16+
version = VERSION_NAME
17+
1018
project {
11-
packaging 'aar'
12-
groupId publishedGroupId
13-
artifactId artifact
19+
packaging POM_PACKAGING
20+
1421

1522
// Add your description here
16-
name libraryName
17-
description libraryDescription
18-
url siteUrl
23+
name POM_NAME
24+
description POM_DESCRIPTION
25+
url POM_URL
1926

2027
// Set your license
2128
licenses {
2229
license {
23-
name licenseName
24-
url licenseUrl
30+
name POM_LICENCE_NAME
31+
url POM_LICENCE_URL
2532
}
2633
}
2734
developers {
2835
developer {
29-
id developerId
30-
name developerName
31-
email developerEmail
36+
id POM_DEVELOPER_ID
37+
name POM_DEVELOPER_NAME
38+
email POM_DEVELOPER_EMAIL
3239
}
3340
}
3441
scm {
35-
connection gitUrl
36-
developerConnection gitUrl
37-
url siteUrl
42+
connection POM_SCM_CONNECTION
43+
developerConnection POM_SCM_DEV_CONNECTION
44+
url POM_SCM_URL
3845

3946
}
4047
}
4148
}
4249
}
4350
}
4451

45-
46-
47-
4852
apply plugin: 'com.jfrog.bintray'
4953

50-
version = libraryVersion
54+
version = VERSION_NAME
55+
56+
if (project.getPlugins().hasPlugin('com.android.application') ||
57+
project.getPlugins().hasPlugin('com.android.library')) {
58+
// Android libraries
5159

52-
if (project.hasProperty("android")) { // Android libraries
5360
task sourcesJar(type: Jar) {
5461
classifier = 'sources'
5562
from android.sourceSets.main.java.srcDirs
@@ -60,7 +67,15 @@ if (project.hasProperty("android")) { // Android libraries
6067
failOnError = false
6168
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
6269
}
63-
} else { // Java libraries
70+
71+
// Makes sure JavaDoc knows our dependencies
72+
afterEvaluate {
73+
javadoc.classpath += files(android.libraryVariants.collect { variant ->
74+
variant.javaCompile.classpath.files
75+
})
76+
}
77+
} else {
78+
// Java libraries
6479
task sourcesJar(type: Jar, dependsOn: classes) {
6580
classifier = 'sources'
6681
from sourceSets.main.allSource
@@ -69,7 +84,7 @@ if (project.hasProperty("android")) { // Android libraries
6984

7085
task javadocJar(type: Jar, dependsOn: javadoc) {
7186
classifier = 'javadoc'
72-
from javadoc.destinationDir
87+
from javadoc.getDestinationDir()
7388
}
7489

7590
artifacts {
@@ -86,24 +101,20 @@ bintray {
86101
key = properties.getProperty("bintray.apikey")
87102

88103
configurations = ['archives']
104+
105+
// Bintry package information
89106
pkg {
90-
repo = bintrayRepo
91-
name = bintrayName
92-
desc = libraryDescription
93-
websiteUrl = siteUrl
94-
vcsUrl = gitUrl
95-
licenses = allLicenses
107+
repo = BINTRAY_REPO
108+
name = POM_ARTIFACT_ID
109+
desc = POM_DESCRIPTION
110+
websiteUrl = POM_URL
111+
vcsUrl = POM_SCM_URL
112+
licenses = [BINTRAY_LICENCE]
96113
publish = true
97114
publicDownloadNumbers = true
98115
version {
99-
desc = libraryDescription
100-
/*
101-
gpg {
102-
sign = true //Determines whether to GPG sign the files. The default is false
103-
passphrase = properties.getProperty("bintray.gpg.password")
104-
//Optional. The passphrase for GPG signing'
105-
}
106-
*/
116+
name = VERSION_NAME
117+
released = new Date();
107118
}
108119
}
109120
}

0 commit comments

Comments
 (0)