forked from journeyapps/zxing-android-embedded
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
91 lines (74 loc) · 3.02 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
}
}
// Projects to be published to bintray
def PUBLISH_PROJECTS = ['zxing-android-embedded']
subprojects {
repositories {
jcenter()
}
version = '3.0.3'
group = 'com.journeyapps'
apply plugin: 'android-sdk-manager'
ext.androidBuildTools = '21.1.2'
ext.androidTargetSdk = 21
ext.zxingCore = 'com.google.zxing:core:3.2.0'
if (PUBLISH_PROJECTS.contains(project.name)) {
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
project.ext.artifactId = project.name // Default to subproject name
afterEvaluate {
task sourceJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
publishing {
publications {
// We need this check to cover Android Studio gradle sync
if(project.tasks.findByPath('bundleRelease') != null) {
maven(MavenPublication) {
artifact bundleRelease
artifactId project.artifactId
artifact sourceJar
pom.withXml {
// HACK to add dependencies to POM.
// When maven-publish can do this automatically for Android projects,
// remove this section.
def deps = asNode().appendNode('dependencies')
project.configurations.compile.allDependencies.each { dep ->
def node = deps.appendNode('dependency')
node.appendNode('groupId', dep.group)
node.appendNode('artifactId', dep.name)
node.appendNode('version', dep.version)
node.appendNode('scope', 'compile')
}
}
}
}
}
}
// To release, place bintray_user and bintray_key properties in ~/.gradle/gradle.properties,
// and run ./gradlew clean assembleRelease bintrayUpload
if(project.hasProperty('bintray_user') && project.hasProperty('bintray_key')) {
bintray {
user = bintray_user
key = bintray_key
publications = ['maven']
publish = true
pkg {
userOrg = 'journeyapps'
repo = 'maven'
name = 'zxing-android-embedded'
}
}
}
}
}
}