forked from tschaumburg/FastBarcodeScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
130 lines (112 loc) · 4.1 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// To release, run
// gradlew clean build bintrayUpload -PbintrayUser=tschaumburg -PbintrayKey=xxxxxxxxxxxxxxxxxx -PdryRun=false
// where xxxxxxxxxxx is retrieved from
// https://bintray.com/profile/edit
// under "API Key"
ext {
VERSION_NAME = '1.0.7'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext {
//VERSION_NAME = 'maventest'
MODULE_NAME = project.name
ARTIFACT_ID = project.name
DESCRIPTION = ' '
SITE_URL = 'https://github.com/tschaumburg/FastBarcodeScanner'
GIT_URL = 'https://github.com/tschaumburg/FastBarcodeScanner.git'
GROUP_NAME = 'dk.schaumburgit.fast-barcode-scanner'
LICENSE = 'The Apache Software License, Version 2.0'
DEVELOPER_ID = 'tschaumburg'
DEVELOPER_NAME = 'Thomas Schaumburg'
DEVELOPER_EMAIL = '[email protected]'
IS_UPLOADING = project.getGradle().startParameter.taskNames.any{it.contains('bintrayUpload')}
}
if (project.name in ['fast-barcode-scanner-demo']) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library)
publish {
userOrg = 'tschaumburg'
groupId = GROUP_NAME
artifactId = ARTIFACT_ID
uploadName = 'fast-barcode-scanner'
publishVersion = VERSION_NAME
desc = DESCRIPTION
website = SITE_URL
}
}
if (IS_UPLOADING && !(project.name in ['fast-barcode-scanner-demo'])) {
println project.name
apply plugin: 'maven'
gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().find {
it.path == ":$project.name:generatePomFileForMavenPublication"
}.doLast {
file("build/publications/maven/pom-default.xml").delete()
println 'Overriding pom-file to make sure we can sync to maven central!'
pom {
//noinspection GroovyAssignabilityCheck
project {
name "$project.name"
groupId GROUP_NAME
artifactId ARTIFACT_ID
packaging project.name == 'compiler' ? 'jar' : 'aar'
description DESCRIPTION
url SITE_URL
version VERSION_NAME
scm {
url GIT_URL
connection GIT_URL
developerConnection GIT_URL
}
licenses {
license {
name LICENSE
}
}
developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
email DEVELOPER_EMAIL
}
}
}
}.writeTo("build/publications/maven/pom-default.xml")
}
}
}
}
//}