Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59d9e6a

Browse files
author
Ray Hunter
committed
Added the local maven publish to the HeaderListView build script. Added support for versioned builds.
1 parent 616fe8d commit 59d9e6a

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

HeaderListView/build.gradle

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,50 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'maven-publish'
33

4+
dependencies {
5+
compile 'com.android.support:appcompat-v7:19+'
6+
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
7+
}
8+
49
publishing {
510
publications {
611
HeaderListView(MavenPublication) {
7-
artifact './build/outputs/aar/' + project.name + type
12+
artifact './build/outputs/aar/' + project.name + '-' + project.version + '.aar'
13+
14+
pom.withXml {
15+
Node deps = asNode().appendNode('dependencies')
16+
project.configurations.compile.dependencies.each() { obj ->
17+
if (obj.group?.trim()) {
18+
Node dep = new Node(deps, 'dependency')
19+
dep.appendNode('groupId', obj.group)
20+
dep.appendNode('artifactId', obj.name)
21+
dep.appendNode('version', obj.version)
22+
dep.appendNode('scope', 'compile')
23+
}
24+
}
25+
}
826
}
927
}
1028
}
1129

30+
group 'com.applidium'
31+
version '1.0'
32+
ext.androidVersionCode = 1
33+
1234
android {
1335
compileSdkVersion 19
1436
buildToolsVersion "19.1.0"
1537

1638
defaultConfig {
1739
minSdkVersion 7
1840
targetSdkVersion 19
19-
versionCode 1
20-
versionName "1.0"
41+
versionCode androidVersionCode
42+
versionName version
2143
}
22-
}
2344

24-
dependencies {
25-
compile 'com.android.support:appcompat-v7:19+'
26-
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
45+
buildTypes {
46+
release {
47+
48+
}
49+
}
2750
}

0 commit comments

Comments
 (0)