-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
114 lines (98 loc) · 4.04 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.uploadInfo = [
'userOrg' : 'why8n',
'groupId' : 'com.whyn',
'website' : 'https://github.com/Why8n/InjectManifest',
'licences': ['Apache-2.0'],
]
ext.versions = [
'injectmanifest_annotations_version': '1.0.0',
'injectmanifest_compiler_version' : '1.1.0',
'injectmanifest_plugin_version' : '1.3.0',
'bintrayRelease' : '0.5.0',
'minSdk' : 18,
'compileSdk' : 26,
'versionCode' : 1,
'versionName' : '1.0',
'buildTools' : '26.0.1',
'supportLibrary' : '26.0.0-alpha1',
'androidPlugin' : '2.2.2',
'constraint' : '1.0.1'
]
ext.deps = [
android : [
'gradlePlugin': "com.android.tools.build:gradle:${versions.androidPlugin}",
],
'support': [
'compat' : "com.android.support:appcompat-v7:${versions.supportLibrary}",
'annotations': "com.android.support:support-annotations:${versions.supportLibrary}",
],
junit : 'junit:junit:4.12',
'auto' : [
'service': 'com.google.auto.service:auto-service:1.0-rc3',
],
layout : [
'constraint': "com.android.support.constraint:constraint-layout:${versions.constraint}"
],
]
repositories {
jcenter()
maven {//本地Maven仓库地址
url uri('D:/Android/repos')
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.androidPlugin}"
classpath 'com.whyn.plugin:injectmanifest:1.0.0'
classpath "com.novoda:bintray-release:${versions.bintrayRelease}"
// classpath "com.whyn:injectmanifest-plugin:${versions.injectmanifest_plugin_version}"
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.3"
// 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 { project ->
if (project.name != 'sample') {
project.task('upload2jcenter', type: Exec) {
group = "whyn"
description = "upload module to jcenter by bintray-release"
def cmdProc;
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
cmdProc = ['cmd', '/c']
} else {
cmdProc = ['./sh']
}
File bintrayFile = rootProject.file('bintray.properties')
if (bintrayFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(bintrayFile))
workingDir rootProject.projectDir.absolutePath
def userName =properties['userName']
def bintrayKey =properties['bintrayKey']
cmdProc += ['gradlew.bat',
'clean',
'build',
"${project.name}:bintrayUpload",
"-PbintrayUser=$userName",
"-PbintrayKey=$bintrayKey",
'-PdryRun=false']
commandLine cmdProc
} else {
cmdProc += "echo failed to upload:${project.name},no bintray.properties found"
commandLine cmdProc
}
}
}
}