-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
106 lines (86 loc) · 2.99 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.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
}
ext {
ARTIFACT_ID = 'gawrapper'
VERSION_NAME = '0.0.2'
VERSION_CODE = 2 //your version
DESCRIPTION = 'Library that wraps the measurement collection api'
SITE_URL = 'https://github.com/WaiLynnZaw/analytics_wrapper'
GIT_URL = 'https://github.com/WaiLynnZaw/analytics_wrapper'
GROUP_NAME = 'none'
COMPILE_SDK = 25
BUILD_TOOLS = '25.0.2'
MODULE_NAME = 'gawrapper'
LICENSE = 'Apache-2.0'
DEVELOPER_ID = 'wailynnzaw'
DEVELOPER_NAME = 'wailynnzaw'
DEVELOPER_EMAIL = 'wailynnzaw.lamz@gmail.com'
IS_UPLOADING = project.getGradle().startParameter.taskNames.any{it.contains('bintrayUpload')}
}
subprojects {
repositories {
jcenter()
}
group = GROUP_NAME
version = VERSION_NAME
if (IS_UPLOADING && project.name in ['compiler','api']) {
println project.name
apply plugin: 'maven'
gradle.taskGraph.whenReady { taskGraph ->
def pomTask = taskGraph.getAllTasks().find{
it.path == ":$project.name:generatePomFileForMavenPublication"
}
if (pomTask == null) return;
pomTask.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"
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")
}
}
}
}