This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
build.gradle
149 lines (127 loc) · 5.14 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
apply from: 'dependencies.gradle'
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
group = 'me.dm7.barcodescanner'
version = '1.9.13'
repositories {
google()
jcenter()
}
ext {
isLibrary = false
}
}
subprojects {
afterEvaluate { Project project ->
ext.pluginContainer = project.getPlugins()
if(ext.pluginContainer.hasPlugin("com.android.application") || ext.pluginContainer.hasPlugin("com.android.library")) {
android {
compileSdkVersion versions.compile_sdk
buildToolsVersion versions.build_tools
android {
lintOptions {
abortOnError false
}
}
defaultConfig {
minSdkVersion versions.min_sdk
targetSdkVersion versions.target_sdk
versionCode 1913
versionName "1.9.13"
}
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def bintrayUser = properties.getProperty('bintray.user')
def bintrayApikey = properties.getProperty('bintray.apikey')
if(project.isLibrary && bintrayUser?.trim() && bintrayApikey?.trim()) {
configure(project) {
apply plugin: 'com.github.dcendents.android-maven'
group = project.group // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
pom.project {
name project.pomName
version project.version
groupId project.group
packaging project.pomPackaging
artifactId project.pomArtifactId
description project.pomDescription
url 'https://github.com/dm77/barcodescanner'
scm {
url 'scm:git@github.com:dm77/barcodescanner.git'
connection 'scm:git@github.com:dm77/barcodescanner.git'
developerConnection 'scm:git@github.com:dm77/barcodescanner.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'dm77'
name 'Dushyanth Maguluru'
email 'dushyanth.maguluru@gmail.com'
}
}
}
}
}
apply plugin: 'com.jfrog.bintray'
version = '1.9.13'
if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
}
artifacts {
archives sourcesJar
}
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = 'maven'
name = 'me.dm7.barcodescanner:' + project.pomArtifactId
desc = 'Barcode Scanner Libraries for Android'
websiteUrl = 'https://github.com/dm77/barcodescanner'
vcsUrl = 'https://github.com/dm77/barcodescanner.git'
licenses = ["Apache-2.0"]
publish = true
publicDownloadNumbers = true
version {
desc = 'Barcode Scanner Libraries for Android'
gpg {
sign = false
}
}
}
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.1'
}