forked from dragon66/pixymeta-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
110 lines (85 loc) · 3.88 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
// global project specific properties
github_repository='pixymeta-android'
project_version='1.1.0-SNAPSHOT'
project_licence_name='Eclipse Public License - v 1.0'
// default for global project specific properties from file gradle.properties
if (!hasProperty("github_userId")) github_userId='dragon66'
// these must be defined in gradle.properties
if (!hasProperty("mavenUpload_publisher_name")) mavenUpload_publisher_name= ''
if (!hasProperty("mavenUpload_publisher_email")) mavenUpload_publisher_email= ''
// calculated properties
project_description="${github_userId}.${github_repository} ver ${project_version}"
project_isReleaseVersion = !project_version.endsWith("SNAPSHOT")
// Params for Task uploadArchives
if (!hasProperty("mavenUpload_serverUrl")) mavenUpload_serverUrl = (project_isReleaseVersion) ? "https://oss.sonatype.org/service/local/staging/deploy/maven2/" : "https://oss.sonatype.org/content/repositories/snapshots/"
}
// reset mavenUpload_serverUrl to local if parameter is missing
if (!hasProperty("signing.keyId") || !hasProperty("signing.password") || !hasProperty("signing.secretKeyRingFile")) {
ext.mavenUpload_serverUrl = "file:./build/testrepository/"
logger.info "signing.keyId=... or signing.password=... or signing.secretKeyRingFile=.. not found in gradle.properties\n"
logger.info "Cannot upload to 'maven@https://oss.sonatype.org/...' . Using repository '${mavenUpload_serverUrl}' instead \n"
}
if (!hasProperty("mavenUpload_login") || !hasProperty("mavenUpload_password")) {
ext.mavenUpload_serverUrl = "file:./build/testrepository/"
logger.info "mavenUpload_login=... or mavenUpload_password=.. not found in gradle.properties\n"
logger.info "Cannot upload to 'maven@https://oss.sonatype.org/...' . Using '${mavenUpload_serverUrl}' instead \n"
}
description = "${project_description}"
buildscript {
repositories {
jcenter()
}
dependencies {
// see https://jcenter.bintray.com/com/android/tools/build/gradle/
classpath 'com.android.tools.build:gradle:2.1.0'
// classpath 'com.android.tools.build:gradle:2.2.0-alpha1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// https://github.com/palantir/gradle-jacoco-coverage
classpath 'com.palantir:jacoco-coverage:0.4.0'
}
}
allprojects {
repositories {
jcenter()
}
// http://stackoverflow.com/questions/28450703/how-to-set-the-language-level-in-gradle-so-it-is-ide-agnostic/35827609#35827609
tasks.withType(JavaCompile) {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
}
// download and generate gradlew which is not part of this repository and is required by travis
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
description = "(Re-)Genarate wrapper for Gradle version ${gradleVersion}."
}
task clean {
description = "Delete the build directories."
dependsOn { subprojects.clean }
}
task uploadArchives {
description = "Upload ${project_description} to maven repository '${mavenUpload_serverUrl}'."
dependsOn { subprojects.uploadArchives }
}
task javadocJar {
description = "Generates javadoc jar."
dependsOn { subprojects.javadocJar }
}
/* not working
// https://discuss.gradle.org/t/merge-jacoco-coverage-reports-for-multiproject-setups/12100/6
// https://docs.gradle.org/current/dsl/org.gradle.testing.jacoco.tasks.JacocoMerge.html
task jacocoMerge(type: JacocoMerge) {
subprojects.each { subproject ->
executionData subproject.tasks.withType(Test)
}
}
*/
// https://github.com/palantir/gradle-jacoco-coverage
apply plugin: 'com.palantir.jacoco-full-report'
jacocoFull {
// dependson ":pixymeta-core-lib:test", ":pixymeta-ext-lib:test"
// excludeProject ":my-sub-project", ":buildSrc"
}